Commit 69d80ce7 authored by Willem ter Berg's avatar Willem ter Berg

schema fix

parent 1a54abfb
......@@ -100,6 +100,7 @@ def create_schema(schema):
})
schema['resources'].update({
# property [classification, type, content, conversion]
'url': [mandatory, is_string],
'name': [mandatory, is_string],
'description': [mandatory, is_string],
......@@ -146,7 +147,6 @@ def update_schema(schema):
overheid_license = tk.get_validator('overheid_license')
donl_catalogs = tk.get_validator('donl_catalogs')
donl_language = tk.get_validator('donl_language')
donl_languages = tk.get_validator('donl_languages')
donl_organization = tk.get_validator('donl_organization')
mdr_filetype_nal = tk.get_validator('mdr_filetype_nal')
iana_mediatypes = tk.get_validator('iana_mediatypes')
......@@ -156,9 +156,6 @@ def update_schema(schema):
is_uri = tk.get_validator('is_uri')
is_date = tk.get_validator('is_date')
is_list = tk.get_validator('is_list')
are_uris = tk.get_validator('are_uris')
to_list_if_curly_string = tk.get_converter('convert_to_list_if_curly_string')
to_curly_string_if_list = tk.get_converter('convert_to_curly_string_if_list')
spatial_validation = tk.get_validator('spatial_validation')
temporal_validation = tk.get_validator('temporal_validation')
date_planned_validation = tk.get_validator('date_planned_validation')
......@@ -168,50 +165,50 @@ def update_schema(schema):
rights_validation = tk.get_validator('rights_validation')
schema.update({
'identifier': [mandatory, is_string, to_extras],
'alternate_identifier': [recommended, to_list_if_curly_string, is_list, to_extras],
# property [classification, type, content, conversion]
'identifier': [mandatory, is_string, is_uri, to_extras],
'title': [mandatory, is_string],
'notes': [mandatory, is_string],
'modified': [mandatory, is_date, to_extras],
'source_catalog': [recommended, donl_catalogs, to_extras],
'language': [mandatory, to_list_if_curly_string, donl_languages, to_extras],
'metadata_language': [mandatory, donl_language, to_extras],
'theme': [mandatory, to_list_if_curly_string,
overheid_taxonomiebeleidsagenda, to_extras],
'changetype': [adms_changetype, to_extras],
'modified': [mandatory, is_string, is_date, to_extras],
'language': [mandatory, is_list, donl_language, to_extras],
'metadata_language': [mandatory, is_string, donl_language, to_extras],
'theme': [mandatory, is_list, overheid_taxonomiebeleidsagenda, to_extras],
'authority': [mandatory, is_string, donl_organization, to_extras],
'publisher': [mandatory, is_string, donl_organization, to_extras],
'license': [mandatory, overheid_license],
'contact_point_name': [mandatory, is_string, to_extras],
'contact_point_email': [recommended, is_string, to_extras],
'contact_point_address': [recommended, is_string, to_extras],
'contact_point_name': [mandatory, is_string, to_extras],
'contact_point_phone': [recommended, is_string, to_extras],
'contact_point_website': [recommended, is_string, to_extras],
'contact_point_website': [recommended, is_string, is_uri, to_extras],
'contact_point_title': [recommended, is_string, to_extras],
'authority': [mandatory, donl_organization, to_extras],
'publisher': [mandatory, donl_organization, to_extras],
'license': [recommended, overheid_license],
'access_rights': [recommended, overheid_openbaarheidsniveau, to_extras],
'url': [recommended, is_uri],
'spatial_scheme': [recommended, overheid_spatial_scheme, to_extras],
'alternate_identifier': [recommended, is_list, is_uri, to_extras],
'access_rights': [recommended, is_string, overheid_openbaarheidsniveau, to_extras],
'url': [recommended, is_string, is_uri],
'spatial_scheme': [recommended, is_list, overheid_spatial_scheme, to_extras],
'spatial_value': [recommended, is_list, to_extras],
'temporal_label': [recommended, is_string, to_extras],
'temporal_start': [recommended, is_date, to_extras],
'temporal_end': [recommended, is_date, to_extras],
'conforms_to': [recommended, to_list_if_curly_string, is_list, to_extras],
'related_resource': [recommended, to_list_if_curly_string, are_uris, to_extras],
'source': [recommended, to_list_if_curly_string, are_uris, to_extras],
'issued': [recommended, is_date, to_extras],
'temporal_start': [recommended, is_string, is_date, to_extras],
'temporal_end': [recommended, is_string, is_date, to_extras],
'conforms_to': [recommended, is_list, to_extras],
'related_resource': [recommended, is_string, is_uri, to_extras],
'source': [recommended, is_string, is_uri, to_extras],
'issued': [recommended, is_string, is_date, to_extras],
'version': [recommended, is_string],
'version_notes': [recommended, to_list_if_curly_string, is_list, to_extras],
'has_version': [recommended, to_list_if_curly_string, is_list, to_extras],
'is_version_of': [recommended, to_list_if_curly_string, is_list, to_extras],
'version_notes': [recommended, is_list, to_extras],
'has_version': [recommended, is_list, to_extras],
'is_version_of': [recommended, is_list, to_extras],
'legal_foundation_ref': [recommended, is_string, to_extras],
'legal_foundation_uri': [recommended, is_uri, to_extras],
'legal_foundation_uri': [recommended, is_string, is_uri, to_extras],
'legal_foundation_label': [recommended, is_string, to_extras],
'documentation': [optional, to_list_if_curly_string, are_uris, to_extras],
'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],
'source_catalog': [recommended, is_string, donl_catalogs, to_extras],
'dataset_status': [recommended, is_string, overheid_dataset_status, to_extras],
'date_planned': [optional, is_string, is_date, to_extras],
'documentation': [optional, is_list, is_uri, to_extras],
'frequency': [optional, is_string, overheid_frequency, to_extras],
'provenance': [optional, is_list, is_uri, to_extras],
'sample': [optional, is_list, is_uri, to_extras],
'changetype': [adms_changetype, to_extras],
'__after': [spatial_validation,
temporal_validation,
contact_point_validation,
......@@ -221,24 +218,25 @@ def update_schema(schema):
})
schema['resources'].update({
# property [classification, type, content, conversion]
'url': [mandatory, is_string],
'name': [mandatory, is_string],
'description': [mandatory, is_string],
'metadata_language': [mandatory, donl_language],
'language': [mandatory, donl_languages, to_curly_string_if_list],
'metadata_language': [mandatory, is_string, donl_language],
'language': [mandatory, is_list, donl_language],
'license': [mandatory, overheid_license],
'format': [mandatory, mdr_filetype_nal],
'format': [mandatory, is_string, mdr_filetype_nal],
'size': [recommended, is_number],
'download_url': [recommended, are_uris, to_curly_string_if_list],
'mimetype': [recommended, iana_mediatypes],
'release_date': [recommended, is_date],
'download_url': [recommended, is_string, is_uri],
'mimetype': [recommended, is_string, iana_mediatypes],
'release_date': [recommended, is_string, is_date],
'rights': [recommended, is_string],
'status': [recommended, adms_distributiestatus],
'modification_date': [recommended, is_date],
'linked_schemas': [recommended, is_list, to_curly_string_if_list],
'status': [recommended, is_string, adms_distributiestatus],
'modification_date': [recommended, is_string, is_date],
'linked_schemas': [recommended, is_list, is_uri],
'hash': [optional, is_string],
'hash_algorithm': [optional, is_string],
'documentation': [optional, are_uris, to_curly_string_if_list],
'documentation': [optional, is_list, is_uri],
'__after': [hash_validation]
})
......
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