From 4ae879571265a37d4f397d3af0be750c212df2d3 Mon Sep 17 00:00:00 2001 From: amercader Date: Wed, 28 Aug 2024 15:14:42 +0200 Subject: [PATCH] Default to euro_dcat_ap_3 profile Fix method call in dcat ap 3 profile, surfaced after switching the default profile. Add changelog and update docs. --- CHANGELOG.md | 4 ++++ README.md | 15 ++++++++------- ckanext/dcat/processors.py | 2 +- ckanext/dcat/profiles/euro_dcat_ap_3.py | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69aea84f..ea2c482f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased](https://github.com/ckan/ckanext-dcat/compare/v1.7.0...HEAD) +* New profile for [DCAT-AP v3](https://semiceu.github.io/DCAT-AP/releases/3.0.0), `euro_dcat_ap_3`, which is now + the default. Existing sites willing to stick with DCAT-AP v2.x can specify the profile in the configuration if they + are not doing so yet (`ckan.dcat.rdf.profiles = euro_dcat_ap_2`). The new `euro_dcat_ap_3` profile relies on + ckanext-scheming metadata schemas (see below). * Support for standard CKAN [ckanext-scheming](https://github.com/ckan/ckanext-scheming) schemas. The DCAT profiles now seamlessly integrate with fields defined via the YAML or JSON scheming files. Sites willing to migrate to a scheming based metadata schema can do diff --git a/README.md b/README.md index 83c8baa6..1a11c697 100644 --- a/README.md +++ b/README.md @@ -117,8 +117,8 @@ The extension includes ready to use [ckanext-scheming](https://github.com/ckan/c There are the following schemas currently included with the extension: -* *dcat_ap_recommended.yaml*: Includes the recommended properties for `dcat:Dataset` and `dcat:Distribution` according to the DCAT AP specification. You can use this schema with the `euro_dcat_ap_2` (+ `euro_dcat_scheming`) and `euro_dcat_ap_3` profiles. -* *dcat_ap_full.yaml*: Includes most of the properties defined for `dcat:Dataset` and `dcat:Distribution` in the [DCAT AP 2.1](https://semiceu.github.io/DCAT-AP/releases/2.1.1/) and [DCAT AP v3](https://semiceu.github.io/DCAT-AP/releases/3.0.0/) specification. You can use this schema with the `euro_dcat_ap_2` (+ `euro_dcat_scheming`) and `euro_dcat_ap_3` profiles. +* *dcat_ap_recommended.yaml*: Includes the recommended properties for `dcat:Dataset` and `dcat:Distribution` according to the DCAT AP specification. You can use this schema with the `euro_dcat_ap_2` (+ `euro_dcat_ap_scheming`) and `euro_dcat_ap_3` profiles. +* *dcat_ap_full.yaml*: Includes most of the properties defined for `dcat:Dataset` and `dcat:Distribution` in the [DCAT AP 2.1](https://semiceu.github.io/DCAT-AP/releases/2.1.1/) and [DCAT AP v3](https://semiceu.github.io/DCAT-AP/releases/3.0.0/) specification. You can use this schema with the `euro_dcat_ap_2` (+ `euro_dcat_ap_scheming`) and `euro_dcat_ap_3` profiles. Most sites will want to use these as a base to create their own custom schema to address their own requirements, perhaps alongside a [custom profile](#writing-custom-profiles). Of course site maintainers can add or remove schema fields, as well as change the existing validators. @@ -864,13 +864,14 @@ They essentially define the mapping between DCAT and CKAN. In most cases the default profile will provide a good mapping that will cover most properties described in the DCAT standard. If you want to extract extra fields defined in the RDF, are using a custom schema or 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), 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. +The profiles currently shipped with the extension are mostly based in the +[DCAT application profile for data portals in Europe](https://joinup.ec.europa.eu/asset/dcat_application_profile/description). As mentioned before though, they 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: +Sites that want to support a particular version of the DCAT-AP can enable a specific profile using one of the profiles below: -* DCAT-AP v2.1.0 (default): `euro_dcat_ap_2` -* DCAT-AP v1.1.1: `euro_dcat_ap` +* [DCAT-AP v3](https://semiceu.github.io/DCAT-AP/releases/3.0.0) (default): `euro_dcat_ap_3` +* [DCAT-AP v2.1.0](https://joinup.ec.europa.eu/collection/semantic-interoperability-community-semic/solution/dcat-application-profile-data-portals-europe/release/210): `euro_dcat_ap_2` +* [DCAT-AP v1.1.1](https://joinup.ec.europa.eu/asset/dcat_application_profile/asset_release/dcat-ap-v11): `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). diff --git a/ckanext/dcat/processors.py b/ckanext/dcat/processors.py index 1254e86d..ef3230f6 100644 --- a/ckanext/dcat/processors.py +++ b/ckanext/dcat/processors.py @@ -28,7 +28,7 @@ RDF_PROFILES_CONFIG_OPTION = 'ckanext.dcat.rdf.profiles' COMPAT_MODE_CONFIG_OPTION = 'ckanext.dcat.compatibility_mode' -DEFAULT_RDF_PROFILES = ['euro_dcat_ap_2'] +DEFAULT_RDF_PROFILES = ['euro_dcat_ap_3'] def _get_default_rdf_profiles(): diff --git a/ckanext/dcat/profiles/euro_dcat_ap_3.py b/ckanext/dcat/profiles/euro_dcat_ap_3.py index d0cce700..d2dfbaed 100644 --- a/ckanext/dcat/profiles/euro_dcat_ap_3.py +++ b/ckanext/dcat/profiles/euro_dcat_ap_3.py @@ -46,7 +46,7 @@ def graph_from_dataset(self, dataset_dict, dataset_ref): def graph_from_catalog(self, catalog_dict, catalog_ref): - self._graph_from_catalog_base(self, catalog_dict, catalog_ref) + self._graph_from_catalog_base(catalog_dict, catalog_ref) def _graph_from_dataset_v3(self, dataset_dict, dataset_ref):