Skip to content

Commit

Permalink
[#56] Use choices for resource status
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Jun 6, 2024
1 parent 8b78139 commit 15b0cc1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 11 additions & 2 deletions ckanext/dcat/schemas/dcat_ap_2.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ckanext/dcat/tests/test_scheming_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 15b0cc1

Please sign in to comment.