Skip to content

YourOpenDAta/ckanext-dcatapedp

Repository files navigation

ckanext-dcatapedp

CKAN extension for the European Data Portal

Requirements

DCAT versions included

  1. 2.0.1
  2. 2.1.0

Installation

  1. Install the ckanext-dcat extension

  2. Activate your CKAN virtual environment, for example::

     . /usr/lib/ckan/default/bin/activate
    
  3. Download the extension in the CKAN path extensions (e.g. /usr/lib/ckan/venv/src ):

     git clone https://github.com/YourOpenDAta/ckanext-dcatapedp.git
    
  4. Install the ckanext-dcatapedp Python package into your virtual environment::

     pip install -e ckanext-dcatapedp
    
  5. Active the dcat_ap_x.x.x profile and add the oaipmh_edp plugin in the production.ini file:

     ckanext.dcat.rdf.profiles = euro_dcat_ap dcat_ap_x.x.x (dcat_ap_2.1.0 or dcat_ap.2.0.1)
     ckan.plugins = (other plugins) oaipmh_edp
    
  6. Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu::

      sudo service apache2 reload
    

Development Installation

To install ckanext-dcatapedp for development, activate your CKAN virtualenv and do::

git clone https://github.com/YourOpenDAta/ckanext-dcatapedp.git
cd ckanext-dcatapedp
python setup.py develop
pip install -r dev-requirements.txt

Running the Tests

To run the tests, do::

pytest --ckan-ini=test.ini ckanext/dcatapedp/tests/

Mapping CKAN - DCAT AP v x.x.x

  • DCAT prop: dcat property name
  • CKAN fields: field or fields used for the mapping with the DCAT edp profile. CKAN fields are sorted by order of preference in the CKAN metadata
  • Type: origin of the dcat mapping being
    • O: taken from original profile without modifying it (euro_dcat_ap);
    • M: taken from the original profile (euro_dcat_ap) modifying it;
    • A: new property added in the dcat_ap_x.x.x profile
  • Stored as: way it is stored in the CKAN instance
  • Ref. vocab.: reference vocabularies recommended to use
  • Notes: additional information

Catalogue - Organization

DCAT prop. CKAN fields Type Stored as Ref. vocab. Notes

Dataset - Package

DCAT prop. CKAN fields Type Stored as Ref. vocab. Notes
dct:identifier extra:identifier, guid, id O text
dct:description notes O text
dct:title title O text
dcat:contactPoint extra:contact_uri M text
dcat:distribution resources O text
dcat:keyword tags O list
dct:publisher extra:publisher_uri M text http://publications.europa.eu/resource/authority/corporate-body
dct:spatial extra:spatial_uri M text http://publications.europa.eu/resource/authority/continent
http://publications.europa.eu/resource/authority/country
http://publications.europa.eu/resource/authority/place
http://sws.geonames.org/
dct:temporal extra:temporal_start +
extra:temporal_end
M text
dcat:theme extra:theme M list http://publications.europa.eu/resource/authority/data-theme
adms:identifier extra:alternate_identifier M list
adms:sample extra:sample M list
adms:versionNotes adms:versionNotes O text
dcat:landingPage url M text
dct:accessRights extra:access_rights M text https://publications.europa.eu/resource/authority/access-right (not in the specification) [2.0.1] ->
http://publications.europa.eu/resource/authority/access-right [2.1.0]
dct:accrualPeriodicity extra:frequency O text http://purl.org/cld/freq
dct:conformsTo extra:conforms_to M list
dct:hasVersion extra:has_version O list
dct:isVersionOf extra:is_version_of O list
dct:issued extra:issued, metadata_created O text
dct:language extra:language M list http://publications.europa.eu/resource/authority/language
dct:modified extra:modified,
metadata_modified
O text
dct:provenance extra:provenance M text
dct:source extra:source M list
dct:type extra:dcat_type M text () -> http://publications.europa.eu/resource/dataset/dataset-type [2.1.0]
foaf:page extra:documentation M list
owl:versionInfo version, extra:dcat_version O text

Distribution - Resource

DCAT prop. CKAN fields Type Stored as Ref. vocab. Notes
dcat:accessURL resource:access_url O text
dcatap:availability resource:availability A text http://data.europa.eu/r5r/availability/
https://www.dcat-ap.de/def/plannedAvailability/1_0.html -> [2.0.1]
http://publications.europa.eu/resource/authority/planned-availability -> [2.1.0]
dct:description resource:description O text
dct:format resource:format M text http://publications.europa.eu/resource/authority/file-type
dct:license resource:license M text TODO:include
adms:status resource:status M text http://purl.org/adms/status
dcat:byteSize resource:size O number
dcat:downloadURL resource:download_url O text
dcat:mediaType resource:mimetype M text http://www.iana.org/assignments/media-types/media-types.xhtml
dct:conformsTo resource:conforms_to M list
dct:issued resource:issued O text
dct:language resource:languague M list http://publications.europa.eu/resource/authority/language
dct:modified resource:modified O text
dct:rights resource:rights M text https://publications.europa.eu/resource/authority/access-right (not in the specification)
dct:title resource:name O text
foaf:page resurce:documentation M list

Agent

DCAT prop. CKAN fields Type Stored as Ref. vocab. Notes

OAI-PMH version 2

  1. Create example of data

    git ckan -c /etc/ckan/production.ini seed basic

  2. Examples of petitions

  • https://{ckan-instance-host}/oai?verb=Identify
  • https://{ckan-instance-host}/oai?verb=ListMetadataFormats
  • https://{ckan-instance-host}/oai?verb=ListSets
  • https://{ckan-instance-host}/oai?verb=ListRecords&metadataPrefix=dcat
  • https://{ckan-instance-host}/oai?verb=ListIdentifiers&metadataPrefix=dcat&set=example_org
  • https://{ckan-instance-host}/oai?verb=GetRecord&identifier=ce3f7074-15b7-44ab-a2b9-85e26dc17f67&metadataPrefix=dcat

Examples

Dataset (Package) and Distribution (Resource) CKAN metadata

Dataset (Package) and Distribution (Resource) DCAT-AP rdf

License

ckandext-dcatapedp is open and licensed under the GNU Affero General Public License (AGPL) v3.0 whose full text may be found at:

http://www.fsf.org/licensing/licenses/agpl-3.0.html