From af0710a6e81465c7df49adfaef2f5974f2a4aecf Mon Sep 17 00:00:00 2001 From: mjanez <96422458+mjanez@users.noreply.github.com> Date: Thu, 22 Aug 2024 17:30:40 +0200 Subject: [PATCH] FIx test_shacl & update example ckan datasets --- ckanext/schemingdcat/tests/test_shacl.py | 5 +++-- .../ckan/ckan_full_dataset_dcat_ap_2.json | 19 ++++++++++++------- .../ckan_full_dataset_dcat_ap_2_legacy.json | 4 ++-- ...n_full_dataset_dcat_ap_2_vocabularies.json | 19 +++++++++++-------- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/ckanext/schemingdcat/tests/test_shacl.py b/ckanext/schemingdcat/tests/test_shacl.py index 483f5c60..c862405f 100644 --- a/ckanext/schemingdcat/tests/test_shacl.py +++ b/ckanext/schemingdcat/tests/test_shacl.py @@ -67,8 +67,9 @@ def graph_from_dataset(dataset_key): if not file_name.startswith("ckan/"): file_name = "ckan/" + file_name dataset_dict = json.loads(get_file_contents(file_name)) - - log.debug(json.dumps(dataset_dict, indent=2)) + + # Log the dataset_dict + log.info(f"Generated dataset_dict: {json.dumps(dataset_dict, indent=2)}") dataset = call_action("package_create", **dataset_dict) diff --git a/examples/ckan/ckan_full_dataset_dcat_ap_2.json b/examples/ckan/ckan_full_dataset_dcat_ap_2.json index 28c052bb..f4597318 100644 --- a/examples/ckan/ckan_full_dataset_dcat_ap_2.json +++ b/examples/ckan/ckan_full_dataset_dcat_ap_2.json @@ -38,14 +38,13 @@ "en": "Some version notes.", "es": "Notas sobre la versión." }, - "access_rights": "Statement about access rights", + "access_rights": "http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/noLimitations", "alternate_identifier":"alt-id-1", "theme": [ - "https://example.org/uri/theme1", - "https://example.org/uri/theme2", - "https://example.org/uri/theme3" + "http://inspire.ec.europa.eu/theme/hb", + "http://inspire.ec.europa.eu/theme/am" ], - "language": "es", + "language": "http://publications.europa.eu/resource/authority/language/SPA", "documentation": [ "https://example.org/some-doc.html" ], @@ -67,6 +66,8 @@ "http://data.europa.eu/eli/reg_impl/2023/138/oj_alt" ], "encoding": "UTF-8", + "contact_name": "Contact 1", + "contact_email": "contact1@example.org", "contact": [ { "name": "Contact 1", @@ -103,6 +104,7 @@ "temporal_resolution": "PT15M", "reference_system": "http://www.opengis.net/def/crs/EPSG/0/25830", "representation_type": "http://inspire.ec.europa.eu/metadata-codelist/SpatialRepresentationType/vector", + "topic": "http://inspire.ec.europa.eu/metadata-codelist/TopicCategory/biota", "spatial_coverage": [ { "geom": { @@ -197,9 +199,12 @@ "Standard 2", "Standard 3" ], - "language": "es", + "documentation": [ + "https://example.org/some-doc.html" + ], + "language": "http://publications.europa.eu/resource/authority/language/SPA", "provenance": "Sample provenance.", - "relation": "https://example.com/related/resource", + "resource_relation": "https://example.com/related/resource", "access_services": [ { "title": "Access Service 1", diff --git a/examples/ckan/ckan_full_dataset_dcat_ap_2_legacy.json b/examples/ckan/ckan_full_dataset_dcat_ap_2_legacy.json index 57feac86..7ee1ac73 100644 --- a/examples/ckan/ckan_full_dataset_dcat_ap_2_legacy.json +++ b/examples/ckan/ckan_full_dataset_dcat_ap_2_legacy.json @@ -59,11 +59,11 @@ }, { "key": "theme", - "value": "[\"https://example.org/uri/theme1\",\"https://example.org/uri/theme2\",\"https://example.org/uri/theme3\"]" + "value": "[\"http://inspire.ec.europa.eu/theme/hb\",\"http://inspire.ec.europa.eu/theme/am\"]" }, { "key": "language", - "value": "[\"en\",\"ca\",\"es\"]" + "value": "http://publications.europa.eu/resource/authority/language/SPA" }, { "key": "documentation", diff --git a/examples/ckan/ckan_full_dataset_dcat_ap_2_vocabularies.json b/examples/ckan/ckan_full_dataset_dcat_ap_2_vocabularies.json index a9968f24..3b7fcdd3 100644 --- a/examples/ckan/ckan_full_dataset_dcat_ap_2_vocabularies.json +++ b/examples/ckan/ckan_full_dataset_dcat_ap_2_vocabularies.json @@ -38,20 +38,20 @@ "en": "Some version notes.", "es": "Notas sobre la versión." }, - "access_rights": "http://publications.europa.eu/resource/authority/access-right/PUBLIC", - "alternate_identifier": "https://org1.example.org/datasets/alt-id-1", + "access_rights": "http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/noLimitations", + "alternate_identifier":"alt-id-1", "theme": [ - "https://example.org/uri/theme1", - "https://example.org/uri/theme2", - "https://example.org/uri/theme3" + "http://inspire.ec.europa.eu/theme/hb", + "http://inspire.ec.europa.eu/theme/am" ], "language": "http://publications.europa.eu/resource/authority/language/SPA", "documentation": [ "https://example.org/some-doc.html" ], "conforms_to": [ - "https://joinup.ec.europa.eu/collection/semic-support-centre/solution/dcat-application-profile-data-portals-europe/release/211", - "https://joinup.ec.europa.eu/collection/semic-support-centre/solution/dcat-application-profile-data-portals-europe/release/210" + "Standard 1", + "Standard 2", + "Standard 3" ], "is_referenced_by": [ "https://doi.org/10.1038/sdata.2018.22", @@ -66,6 +66,8 @@ "http://data.europa.eu/eli/reg_impl/2023/138/oj_alt" ], "encoding": "UTF-8", + "contact_name": "Contact 1", + "contact_email": "contact1@example.org", "contact": [ { "name": "Contact 1", @@ -102,6 +104,7 @@ "temporal_resolution": "PT15M", "reference_system": "http://www.opengis.net/def/crs/EPSG/0/25830", "representation_type": "http://inspire.ec.europa.eu/metadata-codelist/SpatialRepresentationType/vector", + "topic": "http://inspire.ec.europa.eu/metadata-codelist/TopicCategory/biota", "spatial_coverage": [ { "geom": { @@ -189,7 +192,7 @@ "issued": "2024-05-01T01:20:33", "modified": "2024-05-05T09:33:20", "license": "http://publications.europa.eu/resource/authority/licence/CC_BYNC_4_0", - "rights": "http://publications.europa.eu/resource/authority/access-right/PUBLIC", + "rights": "http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/noLimitations", "conforms_to": [ "https://joinup.ec.europa.eu/collection/semic-support-centre/solution/dcat-application-profile-data-portals-europe/release/211", "https://joinup.ec.europa.eu/collection/semic-support-centre/solution/dcat-application-profile-data-portals-europe/release/210"