datos-gov-co/base-de-datos-casos-de-parto-en-el-municipio-de-3w74-b2fr
Icon for Socrata external plugin

Query the Data Delivery Network

Query the DDN

The easiest way to query any data on Splitgraph is via the "Data Delivery Network" (DDN). The DDN is a single endpoint that speaks the PostgreSQL wire protocol. Any Splitgraph user can connect to it at data.splitgraph.com:5432 and query any version of over 40,000 datasets that are hosted or proxied by Splitgraph.

For example, you can query the base_de_datos_casos_de_parto_en_el_municipio_de table in this repository, by referencing it like:

"datos-gov-co/base-de-datos-casos-de-parto-en-el-municipio-de-3w74-b2fr:latest"."base_de_datos_casos_de_parto_en_el_municipio_de"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "fecha_de_ingreso_al_control", -- FECHA DE INGRESO AL CONTROL PRENATAL (día-mes-año)
    "fecha_de_consulta_de", -- FECHA DE CONSULTA DE PSICOLOGIA
    "fecha_de_consulta_de_1", -- FECHA DE CONSULTA DE GINECOBSTETRICIA
    "fecha_de_consulta_por", -- FECHA DE CONSULTA POR NUTRICION
    "fecha_de_eco_de_detalle_semana", -- FECHA DE ECO DE DETALLE SEMANA 18 Y  SEMANA 23 + 6 DIAS(año-mes-día)
    "embarazo_deseado_si_no", -- Embarazo deseado (SI - NO)
    "edad_gestacional_al_ingreso", -- EDAD GESTACIONAL AL INGRESO A CPN
    "edad_gestacional_a_corte", -- Edad gestacional
    "ecografia_entre_las_semanas", -- ECOGRAFIA ENTRE LAS SEMANAS 10 SEMANAS + 6 DIAS Y 13 SEMANAS + 6 DIAS.
    "diastolica_ultimo_control", -- DIASTOLICA ULTIMO CONTROL
    "diabetes_si_no", -- Diabetes (SI - NO)
    "fecha_de_la_prueba_de_embarazo", -- Fecha de realización de la prueba de embarazo 
    "fecha_de_parto_dia_mes_a", -- Fecha de Parto 
    "fecha_de_ultimo_control_d", -- FECHA DE ULTIMO CONTROL (día-mes-año)
    "fecha_eco_obstetrica_iii", -- FECHA ECO OBSTETRICA III TRIMESTRE (percentil mayor a 90 y menor de 10)
    "fecha_ig_g_toxoplasma_gondi", -- Fecha Ig G Toxoplasma Gondi  (año-mes-día)
    "fecha_ig_m_toxoplasma_gondi", -- Fecha Ig M Toxoplasma Gondi  (año-mes-día)
    "fecha_probable_de_parto_por", -- FECHA PROBABLE DE PARTO POR FUR O ECO (día-mes-año)
    "fecha_toma_1_vdrl_a_o_mes", -- Fecha toma 1  VDRL  (año-mes-día)
    "fecha_toma_1_vih_a_o_mes", -- Fecha Toma 1 VIH (año-mes-día)
    "fecha_toma_2_hemograma_a", -- Fecha Toma 2 Hemograma (año-mes-día)
    "fecha_toma_2_vih_a_o_mes", -- Fecha Toma 2 VIH  (año-mes-día)
    "clasificaci_n_del_imc", -- Clasificación del IMC
    "cesareas", -- Cesáreas del paciente
    "fecha_toma_3_vih_dia_mes", -- Fecha Toma 3 VIH (dia-mes-año)
    "fecha_toma_chagas_a_o_mes", -- FECHA TOMA CHAGAS (año-mes-día)
    "fecha_toma_cultivo_vaginal", -- Fecha Toma cultivo Vaginal Para Estreptocoo del grupo B. semana 35 a 37 (año-mes-día)
    "caracteristicas_del_parto", -- Caracteristicas del parto VAGINAL-CESAREA
    "captacion_temprana_si_no", -- CAPTACION TEMPRANA (SI – NO)
    "apoyo_familiar_si_no", -- Apoyo familiar (SI - NO)
    "trimestre_de_ingreso_a_1", -- TRIMESTRE DE INGRESO
    "abortos", -- Abortos del paciente
    "dx1",
    "sexo", -- sexo del paciente
    "fecha_toma_de_3_vdrl_a_o", -- Fecha toma de 3 VDRL (año-mes-día)
    "fecha_toma_de_parcial_de", -- Fecha toma de Parcial de orina (año-mes-día)
    "fecha_toma_frotis_vaginal", -- Fecha toma Frotis vaginal  (año-mes-día)
    "fecha_toma_glicemia_a_o_mes", -- FECHA TOMA GLICEMIA (año-mes-día)
    "fecha_toma_hemoclasificaci", -- Fecha Toma Hemoclasificación (año-mes-día)
    "ciclo_de_vida", -- Etapa de vida del paciente
    "edad", -- Edad del paciente
    "nombre_ips_reps", -- Nombre IPS del paciente
    "departamento_de_residencia", -- Nombre departamento del paciente
    "orden", -- Registros ordenados desde el primer caso reportado
    "municpio_de_residencia", -- Municpio de residencia del paciente
    "zona_de_ubicaci_n_de_la", -- ubicación de residencia 
    "grupo_poblacional", -- grupo poblacional perteneciente del paciente
    "tipo_de_id", -- Tipo de identificacion del paciente
    "fecha_de_consejer_a_para_1", -- Fecha de consejería para toma de 3 VIH
    "fecha_de_consejer_a_para", -- Fecha de consejería para toma de 2 VIH
    "fecha_de_asesoria_lactancia", -- FECHA DE ASESORIA  LACTANCIA MATERNA
    "nacionalidad", -- nacionalidad del paciente
    "fecha_toma_hemograma_a_o", -- Fecha toma Hemograma (año-mes-día)
    "fecha_de_aplicaci_n_tdap", -- FECHA DE APLICACIÓN TdaP ACELULAR MAYOR A 26 SEMANAS
    "fecha_de_aplicaci_n_influenza", -- FECHA DE APLICACIÓN INFLUENZA MAYOR A 14 SEMANAS
    "fecha_toma_hepatitis_b_hbsag", -- Fecha Toma Hepatitis B HBsAg  (año-mes-día)
    "fecha_de_9_control_prenatal", -- FECHA DE 9 CONTROL PRENATAL
    "fecha_toma_ig_g_rubeola_a", -- Fecha toma Ig G Rubeola  (año-mes-día)
    "fecha_toma_ig_m_rubeola_a", -- Fecha toma Ig M Rubeola (año-mes-día)
    "fecha_toma_prueba_tolerancia", -- Fecha Toma prueba tolerancia a la glucosa  (año-mes-día)
    "fecha_toma_tsh_a_o_mes_d", -- FECHA TOMA TSH (año-mes-día)
    "fecha_toma_ultimo_urocultivo", -- Fecha toma ULTIMO Urocultivo  (año-mes-día)
    "fecha_toma_urocultivo_a_o", -- Fecha toma Urocultivo (año-mes-día)
    "fecha_vacunaci_n_con_bcg", -- Fecha Vacunación con BCG
    "fecha_vacunaci_n_hepatitis", -- Fecha Vacunación hepatitis B
    "fum_d_a_mes_a_o", -- FUM (día-mes-año)
    "gestacions", -- gestacion
    "h_bitos_de_riesgo_fumar", -- Hábitos de riesgo: FUMAR - SUSTANCIAS PSICOACTIVAS - ALCOHOL
    "ha_sido_victima_de_abuso", -- Ha sido victima de abuso sexual(SI - NO)
    "ha_sido_victima_de_violencia", -- Ha sido victima de violencia fisica o psicologica(SI - NO)
    "hipertension_arterial_si", -- Hipertension arterial (SI - NO)
    "indice_de_masa_corporal_imc", -- Indice de Masa Corporal (IMC)
    "informaci_n_de_causales_para", -- Información de  causales  para  IVE de acuerdo a la Sentencia C-055-2022 (dia-mes-año)
    "ips_atencion_parto", -- IPS ATENCION PARTO
    "fecha_de_8_control_prenatal", -- FECHA DE 8 CONTROL PRENATAL
    "fecha_de_7_control_prenatal", -- FECHA DE 7 CONTROL PRENATAL
    "muertos", -- fallecidos tras el parto
    "no_semanas_de_gestaci_n", -- No Semanas de gestación
    "nombre_biologico_contra_covid", -- NOMBRE BIOLOGICO CONTRA COVID 19
    "partos", -- Partos del paciente
    "peso_al_nacer_grs", -- Peso al nacer (grs)
    "peso_en_el_ultimo_control", -- PESO EN EL ULTIMO CONTROL
    "peso_inicial_kg_antes_del", -- Peso Inicial (kg) antes del embarazo
    "plan_de_parto_via_de_parto", -- PLAN DE PARTO: VIA DE PARTO : VAGINAL-CESAREA
    "reporte_de_frotis_de_flujo", -- Reporte de Frotis de flujo vaginal
    "reporte_de_glicemia_a_o_mes", -- REPORTE DE GLICEMIA (año-mes-día)
    "reporte_de_prueba_de", -- Reporte de Prueba de Tolerancia Oral a la glucosa
    "resultado_1_vdrl", -- Resultado 1 VDRL
    "resultado_3_vdrl", -- Resultado 3 VDRL
    "fecha_de_6_control_prenatal", -- FECHA DE 6 CONTROL PRENATAL
    "fecha_de_5_control_prenatal", -- FECHA DE 5 CONTROL PRENATAL
    "resultado_chagas", -- RESULTADO CHAGAS
    "resultado_de_hemoglobina", -- Resultado de Hemoglobina del 2 Hemograma
    "resultado_del_parcial_de", -- Resultado del Parcial de orina  1er Trimestre
    "resultado_elisa_para_detecci", -- Resultado ELISA  para detección de VIH  POSITIVO-NEGATIVO
    "resultado_hemoclasificaci", -- Resultado Hemoclasificación
    "resultado_hemograma", -- Resultado Hemograma
    "resultado_hepatitis_b_hbsag", -- Resultado Hepatitis B (HBsAg)
    "resultado_ig_g_rubeola", -- Resultado Ig G Rubeola
    "resultado_ig_g_toxoplasma", -- Resultado Ig G Toxoplasma Gondi
    "resultado_ig_m_rubeola", -- Resultado Ig M Rubeola
    "resultado_ig_m_toxoplasma", -- Resultado  Ig M Toxoplasma Gondi
    "resultado_ltimo_urocultivo", -- Resultado ÚLTIMO Urocultivo con antibiograma
    "resultado_prueba_vih", -- Resultado prueba VIH
    "resultado_prueba_vih_1", -- Resultado Prueba VIH
    "resultado_tsh", -- RESULTADO TSH
    "resultado_tsh_1", -- Resultado TSH
    "resultado_urocultivo_con", -- Resultado Urocultivo con antibiograma
    "resultado_vdrl", -- Resultado VDRL
    "resusltado_cutlivo_vaginal", -- Resusltado cutlivo vaginal
    "riesgo_obstetrico_al_ingreso", -- RIESGO OBSTETRICO AL INGRESO DEL CONTROL PRENATAL
    "riesgo_obstetrico_ultimo", -- RIESGO OBSTETRICO ULTIMO CONTROL PRENATAL
    "sexo_1", -- Sexo
    "sifilis_si_no", -- Sifilis (SI - NO)
    "sistolica_ultimo_control", -- SISTOLICA ULTIMO CONTROL
    "suministran_m_todo_de", -- SUMINISTRAN MÉTODO DE PLANIFICACION FAMILIAR SI-NO
    "talla_cm", -- Talla (CM)
    "talla_metros", -- Talla (metros)
    "tipo_de_metodo", -- TIPO DE METODO
    "tipo_id", -- TIPO Identificador del paciente 
    "toman_tsh_neonatal", -- Toman TSH Neonatal
    "tuberculosis_si_no", -- Tuberculosis (SI - NO)
    "vih_si_no", -- VIH (SI - NO)
    "vivos", -- Partos sanos
    "estado_actual_de_usuaria", -- estado del paciente
    "fecha_1_dosis_covid_19", -- FECHA 1 DOSIS  COVID 19
    "fecha_2_dosis_covid_19", -- FECHA 2 DOSIS  COVID 19
    "fecha_2_toma_de_vdrl_a_o", -- Fecha 2 toma de VDRL  (año-mes-día)
    "fecha_de_4_control_prenatal", -- FECHA DE 4 CONTROL PRENATAL
    "fecha_3_dosis_covid_19", -- FECHA 3 DOSIS  COVID 19
    "fecha_de_3_control_prenatal", -- FECHA DE 3 CONTROL PRENATAL
    "fecha_de_1_consulta_de", -- FECHA DE 1 CONSULTA DE ODONTOLOGIA
    "fecha_de_2_control_prenatal", -- FECHA DE 2 CONTROL PRENATAL
    "fecha_de_1_control_prenatal", -- FECHA DE 1 CONTROL PRENATAL
    "fecha_de_2_consulta_de" -- FECHA DE 2 CONSULTA DE ODONTOLOGIA
FROM
    "datos-gov-co/base-de-datos-casos-de-parto-en-el-municipio-de-3w74-b2fr:latest"."base_de_datos_casos_de_parto_en_el_municipio_de"
LIMIT 100;

Connecting to the DDN is easy. All you need is an existing SQL client that can connect to Postgres. As long as you have a SQL client ready, you'll be able to query datos-gov-co/base-de-datos-casos-de-parto-en-el-municipio-de-3w74-b2fr with SQL in under 60 seconds.

This repository is an "external" repository. That means it's hosted elsewhere, in this case at www.datos.gov.co. When you querydatos-gov-co/base-de-datos-casos-de-parto-en-el-municipio-de-3w74-b2fr:latest on the DDN, we "mount" the repository using the socrata mount handler. The mount handler proxies your SQL query to the upstream data source, translating it from SQL to the relevant language (in this case SoQL).

We also cache query responses on the DDN, but we run the DDN on multiple nodes so a CACHE_HIT is only guaranteed for subsequent queries that land on the same node.

Query Your Local Engine

Install Splitgraph Locally
bash -c "$(curl -sL https://github.com/splitgraph/splitgraph/releases/latest/download/install.sh)"
 

Read the installation docs.

Splitgraph Cloud is built around Splitgraph Core (GitHub), which includes a local Splitgraph Engine packaged as a Docker image. Splitgraph Cloud is basically a scaled-up version of that local Engine. When you query the Data Delivery Network or the REST API, we mount the relevant datasets in an Engine on our servers and execute your query on it.

It's possible to run this engine locally. You'll need a Mac, Windows or Linux system to install sgr, and a Docker installation to run the engine. You don't need to know how to actually use Docker; sgrcan manage the image, container and volume for you.

There are a few ways to ingest data into the local engine.

For external repositories (like this repository), the Splitgraph Engine can "mount" upstream data sources by using sgr mount. This feature is built around Postgres Foreign Data Wrappers (FDW). You can write custom "mount handlers" for any upstream data source. For an example, we blogged about making a custom mount handler for HackerNews stories.

For hosted datasets, where the author has pushed Splitgraph Images to the repository, you can "clone" and/or "checkout" the data using sgr cloneand sgr checkout.

Mounting Data

This repository is an external repository. It's not hosted by Splitgraph. It is hosted by www.datos.gov.co, and Splitgraph indexes it. This means it is not an actual Splitgraph image, so you cannot use sgr clone to get the data. Instead, you can use the socrata adapter with the sgr mount command. Then, if you want, you can import the data and turn it into a Splitgraph image that others can clone.

First, install Splitgraph if you haven't already.

Mount the table with sgr mount

sgr mount socrata \
  "datos-gov-co/base-de-datos-casos-de-parto-en-el-municipio-de-3w74-b2fr" \
  --handler-options '{
    "domain": "www.datos.gov.co",
    "tables": {
        "base_de_datos_casos_de_parto_en_el_municipio_de": "3w74-b2fr"
    }
}'

That's it! Now you can query the data in the mounted table like any other Postgres table.

Query the data with your existing tools

Once you've loaded the data into your local Splitgraph engine, you can query it with any of your existing tools. As far as they're concerned, datos-gov-co/base-de-datos-casos-de-parto-en-el-municipio-de-3w74-b2fr is just another Postgres schema.