telefonicaid / fiware-cygnus

A connector in charge of persisting context data sources into other third-party databases and storage systems, creating a historical view of the context
https://fiware-cygnus.rtfd.io/
GNU Affero General Public License v3.0
65 stars 105 forks source link

[cygnus-ngsi][NGSICKANSink] Add metadata required by NTI #1402

Open frbattid opened 7 years ago

frbattid commented 7 years ago

NTI stands for Norma Técnica de Interoperabilidad.

http://datos.gob.es/es/documentacion/norma-tecnica-de-interoperabilidad-de-reutilizacion-de-recursos-de-informacion

NTI-related metadata is required when integrating Cygnus with OGoov Transparecy Portal, which is based in CKAN.

frbattid commented 7 years ago

This will be implemented by means of a Json file containing a "template" for all the possible combinations of service-subservice-entity:

{
   "services": [
      {
         "service": "<service name or regular expression>",
         "servicePaths": [
            {
               "servicePath": "<service path or regular expression>",
               "dataset_metadata": {
                  <dataset related metadata>
               },
               "entities": [
                  {
                     "entityId": "<entity ID or regular expression>",
                     "entityType": "<entity type or regular expression>",
                     "resource_metadata": {
                        <resource related metadata>
                     }
                  },
                  ...
               ]
            },
            ...
         ]
      },
      ...
   ]
}

Both the dataset and resource metadata fields could make use of "variables". When running, the variables will be replaced with specific values regarding the current processed events. Variables are quite straightforward to explain:

This configuration must take into account the Name Mappings feature may alter either the service, either the service path, either the entity ID either the entity type.

frbattid commented 7 years ago

Please observe this is only useful for the row-like mode of NGSICKANSink, since it automatically provisions CKAN datasets.

When working in column-like mode, NTI metadata must be added, as Json payload, to the package_create operation by the admin.