From 15b0cc13c537b2d23c6e6403d94c87a8164fea81 Mon Sep 17 00:00:00 2001 From: amercader Date: Thu, 6 Jun 2024 17:10:19 +0200 Subject: [PATCH] [#56] Use choices for resource status --- ckanext/dcat/schemas/dcat_ap_2.1.yaml | 13 +++++++++++-- ckanext/dcat/tests/test_scheming_support.py | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ckanext/dcat/schemas/dcat_ap_2.1.yaml b/ckanext/dcat/schemas/dcat_ap_2.1.yaml index d11b95d9..051890ee 100644 --- a/ckanext/dcat/schemas/dcat_ap_2.1.yaml +++ b/ckanext/dcat/schemas/dcat_ap_2.1.yaml @@ -295,8 +295,17 @@ resource_fields: - field_name: status label: Status - help_text: The status of the distribution in the context of maturity lifecycle. - # TODO: choices + preset: select + choices: + - value: http://purl.org/adms/status/Completed + label: Completed + - value: http://purl.org/adms/status/UnderDevelopment + label: Under Development + - value: http://purl.org/adms/status/Deprecated + label: Deprecated + - value: http://purl.org/adms/status/Withdrawn + label: Withdrawn + help_text: The status of the resource in the context of maturity lifecycle. - field_name: license label: License diff --git a/ckanext/dcat/tests/test_scheming_support.py b/ckanext/dcat/tests/test_scheming_support.py index 9fd124a5..c4e7738e 100644 --- a/ckanext/dcat/tests/test_scheming_support.py +++ b/ckanext/dcat/tests/test_scheming_support.py @@ -146,7 +146,7 @@ def test_e2e_ckan_to_dcat(self): "size": 12323, "hash": "4304cf2e751e6053c90b1804c89c0ebb758f395a", "hash_algorithm": "http://spdx.org/rdf/terms#checksumAlgorithm_sha1", - "status": "published", + "status": "http://purl.org/adms/status/Completed", "access_url": "https://example.com/data.csv", "download_url": "https://example.com/data.csv", "issued": "2024-05-01T01:20:33", @@ -369,7 +369,7 @@ def test_e2e_ckan_to_dcat(self): # Resources: standard fields assert self._triple(g, distribution_ref, DCT.rights, resource["rights"]) - assert self._triple(g, distribution_ref, ADMS.status, resource["status"]) + assert self._triple(g, distribution_ref, ADMS.status, URIRef(resource["status"])) assert self._triple( g, distribution_ref,