Commit d71769b2 authored by Willem ter Berg's avatar Willem ter Berg

Merge branch 'public.version' into data.overheid.nl

parents 13491752 547772b5
......@@ -25,6 +25,7 @@ _VALUELISTS = {
'donl_organization': 'http://waardelijsten.dcat-ap-donl.nl/donl_organization.json',
'iana_mediatypes': 'http://waardelijsten.dcat-ap-donl.nl/iana_mediatypes.json',
'mdr_filetype_nal': 'http://waardelijsten.dcat-ap-donl.nl/mdr_filetype_nal.json',
'overheid_dataset_status': 'http://waardelijsten.dcat-ap-donl.nl/overheid_dataset_status.json',
'overheid_frequency': 'http://waardelijsten.dcat-ap-donl.nl/overheid_frequency.json',
#'overheid_license': 'http://waardelijsten.dcat-ap-donl.nl/overheid_license.json',
'overheid_openbaarheidsniveau': 'http://waardelijsten.dcat-ap-donl.nl/overheid_openbaarheidsniveau.json',
......
{
"http://data.overheid.nl/status/beschikbaar": {
"code": "beschikbaar",
"labels": {
"nl-NL": "Beschikbaar",
"en-UK": "Available"
}
},
"http://data.overheid.nl/status/gepland": {
"code": "gepland",
"labels": {
"nl-NL": "Gepland",
"en-UK": "Planned"
}
},
"http://data.overheid.nl/status/in onderzoek": {
"code": "in onderzoek",
"labels": {
"nl-NL": "In onderzoek",
"en-UK": "Being researched"
}
},
"http://data.overheid.nl/status/niet beschikbaar": {
"code": "niet beschikbaar",
"labels": {
"nl-NL": "Niet schikbaar",
"en-UK": "Not available"
}
}
}
\ No newline at end of file
......@@ -21,6 +21,7 @@ def create_schema(schema):
optional = tk.get_validator('ignore_missing')
to_extras = tk.get_converter('convert_to_extras')
adms_changetype = tk.get_validator('adms_changetype_created')
overheid_dataset_status = tk.get_validator('overheid_dataset_status')
overheid_taxonomiebeleidsagenda = tk.get_validator('overheid_taxonomiebeleidsagenda')
overheid_openbaarheidsniveau = tk.get_validator('overheid_openbaarheidsniveau')
overheid_spatial_scheme = tk.get_validator('overheid_spatial_scheme')
......@@ -87,6 +88,8 @@ def create_schema(schema):
'frequency': [optional, overheid_frequency, to_extras],
'provenance': [optional, are_uris, to_extras],
'sample': [optional, are_uris, to_extras],
'dataset_status': [recommended, overheid_dataset_status, to_extras],
'date_planned': [optional, is_date, to_extras],
'__after': [spatial_validation, temporal_validation, contact_point_validation, legal_foundation_validation]
})
......@@ -129,6 +132,7 @@ def update_schema(schema):
optional = tk.get_validator('ignore_missing')
to_extras = tk.get_converter('convert_to_extras')
adms_changetype = tk.get_validator('adms_changetype_updated')
overheid_dataset_status = tk.get_validator('overheid_dataset_status')
overheid_taxonomiebeleidsagenda = tk.get_validator('overheid_taxonomiebeleidsagenda')
overheid_openbaarheidsniveau = tk.get_validator('overheid_openbaarheidsniveau')
overheid_spatial_scheme = tk.get_validator('overheid_spatial_scheme')
......@@ -196,6 +200,8 @@ def update_schema(schema):
'frequency': [optional, overheid_frequency, to_extras],
'provenance': [optional, to_list_if_curly_string, are_uris, to_extras],
'sample': [optional, to_list_if_curly_string, are_uris, to_extras],
'dataset_status': [recommended, overheid_dataset_status, to_extras],
'date_planned': [optional, is_date, to_extras],
'__after': [spatial_validation, temporal_validation, contact_point_validation, legal_foundation_validation]
})
......@@ -278,7 +284,9 @@ def show_schema(schema):
'documentation': [from_extras, to_list_if_curly_string, optional],
'frequency': [from_extras, optional],
'provenance': [from_extras, to_list_if_curly_string, optional],
'sample': [from_extras, to_list_if_curly_string, optional]
'sample': [from_extras, to_list_if_curly_string, optional],
'dataset_status': [from_extras, recommended],
'date_planned': [from_extras, optional],
})
schema['resources'].update({
......
......@@ -34,6 +34,7 @@ _VALIDATORS = {
'contact_point_validation': contact_point_validator.valid_contact_point,
'hash_validation': hash_validator.valid_hash,
'legal_foundation_validation': legal_foundation_validator.valid_legal_foundation,
'overheid_dataset_status': valuelist_validator.overheid_dataset_status,
'overheid_taxonomiebeleidsagenda': valuelist_validator.overheid_taxonomiebeleidsagenda,
'overheid_openbaarheidsniveau': valuelist_validator.overheid_openbaarheidsniveau,
'overheid_frequency': valuelist_validator.overheid_frequency,
......
......@@ -10,6 +10,17 @@ import ckan.plugins.toolkit as tk
from ckanext.dcatdonl.helper.caching import cached
def overheid_dataset_status(value):
"""
Validates value against the overheid_dataset_status valuelist. Will throw a
ckan.plugins.toolkit.Invalid when the value fails validation.
:param value: str, the value to validate
:return: str, the original value if it passes validation
"""
return _check_value('overheid_dataset_status', value)
def overheid_taxonomiebeleidsagenda(values):
"""
Validates values against the overheid_taxonomiebeleidsagenda valuelist. Will throw a
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment