datos-gov-co/cupos-en-formacin-profesional-integral-por-tipo-de-2c7k-9iru
Loading...

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 cupos_en_formacin_profesional_integral_por_tipo_de table in this repository, by referencing it like:

"datos-gov-co/cupos-en-formacin-profesional-integral-por-tipo-de-2c7k-9iru:latest"."cupos_en_formacin_profesional_integral_por_tipo_de"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "periodo", -- Periodo de tiempo cuando fue generado el reporte en  formato YYYYMM
    "reclutamiento_forzado___1", -- RECLUTAMIENTO FORZADO___Aprendices_Fem
    "reclutamiento_forzado__", -- RECLUTAMIENTO FORZADO___Aprendices_Masc
    "herido___aprendices_fem", -- HERIDO___Aprendices_Fem
    "sobrevivientes_minas_2", -- SOBREVIVIENTES_MINAS_ANTIPERSONALES___Total_Aprendices
    "herido___aprendices_masc", -- HERIDO___Aprendices_Masc
    "uso_de_menores_por_grupos_2", -- USO DE MENORES POR GRUPOS ARMADOS___Total_Aprendices
    "amenaza___aprendices_masc", -- AMENAZA___Aprendices_Masc
    "palenqueros___aprendices", -- PALENQUEROS___Aprendices_Masc
    "adolescente_trabajador__1", -- ADOLESCENTE_TRABAJADOR__Aprendices_Fem
    "tercera_edad___total", -- TERCERA_EDAD___Total
    "indigenas___total_aprendices", -- INDIGENAS___Total_
    "secuestro___total_aprendices", -- SECUESTRO___Total_Aprendices
    "palenqueros___aprendices_1", -- PALENQUEROS___Aprendices_Fem
    "jovenes_vulnerables__", -- JOVENES_VULNERABLES__Masc
    "rom___aprendices_masc", -- ROM___Aprendices_Masc
    "raizales___total_aprendices", -- RAIZALES___Total_Aprendices
    "homicidio_masacre___total", -- HOMICIDIO / MASACRE___Total_Aprendices
    "rom___aprendices_fem", -- ROM___Aprendices_Fem
    "desaparicion_forzada__", -- DESAPARICION FORZADA___Aprendices_Masc
    "rom___total_aprendices", -- ROM___Total_Aprendices
    "actos_de_grupos_armados__2", -- ACTOS DE GRUPOS ARMADOS___Total_Aprendices
    "adolescente_en_conflicto_2", -- Total ADOLESCENTE_EN_CONFLICTO_CON_LA_LEY_PENAL
    "total_discapacitados_total", -- Total Discapacitados total aprendices
    "mujer_cabeza_de_familia__1", -- MUJER_CABEZA_DE_FAMILIA__Fem
    "remitidos_por_el_pal___1", -- REMITIDOS_POR_EL_PAL___Aprendices_Fem
    "sobrevivientes_minas_1", -- SOBREVIVIENTES_MINAS_ANTIPERSONALES___Aprendices_Fem
    "tercera_edad___aprendices_1", -- TERCERA_EDAD__Fem
    "total_discapacitados_1", -- Total Discapacitados aprendices femeninos
    "total_desplazados_por_fen_2", -- Total desplazados por fenomenos naturales
    "homicidio_masacre___aprendices", -- HOMICIDIO / MASACRE___Aprendices_Masc
    "remitidos_por_el_cie___total", -- remitidos_por_el_cie___total
    "jovenes_vulnerables___total", -- JOVENES_VULNERABLES_Total
    "minas_antipersonales_y_2", -- MINAS ANTIPERSONALES Y EXPLOSIVOS___Total_Aprendices
    "negro___aprendices_fem", -- NEGRO__Fem
    "indigenas___aprendices_fem", -- INDIGENAS___Aprendices_Fem
    "codigo_centro", -- codigo_centro
    "reclutamiento_forzado___total", -- RECLUTAMIENTO FORZADO___Total_Aprendices
    "remitidos_por_el_cie___1", -- remitidos_por_el_cie___Fem
    "microempresas___aprendices_1", -- microempresas___aprendices_1 Fem
    "total_adolescente_desvinculado_2", -- TOTAL ADOLESCENTE DESVINCULADO DE GRUPOS ARMADOS ORGANIZ MAS REINTEGRADOS
    "uso_de_menores_por_grupos_1", -- USO DE MENORES POR GRUPOS ARMADOS___Aprendices_Fem
    "secuestro___aprendices_fem", -- SECUESTRO___Aprendices_Fem
    "minas_antipersonales_y_1", -- MINAS ANTIPERSONALES Y EXPLOSIVOS___Aprendices_Fem
    "nivel_formacion", -- nivel_formacion
    "modalidad_formacion", -- modalidad_formacion
    "remitidos_por_el_pal__", -- REMITIDOS_POR_EL_PAL___Aprendices_Masc
    "inpec___aprendices_masc", -- INPEC___Aprendices_Masc
    "inpec___total_aprendices", -- INPEC___Total
    "jovenes_vulnerables___1", -- JOVENES_VULNERABLES__Fem
    "ninguna__total_aprendices", -- ninguna_Caraterizacion_aprendices_Total
    "desaparicion_forzada___total", -- DESAPARICION FORZADA___Total_Aprendices
    "desaparicion_forzada___1", -- DESAPARICION FORZADA___Aprendices_Fem
    "actos_de_grupos_armados_", -- ACTOS DE GRUPOS ARMADOS___Aprendices_Masc
    "despojo___total_aprendices", -- DESPOJO___Total_Aprendices
    "identificador_unico_ficha", -- identificador_unico_ficha
    "nombre_programa_formacion", -- nombre_programa_formacion
    "despojo___aprendices_fem", -- DESPOJO___Aprendices_Fem
    "ninguna__aprendices_masc", -- ninguna caracterizacion  aprendices_masc
    "adolescente_trabajador_", -- ADOLESCENTE_TRABAJADOR__Aprendices_Masc
    "despojo___aprendices_masc", -- DESPOJO___Aprendices_Masc
    "soldados_campesinos_", -- SOLDADOS_CAMPESINOS__Aprendices_Masc
    "emprendedores___total", -- emprendedores___total
    "mujer_cabeza_de_familia__2", -- MUJER_CABEZA_DE_FAMILIA__Aprendices
    "negro___total_aprendices", -- NEGRO___Total
    "negro___aprendices_masc", -- NEGRO___Masc
    "gran_total_aprendices", -- GRAN_TOTAL_APRENDICES
    "afrocolombianos___total", -- AFROCOLOMBIANOS___Total_Aprendices
    "afrocolombianos___aprendices_1", -- AFROCOLOMBIANOS___Aprendices_Fem
    "herido___total_aprendices", --  HERIDO___Total_Aprendices
    "mujer_cabeza_de_familia_", -- mujer_cabeza_de_familia_Masc
    "tercera_edad___aprendices", -- TERCERA_EDAD__Masc
    "total_adolescente_desvinculado_1", -- ADOLESCENTE DESVINCULADO DE GRUPOS ARMADOS ORGANIZ MAS REINTEGRADOS FEM
    "afrocolombianos___aprendices", -- AFROCOLOMBIANOS___Aprendices_Masc
    "palenqueros___total_aprendices", -- PALENQUEROS___Total_Aprendices
    "raizales___aprendices_masc", -- RAIZALES___Aprendices_Masc
    "amenaza___aprendices_fem", -- AMENAZA___Aprendices_Fem
    "amenaza___total_aprendices", -- AMENAZA___Total_Aprendices
    "delitos_sexuales___aprendices", -- DELITOS SEXUALES___Aprendices_Masc
    "nombre_centro", -- nombre_centro
    "microempresas___total", -- microempresas___total
    "total_desplazados_por_la", -- Desplazados por la violencia Masculinos
    "total_desplazados_por_fen_1", -- Desplzadospor fenomenos naturales Femeninos
    "delitos_sexuales___aprendices_1", -- DELITOS SEXUALES___Aprendices_Fem
    "delitos_sexuales___total", -- DELITOS SEXUALES___Total_Aprendices
    "secuestro___aprendices_masc", -- SECUESTRO___Aprendices_Masc
    "indigenas___aprendices_masc", -- INDIGENAS___Aprendices_Masc
    "adolescente_en_conflicto_1", -- ADOLESCENTE_EN_CONFLICTO_CON_LA_LEY_PENAL__Fem
    "remitidos_por_el_cie__", -- remitidos_por_el_cie__Masc
    "ninguna__aprendices_fem", -- ninguna_Caraterizacion_aprendices_fem
    "soldados_campesinos__total", -- SOLDADOS_CAMPESINOS__Total_Aprendices
    "codigo_regional", -- Codigo de la Regioal
    "homicidio_masacre___aprendices_1", -- HOMICIDIO / MASACRE___Aprendices_Fem
    "microempresas___aprendices", -- microempresas___aprendices Masc
    "uso_de_menores_por_grupos", -- USO DE MENORES POR GRUPOS ARMADOS___Aprendices_Masc
    "tortura___aprendices_fem", -- TORTURA___Aprendices_Fem
    "tortura___aprendices_masc", -- TORTURA___Aprendices_Masc
    "tortura___total_aprendices", -- TORTURA___Total_Aprendices
    "emprendedores___aprendices_1", -- emprendedores___aprendices_1
    "inpec___aprendices_fem", -- INPEC___Aprendices_Fem
    "total_adolescente_desvinculado", -- ADOLESCENTE DESVINCULADO DE GRUPOS ARMADOS ORGANIZ MAS REINTEGRADOS  MASC
    "numero_cursos", -- numero_cursos
    "raizales___aprendices_fem", -- RAIZALES___Aprendices_Fem
    "minas_antipersonales_y", -- MINAS ANTIPERSONALES Y EXPLOSIVOS___Aprendices_Masc
    "codigo_programa", -- codigo_programa
    "adolescente_en_conflicto", -- ADOLESCENTE_EN_CONFLICTO_CON_LA_LEY_PENAL Masculinos
    "total_discapacitados", -- Total discapacitados aprendices masculinos
    "total_desplazados_por_la_2", -- Total desplazados por la violecia
    "adolescente_trabajador__total", -- ADOLESCENTE_TRABAJADOR__Total_Aprendices
    "total_desplazados_por_la_1", -- Desplazados por la violencia Femeninos
    "nombre_regional", -- Nombre de la Regional
    "nombre_municipio_curso", -- nombre_municipio_curso
    "artesanos__aprendices_masc", -- artesanos__aprendices_masc
    "artesanos__aprendices_fem", -- artesanos__aprendices_fem
    "codigo_departamento_curso", -- codigo_departamento_curso
    "artesanos__total_aprendices", -- artesanos__total_aprendices
    "nombre_departamento_curso", -- nombre_departamento_curso
    "emprendedores___aprendices", -- emprendedores___aprendices
    "total_desplazados_por_fen", -- Desplazados por Fenomenos naturales Masculinos
    "actos_de_grupos_armados__1", -- ACTOS DE GRUPOS ARMADOS___Aprendices_Fem
    "codigo_municipio_curso", -- codigo_municipio_curso
    "soldados_campesinos__1", -- SOLDADOS_CAMPESINOS__Aprendices_Fem
    "sobrevivientes_minas", -- SOBREVIVIENTES_MINAS_ANTIPERSONALES___Aprendices_Masc
    "remitidos_por_el_pal___total" -- REMITIDOS_POR_EL_PAL___Total_Aprendices
FROM
    "datos-gov-co/cupos-en-formacin-profesional-integral-por-tipo-de-2c7k-9iru:latest"."cupos_en_formacin_profesional_integral_por_tipo_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/cupos-en-formacin-profesional-integral-por-tipo-de-2c7k-9iru with SQL in under 60 seconds.

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, 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 (like this repository), where the author has pushed Splitgraph Images to the repository, you can "clone" and/or "checkout" the data using sgr cloneand sgr checkout.

Cloning Data

Because datos-gov-co/cupos-en-formacin-profesional-integral-por-tipo-de-2c7k-9iru:latest is a Splitgraph Image, you can clone the data from Spltgraph Cloud to your local engine, where you can query it like any other Postgres database, using any of your existing tools.

First, install Splitgraph if you haven't already.

Clone the metadata with sgr clone

This will be quick, and does not download the actual data.

sgr clone datos-gov-co/cupos-en-formacin-profesional-integral-por-tipo-de-2c7k-9iru

Checkout the data

Once you've cloned the data, you need to "checkout" the tag that you want. For example, to checkout the latest tag:

sgr checkout datos-gov-co/cupos-en-formacin-profesional-integral-por-tipo-de-2c7k-9iru:latest

This will download all the objects for the latest tag of datos-gov-co/cupos-en-formacin-profesional-integral-por-tipo-de-2c7k-9iru and load them into the Splitgraph Engine. Depending on your connection speed and the size of the data, you will need to wait for the checkout to complete. Once it's complete, you will be able to query the data like you would any other Postgres database.

Alternatively, use "layered checkout" to avoid downloading all the data

The data in datos-gov-co/cupos-en-formacin-profesional-integral-por-tipo-de-2c7k-9iru:latest is 0 bytes. If this is too big to download all at once, or perhaps you only need to query a subset of it, you can use a layered checkout.:

sgr checkout --layered datos-gov-co/cupos-en-formacin-profesional-integral-por-tipo-de-2c7k-9iru:latest

This will not download all the data, but it will create a schema comprised of foreign tables, that you can query as you would any other data. Splitgraph will lazily download the required objects as you query the data. In some cases, this might be faster or more efficient than a regular checkout.

Read the layered querying documentation to learn about when and why you might want to use layered queries.

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/cupos-en-formacin-profesional-integral-por-tipo-de-2c7k-9iru is just another Postgres schema.

Related Documentation:

Loading...