This repository is the microservice that implements the UN Index Adapter functionality.
This connector is used to keep a set of UN Statistics Datasets "in-sync" with the source data (https://unstats.un.org/SDGAPI). Here is the script to perform the initial import.
First, make sure that you have the API gateway running locally.
We're using Docker which, luckily for you, means that getting the application running locally should be fairly painless. First, make sure that you have Docker Compose installed on your machine.
git clone https://github.com/GPSDD/un-index-connector.git
cd un-index-connector
./adapter.sh develop
```text
You can now access the microservice through the CT gateway.
It is necessary to define these environment variables:
- CT_URL => Control Tower URL
- NODE_ENV => Environment (prod, staging, dev)
This component executes a periodic task that updates the metadata of each indexed RW dataset. The task is bootstrapped
when the application server starts.
The task's implementation can be found on app/src/cron/cron
and the configuration is loaded from the
config files
The UN API provides little metadata when compared to other data providers, which justifies the lack of fields like "license" or "description".
It also seems to have datasets with no data (empty data
section) which this connector handles by not importing those datasets.
Field in SDG Metadata | Field in UN data | Value |
---|---|---|
userId | ||
language | 'en' | |
resource | ||
name | data[0].seriesDescription |
|
description | ||
sourceOrganization | data[0].source || ? |
|
dataDownloadUrl | 'https://unstats.un.org/SDGAPI/v1/sdg/Series/Data?pageSize=20000&seriesCode=' + dataset.tableName |
|
dataSourceUrl | 'https://unstats.un.org/sdgs/indicators/database/' | |
dataSourceEndpoint | 'https://unstats.un.org/SDGAPI/v1/sdg/Series/Data?pageSize=20000&seriesCode=' + dataset.tableName |
|
license | 'Other' | |
status | 'published' |
Each dataset is tagged with "United Nations Statistics Division" plus the organisation present in the dataset's data.
The data.goal
value will be tentatively matched to a SDG, and tagged if a match is found.