Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for DCAT-AP 2.1 #220

Merged
merged 12 commits into from
Jul 31, 2022

Conversation

seitenbau-govdata
Copy link
Member

@seitenbau-govdata seitenbau-govdata commented Jun 10, 2022

We want to add support for the following DCAT-AP 2.1 properties (covers #168):

  • dcat:Dataset
    • dcat:bbox und dcat:centroid (in dct:Location of dct:spatial)
    • dcat:startDate, dcat:endDate, time:hasBeginning, time:hasEnd (in dct:PeriodOfTime of dct:temporal)
    • dcat:spatialResolutionInMeters
    • dcat:temporalResolution
    • dct:isReferencedBy
    • prov:wasGeneratedBy
  • dcat:Distribution
    • dcatap:availability
    • dcat:compressFormat
    • dcat:packageFormat
    • odrl:hasPolicy

Specification: https://www.w3.org/TR/vocab-dcat-2/

We start by creating a new DCAT-AP 2 profile (plugin euro_dcat_ap_2) that inherits the profile EuropeanDCATAPProfile (plugin euro_dcat_ap).

@seitenbau-govdata seitenbau-govdata marked this pull request as draft June 10, 2022 13:23
@seitenbau-govdata seitenbau-govdata force-pushed the support-for-dcatap-2 branch 3 times, most recently from abf62dd to 4e434d5 Compare June 22, 2022 21:39
* Adds additional support of the types XSDDate and XSDDateTimeStamp for
time:hasBeginning and time:hasEnd
@amercader
Copy link
Member

@seitenbau-govdata if you restart the failed py2 jobs they should pass now (there was a problem with ckanext-harvest reqs, which is fixed now)

@seitenbau-govdata seitenbau-govdata marked this pull request as ready for review July 7, 2022 16:13
@seitenbau-govdata
Copy link
Member Author

@amercader The pull request is now ready for review. Maybe you have a good idea and suggestion how the new profile could be described and announced/introduced in the documentation.

@seitenbau-govdata
Copy link
Member Author

@amercader I do not want to be annoying. But do you think that you will find some time to have a look at the pull request? Or gladly also someone else if you are too busy or on vacation. Thanks in advance.

@amercader
Copy link
Member

Sorry @seitenbau-govdata I'm busy with different open fronts (and school holidays!) but will definitely try to find some time for this. I had a quick look and it looks great.
Do any of these changes break compatibility with DCAT-AP 1.1? ie are there changes in how existing fields where parsed/serialized or this just adds new fields?

@seitenbau-govdata
Copy link
Member Author

@amercader Thanks that you will have a look and this despite the circumstances. There are no breaking changes with DCAT-AP 1.1. Only some fields are added to the graph or stored in the database if the imported graph contains properties supported by DCAT-AP 2.

The only existing properties affected by the changes are the property dct:spatial and dct:temporal.

  1. In the property dct:spatial the properties dcat:bbox and dcat:centroid are added within the class dct:Location analogous to locn:geometry.
  2. The property dct:temporal is added another time, containing the properties dcat:startDate and dcat:endDate, additionally to the property dct:temporal containing the properties schema:startDate and schema:endDate.

@amercader
Copy link
Member

@seitenbau-govdata thanks for your work on this, it all looks good.

In terms of introducing these changes and given they are backwards compatible, I think the best approach would be:

  • The new default profile should be the new euro_dcat_ap_2 one. So change it here:
    DEFAULT_RDF_PROFILES = ['euro_dcat_ap']
  • For users that really want to stick with the old profile, we document how to enable it if they upgrade ckanet-dcat (I'm saying it's "partially compatible with DCAT-AP 2.1" because IIUC your PR does not cover all new fields introduced in DCAT-AP 2 right):
diff --git a/README.md b/README.md
index 0b2c50d..91077c0 100644
--- a/README.md
+++ b/README.md
@@ -670,7 +670,12 @@ In most cases the default profile will provide a good mapping that will cover mo
 need custom logic, you can write a custom to profile that extends or replaces the default one.
 
 The default profile is mostly based in the
-[DCAT application profile for data portals in Europe](https://joinup.ec.europa.eu/asset/dcat_application_profile/description). It is actually fully-compatible with [DCAT-AP v1.1](https://joinup.ec.europa.eu/asset/dcat_application_profile/asset_release/dcat-ap-v11). As mentioned before though, it should be generic enough for most DCAT based representations.
+[DCAT application profile for data portals in Europe](https://joinup.ec.europa.eu/asset/dcat_application_profile/description). It is actually fully-compatible with [DCAT-AP v1.1](https://joinup.ec.europa.eu/asset/dcat_application_profile/asset_release/dcat-ap-v11), and partially compatible with [DCAT-AP v2.1.0](https://joinup.ec.europa.eu/collection/semantic-interoperability-community-semic/solution/dcat-application-profile-data-portals-europe/release/210). As mentioned before though, it should be generic enough for most DCAT based representations.
+
+Sites that want to support a particular version of the DCAT-AP can enable a specific profile using one of the methods below:
+
+* DCAT-AP v2.1.0 (default): `euro_dcat_ap_2`
+* DCAT-AP v1.1.1: `euro_dcat_ap`
 
 This plugin also contains a profile to serialize a CKAN dataset to a [schema.org Dataset](http://schema.org/Dataset) called `schemaorg`. This is especially useful to provide [JSON-LD structured data](#structured-data).
  • We mention the change in the CHANGELOG, listing the actual fields added

We can release 1.3.0 after this is merged.

@seitenbau-govdata
Copy link
Member Author

@amercader Thanks for your input. I have changed the default profile and updated the documentation. In addition I have fixed the RDFSerializer tests for the DCAT-AP 1 profile euro_dcat_ap and added some basic tests for the default RDFSerializer.

Feel free to comment the latest changes and/or merge the pull request. 😃

@amercader amercader merged commit 29059bb into ckan:master Jul 31, 2022
@amercader
Copy link
Member

Many thanks @seitenbau-govdata, this is a long requested feature! (even if partially supported)

I won't be able to work on this in the next two weeks. Do you mind doing the new release yourself (basically updating the version, tagging and changelog)? I think 1.3.0 makes sense for this one. Thanks!

@seitenbau-govdata seitenbau-govdata deleted the support-for-dcatap-2 branch August 1, 2022 09:25
@seitenbau-govdata
Copy link
Member Author

@amercader Sure, we can do the new release. 1.3.0 as new version sounds good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants