Skip to content

Commit

Permalink
feat: Map DCAT-AP CH v2 conforms to property
Browse files Browse the repository at this point in the history
  • Loading branch information
kovalch committed Nov 7, 2023
1 parent 9fadaf3 commit f0cd258
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions ckanext/dcatapchharvest/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,9 @@ def parse_dataset(self, dataset_dict, dataset_ref): # noqa
dataset_ref, FOAF.page
)

# Conformity
# Conformance
dataset_dict['conforms_to'] = self._object_value_list(
dataset_ref, FOAF.page
dataset_ref, DCT.conformsTo
)

# Resources
Expand Down Expand Up @@ -704,7 +704,6 @@ def graph_from_dataset(self, dataset_dict, dataset_ref): # noqa
items = [
('language', DCT.language, None, Literal),
('theme', DCAT.theme, None, URIRef),
('conforms_to', DCT.conformsTo, None, Literal),
('alternate_identifier', ADMS.identifier, None, Literal),
('has_version', DCT.hasVersion, None, Literal),
('is_version_of', DCT.isVersionOf, None, Literal),
Expand Down Expand Up @@ -818,6 +817,13 @@ def graph_from_dataset(self, dataset_dict, dataset_ref): # noqa
g.add((doc, RDF.type, FOAF.Document))
g.add((dataset_ref, FOAF.page, doc))

# Conformance
conformance_uris = dataset_dict.get('conforms_to', [])
for uri in conformance_uris:
ref = URIRef(uri)
g.add((ref, RDF.type, DCT.conformsTo))
g.add((dataset_ref, DCT.conformsTo, ref))

# Themes
groups = self._get_dataset_value(dataset_dict, 'groups', [])
for group_name in groups:
Expand Down Expand Up @@ -860,7 +866,6 @@ def graph_from_dataset(self, dataset_dict, dataset_ref): # noqa
# Lists
items = [
('language', DCT.language, None, Literal),
('conforms_to', DCT.conformsTo, None, Literal),
]
self._add_list_triples_from_dict(resource_dict, distribution,
items)
Expand Down Expand Up @@ -1242,7 +1247,6 @@ def graph_from_dataset(self, dataset_dict, dataset_ref):
# Lists
items = [
("language", DCT.language, None, Literal),
("conforms_to", DCT.conformsTo, None, Literal),
]
self._add_list_triples_from_dict(resource_dict, distribution,
items)
Expand Down

0 comments on commit f0cd258

Please sign in to comment.