ckan / ckanext-dcat

CKAN ♥ DCAT
164 stars 142 forks source link

New `ckan dcat consume` and `ckan dcat produce` commands #279

Closed amercader closed 1 month ago

amercader commented 1 month ago

There was an old CLI in processors.py that wasn't very useful as it didn't load the CKAN environment. This migrates it to the ckan dcat command, mainly to consume and produce DCAT RDF serializations. This will be very useful for quickly testing while working on the scheming support.

From the docs:

In both cases the input can be provided as a path to a file:

ckan dcat consume -f ttl examples/dataset.ttl

ckan dcat produce -f jsonld examples/ckan_datasets.json

or be read from stdin:

ckan dcat consume -

The latter form allows chaininig commands for more complex metadata processing, e.g.:

curl https://demo.ckan.org/api/action/package_search | jq .result.results | ckan dcat produce -f jsonld -

For the full list of options check ckan dcat consume --help and ckan dcat produce --help.