Skip to content
Snippets Groups Projects
Verified Commit 9ef0da2a authored by Jesper Zedlitz's avatar Jesper Zedlitz
Browse files

Übertragung der Property politicalGeocodingURI nach spatial_uri, falls eine spatial_uri fehlt.

parent fe98986b
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,7 @@ class ODSHDCATdeProfile(DCATdeProfile):
)
self._parse_distributions(dataset_dict, dataset_ref)
self._parse_type(dataset_dict, dataset_ref)
self._parse_political_geocoding_uri(dataset_dict, dataset_ref)
self._parse_references(dataset_dict, dataset_ref)
self._parse_applicable_legislation(dataset_dict, dataset_ref)
self._parse_hvd_category(dataset_dict, dataset_ref)
......@@ -104,6 +105,16 @@ class ODSHDCATdeProfile(DCATdeProfile):
ds_utils.insert_new_extras_field(
dataset_dict, 'hvdCategory', "{" + value + "}")
def _parse_political_geocoding_uri(self, dataset_dict, dataset_ref):
"""There are datasets that have a politicalGeocodingURI but no spatial_uri."""
extras = extras=dataset_dict.get('extras')
political_geocoding_uri = helpers_odsh.odsh_extract_value_from_extras(extras=extras, key='politicalGeocodingURI')
spatial_uri = helpers_odsh.odsh_extract_value_from_extras(extras=extras, key='spatial_uri')
if not spatial_uri and political_geocoding_uri:
if '"' in political_geocoding_uri:
political_geocoding_uri = political_geocoding_uri.split('"')[1]
ds_utils.insert_new_extras_field( dataset_dict, 'spatial_uri', political_geocoding_uri)
def _belongs_to_collection(self, dataset_dict, dataset_ref):
dct_is_version_of = self._object(dataset_ref, DCT.isVersionOf)
belongs_to_collection = True if dct_is_version_of else False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment