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 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'): 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