Skip to content

Latest commit

 

History

History
104 lines (76 loc) · 2.6 KB

File metadata and controls

104 lines (76 loc) · 2.6 KB

Enter

We use ITK-dev docker setup or DDEV and Task for development:

task site:install

Set

TASK_USE_DDEV=true

in .env.local to make task use ddev rather than docker compose for running commands.

task site:update
task site:open

Run task to see what cool task are available.

Adapter

Takes an open-data set, converts it to NGSI-LD, and upserts it into the context broker.

source feed (JSON)
  → SourceInterface implementation   maps fields, fixes quirks, picks the data model
    → NgsiEntity                     normalized NGSI-LD: Property / GeoProperty / Relationship
      → NgsiLdBroker                 POST /ngsi-ld/v1/entityOperations/upsert
        → context broker
task import                                                # list the available sources
task import -- mtm_spatialmaps-handicap-parking                        # import one
task import -- mtm_spatialmaps-handicap-parking --dry-run --limit 5    # print the payload instead

Sources

Adding a data source means adding a SourceInterface implementation. The easiest way to do this is by extending AbstractSource, e.g.:

<?php

use App\Source\AbstractSource;

final readonly class MySource extends AbstractSource
{
    public function __construct(
    ) {
        parent::__construct(
            id: 'my-source',
            title: 'My source with some cool data',
            description: '',
            publisher: 'Me',
            contact: 'me@example.com',
            landingPage: 'https://my-data.example.com',
            accessUrl: 'https://my-data.example.com/data',
            mediaType: 'application/geo+json',
            crs: 'EPSG:4326',
            model: 'MyModel',
            contextUrl: '',
            updateFrequency: 'daily',
        );
    }

    …
}

Run

php bin/console app:source:list

list all data sources.

Design decisions are recorded in docs/adr.

Broker

A Scorpio Broker is part of the development setup.

docker compose exec phpfpm curl --silent http://scorpio.local:9090/ngsi-ld/v1/types | jq

If you're using the ITK-dev docker setup, the broker can also be accessed on http://scorpio.enter.local.itkdev.dk/, e.g.

curl --silent http://scorpio.enter.local.itkdev.dk/ngsi-ld/v1/types | jq