From 60009fb7ec8371f58583d1eb1ac6b3ae4f55f261 Mon Sep 17 00:00:00 2001 From: amercader Date: Mon, 7 Oct 2024 14:06:30 +0200 Subject: [PATCH] Extend DCAT US profile from DCAT AP 3 --- ckanext/dcat/profiles/dcat_us_3.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/ckanext/dcat/profiles/dcat_us_3.py b/ckanext/dcat/profiles/dcat_us_3.py index 60466761..9a2dd0be 100644 --- a/ckanext/dcat/profiles/dcat_us_3.py +++ b/ckanext/dcat/profiles/dcat_us_3.py @@ -1,18 +1,13 @@ -from rdflib import Literal, BNode - from ckanext.dcat.profiles import ( - DCAT, - XSD, - SKOS, - ADMS, - RDF, + DCT, ) +from ckanext.dcat.utils import resource_uri -from .euro_dcat_ap_2 import EuropeanDCATAP2Profile -from .euro_dcat_ap_scheming import EuropeanDCATAPSchemingProfile +from .base import URIRefOrLiteral, CleanedURIRef +from .euro_dcat_ap_3 import EuropeanDCATAP3Profile -class DCATUS3Profile(EuropeanDCATAP2Profile, EuropeanDCATAPSchemingProfile): +class DCATUS3Profile(EuropeanDCATAP3Profile): """ An RDF profile based on the DCAT-US 3 for data portals in the US """ @@ -28,6 +23,9 @@ def parse_dataset(self, dataset_dict, dataset_ref): # DCAT AP v2 scheming fields dataset_dict = self._parse_dataset_v2_scheming(dataset_dict, dataset_ref) + # DCAT US v3 properties also applied to higher versions + self._parse_dataset_v3_us(dataset_dict, dataset_ref) + return dataset_dict def graph_from_dataset(self, dataset_dict, dataset_ref): @@ -44,6 +42,9 @@ def graph_from_dataset(self, dataset_dict, dataset_ref): # DCAT AP v3 properties also applied to higher versions self._graph_from_dataset_v3(dataset_dict, dataset_ref) + # DCAT US v3 properties also applied to higher versions + self._graph_from_dataset_v3_us(dataset_dict, dataset_ref) + def graph_from_catalog(self, catalog_dict, catalog_ref): self._graph_from_catalog_base(catalog_dict, catalog_ref)