@zazuko/trifid-plugin-ckan v2.2.1
CKAN harvester endpoint
This is a small HTTP endpoint that gathers datasets that are publishable to opendata.swiss, transforms them to be compatible with the CKAN harvester and outputs a format (a rigid form of RDF/XML) that the harvester can read.
The format expected by the harvester is described on https://handbook.opendata.swiss/fr/content/glossar/bibliothek/dcat-ap-ch.html (fr/de).
In order to be considered as a "publishable" dataset by this endpoint, a dataset must follow the following conditions:
- it has the
dcat:Datasettype - it has one and only one
dcterms:identifier - it has a
dcterms:creator - it has
schema:workExamplewith value<https://ld.admin.ch/application/opendataswiss> - it has
schema:creativeWorkStatuswith value<https://ld.admin.ch/vocabulary/CreativeWorkStatus/Published> - it does not have
schema:validThrough - it does not have
schema:expires
The endpoint copies the following properties with their original value. Make sure they follow the CKAN spec.
dcterms:titledcterms:descriptiondcterms:issueddcterms:modifieddcat:contactPointdcat:themedcterms:languagedcat:landingPagedcterms:spatialdcterms:coveragedcterms:temporaldcterms:keyword(literals without a language are ignored)
The following properties are populated by the endpoint:
dcterms:identifierIf the original
dcterms:identiferalready contains an "@", it is copied as-is. Otherwise, an identifier is created with the shape<dcterms:identifier value>@<creator slug>, where "creator slug" is the last segment of the URI of the value ofdcterms:creator.dcterms:publisherThe original
dcterms:publishervalue is used asrdfs:labelof the finaldcterms:publisher.dcterms:relationPopulated from
dcterms:license.TODO: define valid values for license
dcterms:accrualPeriodicitySupports both DC (http://purl.org/cld/freq/) and EU (http://publications.europa.eu/ontology/euvoc#Frequency) frequencies. DC frequencies are transformed into EU ones.
dcat:distributionPopulated from
schema:workExample. Only takes work examples with aschema:encodingFormatinto account. Each distribution is built in the following way, from the properties of the work example:dcterms:issuedis copied as-isdcat:mediaTypepopulated fromschema:encodingFormatdcat:accessURLpopulated fromschema:urldcterms:titlepopulated fromschema:namedcterms:rightspopulated fromschema:identifierof the dataset'sdcterms:rightsdcterms:formatpopulated fromschema:encodingFormat, with the following mapping:text/html->HTMLapplication/sparql-query->SERVICE- other ->
UNKNOWN
Usage
This should be used as a Trifid plugin.
The following options are supported:
endpointUrl: URL to the SPARQL endpointuser: User to connect to the SPARQL endpointpassword: Password to connect to the SPARQL endpoint
Configuring Trifid to use @zazuko/trifid-plugin-ckan is easy, just add the following in your configuration file:
plugins:
# …other plugins
ckan:
module: "@zazuko/trifid-plugin-ckan"
paths: /ckan
config:
endpointUrl: https://some-custom-endpoint/
# user: root
# password: super-secretand update the config fields with correct informations.
Do not forget to add it to your Node dependencies:
npm install @zazuko/trifid-plugin-ckanWith this configuration, the service will be exposed at /ckan and will require the organization query parameter, like this: /ckan?organization=….
This will trigger the download of a XML file.
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
4 years ago
4 years ago
4 years ago