Skip to content

Commit

Permalink
feat: Import and export distribution field temporal_resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
kovalch committed Nov 13, 2023
1 parent a96cf78 commit ceb4af6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ckanext/dcatapchharvest/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,14 @@ def parse_dataset(self, dataset_dict, dataset_ref): # noqa
distribution, DCAT.accessService
)

# Temporal resolution

temporal_resolution = self._object_value_list(distribution, DCAT.temporalResolution)
log.debug("temporal_resolution : %s" % (temporal_resolution))
# Check if the value corresponds to XSD.duration
if temporal_resolution == XSD.duration:
resource_dict['temporal_resolution'] = temporal_resolution

# Timestamp fields
for key, predicate in (
('issued', DCT.issued),
Expand Down Expand Up @@ -912,6 +920,14 @@ def graph_from_dataset(self, dataset_dict, dataset_ref): # noqa
ref = URIRef(uri)
g.add((distribution, DCAT.accessService, ref))

# Temporal Resolution
if resource_dict.get('temporal_resolution'):
g.add((
distribution,
DCAT.temporalResolution,
Literal(resource_dict['temporal_resolution'], datatype=XSD.duration)
))

# Mime-Type
if resource_dict.get('mimetype'):
g.add((
Expand Down

0 comments on commit ceb4af6

Please sign in to comment.