datos-gov-co/registro-de-activos-de-informacin-2021-parte-no-ii-4v6b-i4rg
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 registro_de_activos_de_informacin_2021_parte_no_ii table in this repository, by referencing it like:

"datos-gov-co/registro-de-activos-de-informacin-2021-parte-no-ii-4v6b-i4rg:latest"."registro_de_activos_de_informacin_2021_parte_no_ii"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "_13_cumplimiento_legal", -- Se debe realizar una verificación de ley, si el activo debe cumplir con algún artículo de la Constitución Política de Colombia o la normatividad legal que justifique una reserva o tratamiento especial.
    "_9_ubicacion", -- Describe la ubicación tanto física como electrónica del activo de información.
    "_8_respaldo", -- El respaldo es la copia de los datos importantes de un dispositivo primario en uno ó varios dispositivos secundarios, ello para que en caso de que el primer dispositivo sufra una avería electromecánica ó un error en su estructura lógica, sea posible contar con la mayor parte de la información necesaria para continuar con la operación y evitar pérdida generalizada de la operación normal de la organización.
    "_3_descripcion", -- Es un espacio para describir el activo de manera que sea claramente identificable por  los funcionarios y contratistas de la UPRA.
    "_14_cifrado_clave", -- Se debe señalar si el activo requiere protección especial, como por ejemplo cifrar los datos o información almacenada, o si requiere alguna protección especial para el envío hacia terceros. 
    "_11_permisos_especiales", -- Se escribe si el activo requiere o no permiso especial, para acceder al mismo.
    "_12_datos_personales", -- Los datos personales son cualquier tipo de datos que pueden ser usados para identificar de forma directa o indirecta a un individuo. Como por ejemplo: nombre, foto, número de teléfono, dirección (los cuales permiten la identificación directa), como también la dirección de IP o nombre de usuario (los cuales permiten la identificación indirecta).
    "_15_uso_exclusivo", -- Decir si el activo es de uso exclusivo para el propietario del activo de información.
    "_1_proceso", -- Nombre del Proceso donde nace la información. Es el término con que se da a conocer el nombre del asunto de la información.
    "_2_nombre_del_activo", -- Consignar la denominación del nombre de la información. Si la información ya tiene un título, se debe mencionar aquí, respetando los términos originales (orden y ortografía), más no necesariamente en lo relativo a la puntuación y las mayúsculas.
    "_4_tipo_de_activo", -- Define el tipo al cual pertenece el activo.
    "_5_medio_de_conservacion", -- Indicar el soporte en el cual se contiene la información, según los materiales o medios tecnológicos empleados. Escoger documento:  • Físico papel • Digital También conocido como “soporte digital”. Es el material físico, tal como un disco compacto, DVD, cinta o disco duro usado como soporte para almacenamiento de datos digitales.
    "_6_propietario", -- Es una parte designada de la entidad, un cargo, proceso, o grupo de trabajo que tiene la responsabilidad de garantizar que la información y los activos asociados con el proceso se clasifican adecuadamente. 
    "_7_custodio", -- Es  una  parte  designada  de  la  entidad,  un  cargo,  proceso,  o  grupo  de trabajo encargado de hacer efectivos las restricciones y clasificaciones de acceso definidos   por   el   propietario.(Para   sistemas   de   información   o   información consignada  o  respaldada,  generalmente  es  servicios tecnologicos  o  para  información  física,  los custodios pueden ser los funcionarios o el proceso de gestión docuemntal, el custodio generalmente se define donde reposa el activo original).
    "_10_valoracion_confidencialidad", -- Determina el valor general del activo, de acuerdo a la confidencialidad de la Información. La valoración se da entre 0 y 5 así: 0-No hay afectación; 1-Daño insignificante; 2-Daño menor; 3-Daño considerable; 4-Daño grave y 5-Supervivencia de la entidad amenazada.
    "_10_valoracion_integridad", -- Determina el valor general del activo, de acuerdo a la integridad de la Información. La valoración se da entre 0 y 5 así: 0-No hay afectación; 1-Daño insignificante; 2-Daño menor; 3-Daño considerable; 4-Daño grave y 5-Supervivencia de la entidad amenazada.
    "_10_valoracion_disponibilidad" -- Determina el valor general del activo, de acuerdo a la disponibilidad de la Información. La valoración se da entre 0 y 5 así: 0-No hay afectación; 1-Daño insignificante; 2-Daño menor; 3-Daño considerable; 4-Daño grave y 5-Supervivencia de la entidad amenazada.
FROM
    "datos-gov-co/registro-de-activos-de-informacin-2021-parte-no-ii-4v6b-i4rg:latest"."registro_de_activos_de_informacin_2021_parte_no_ii"
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/registro-de-activos-de-informacin-2021-parte-no-ii-4v6b-i4rg 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/registro-de-activos-de-informacin-2021-parte-no-ii-4v6b-i4rg: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/registro-de-activos-de-informacin-2021-parte-no-ii-4v6b-i4rg

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/registro-de-activos-de-informacin-2021-parte-no-ii-4v6b-i4rg:latest

This will download all the objects for the latest tag of datos-gov-co/registro-de-activos-de-informacin-2021-parte-no-ii-4v6b-i4rg 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/registro-de-activos-de-informacin-2021-parte-no-ii-4v6b-i4rg: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/registro-de-activos-de-informacin-2021-parte-no-ii-4v6b-i4rg: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/registro-de-activos-de-informacin-2021-parte-no-ii-4v6b-i4rg is just another Postgres schema.

Related Documentation:

Loading...