From bceeaee16342f0a05ba2ccfbfa3351a5590dd17f Mon Sep 17 00:00:00 2001 From: Rae Knowler Date: Tue, 6 Aug 2024 11:40:34 +0200 Subject: [PATCH 1/3] docs: Fix copy/paste error in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 80e95506..77feaa0f 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ To install ckanext-dcatapchharvest for development, activate your CKAN virtualen do: git clone https://github.com/ogdch/ckanext-dcatapchharvest.git - cd ckanext-switzerland + cd ckanext-dcatapchharvest python setup.py develop pip install -r dev-requirements.txt pip install -r requirements.txt From 76e9896e9a7462b1ea8d899d18cda51b4793fec0 Mon Sep 17 00:00:00 2001 From: Rae Knowler Date: Tue, 6 Aug 2024 11:41:15 +0200 Subject: [PATCH 2/3] fix: Add back issued and modified dates to Distribution graph --- ckanext/dcatapchharvest/profiles.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ckanext/dcatapchharvest/profiles.py b/ckanext/dcatapchharvest/profiles.py index 50bf661e..16accca4 100644 --- a/ckanext/dcatapchharvest/profiles.py +++ b/ckanext/dcatapchharvest/profiles.py @@ -1027,6 +1027,8 @@ def graph_from_dataset(self, dataset_dict, dataset_ref): # noqa ('issued', DCT.issued, None, Literal), ('modified', DCT.modified, None, Literal), ] + self._add_date_triples_from_dict(resource_dict, distribution, + items) # ByteSize if resource_dict.get('byte_size'): From 63f0b2e093f60ffc33bd575b59b36d0300d9c404 Mon Sep 17 00:00:00 2001 From: Rae Knowler Date: Tue, 6 Aug 2024 11:55:17 +0200 Subject: [PATCH 3/3] tests: Test serialization of resource issued and modified --- ckanext/dcatapchharvest/tests/fixtures/dataset.json | 4 +++- ckanext/dcatapchharvest/tests/test_dcatap_ch_serialize.py | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ckanext/dcatapchharvest/tests/fixtures/dataset.json b/ckanext/dcatapchharvest/tests/fixtures/dataset.json index bfa0ec49..cf863af6 100644 --- a/ckanext/dcatapchharvest/tests/fixtures/dataset.json +++ b/ckanext/dcatapchharvest/tests/fixtures/dataset.json @@ -123,7 +123,9 @@ ], "rights": "Creative Commons Zero 1.0 Universell (CC0 1.0)", "license": "NonCommercialAllowed-CommercialAllowed-ReferenceNotRequired", - "format": "CSV" + "format": "CSV", + "issued": "2015-06-26T15:21:09.034694", + "modified": "2015-06-30T15:21:09.000000" }, { "id": "28e75e40-e1a1-497b-a1b9-8c1834d60201", diff --git a/ckanext/dcatapchharvest/tests/test_dcatap_ch_serialize.py b/ckanext/dcatapchharvest/tests/test_dcatap_ch_serialize.py index 333ea474..f686931f 100644 --- a/ckanext/dcatapchharvest/tests/test_dcatap_ch_serialize.py +++ b/ckanext/dcatapchharvest/tests/test_dcatap_ch_serialize.py @@ -161,6 +161,11 @@ def test_graph_from_dataset(self): expected_literal = Literal("P1D", datatype=XSD.duration) assert self._triple(g, distribution, DCAT.temporalResolution, expected_literal) + if resource_dict.get('issued'): + assert self._triple(g, distribution, DCT.issued, resource_dict["issued"], XSD.dateTime) + + if resource_dict.get('modified'): + assert self._triple(g, distribution, DCT.modified, resource_dict["modified"], XSD.dateTime) def test_graph_from_dataset_uri(self): """Tests that datasets (resources) with a uri from the test system