ckan / ckanext-dcat

CKAN ♥ DCAT
https://docs.ckan.org/projects/ckanext-dcat
165 stars 145 forks source link

Add support for DCT.rightsStatement in DCT.accessRights and DCT.rights #177

Closed seitenbau-govdata closed 4 years ago

seitenbau-govdata commented 4 years ago

The pull request adds support for DCT.rightsStatement in DCT.accessRights (DCAT.Dataset) and DCT.rights (DCAT.Distribution).

The old behavior was to save the NodeID of the element , the new behavior reads the literal in rdf:label nested in and save this.

<dcat:Dataset rdf:about="https://data.some.org/catalog/datasets/9df8df51-63db-37a8-e044-0003ba9b0d98">
  <dct:accessRights>
    <dct:RightsStatement>
      <rdfs:label>public</rdfs:label>
    </dct:RightsStatement>
  </dct:accessRights>
  <dcat:distribution>
    <dcat:Distribution rdf:about="https://data.some.org/catalog/datasets/9df8df51-63db-37a8-e044-0003ba9b0d98/1">
      <dct:rights>
        <dct:RightsStatement>
          <rdfs:label>Some statement about rights</rdfs:label>
        </dct:RightsStatement>
      </dct:rights>
    </dcat:Distribution>
  </dcat:distribution>
</dcat:Dataset>

The example above will be now saved as

Field Value
Dataset.access_rights public
Resource.rights Some statement about rights
seitenbau-govdata commented 4 years ago

@amercader Thanks for review and merging!