Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Map categories to new groups based on EU themes #129

Merged
merged 2 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ckanext/geocat/tests/test_dataset_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def test_fields_values(self):
self.assertEquals('[email protected]', contact_point['email'])

# groups
groups = ['territory', 'geography']
groups = ['regi', 'envi']
for group in dataset.get('groups'):
self.assertIn(group['name'], groups)

Expand Down
64 changes: 32 additions & 32 deletions ckanext/geocat/utils/ogdch_map_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,38 +54,38 @@ def map_to_ogdch_keywords(geocat_keywords):

def map_to_ogdch_categories(geocat_categories):
theme_mapping = {
'imageryBaseMapsEarthCover': ['geography', 'territory'],
'imageryBaseMapsEarthCover_BaseMaps': ['geography', 'territory'],
'imageryBaseMapsEarthCover_EarthCover': ['geography', 'territory'],
'imageryBaseMapsEarthCover_Imagery': ['geography', 'territory'],
'location': ['geography', 'territory'],
'elevation': ['geography', 'territory'],
'boundaries': ['geography', 'territory'],
'planningCadastre': ['geography', 'territory'],
'planningCadastre_Planning': ['geography', 'territory'],
'planningCadastre_Cadastre': ['geography', 'territory'],
'geoscientificInformation': ['geography', 'territory'],
'geoscientificInformation_Geology': ['geography', 'territory'],
'geoscientificInformation_Soils': ['geography', 'territory'],
'geoscientificInformation_NaturalHazards': ['geography', 'territory'],
'biota': ['geography', 'territory', 'agriculture'],
'oceans': ['geography', 'territory'],
'inlandWaters': ['geography', 'territory'],
'climatologyMeteorologyAtmosphere': ['geography', 'territory'],
'environment': ['geography', 'territory'],
'environment_EnvironmentalProtection': ['geography', 'territory'],
'environment_NatureProtection': ['geography', 'territory'],
'society': ['geography', 'culture', 'population'],
'health': ['geography', 'health'],
'structure': ['geography', 'construction'],
'transportation': ['geography', 'mobility'],
'utilitiesCommunication': ['geography', 'territory', 'energy', 'culture'], # noqa
'utilitiesCommunication_Energy': ['geography', 'energy', 'territory'],
'utilitiesCommunication_Utilities': ['geography', 'territory'],
'utilitiesCommunication_Communication': ['geography', 'culture'],
'intelligenceMilitary': ['geography', 'public-order'],
'farming': ['geography', 'agriculture'],
'economy': ['geography', 'work', 'national-economy'],
'imageryBaseMapsEarthCover': ['regi', 'envi'],
'imageryBaseMapsEarthCover_BaseMaps': ['regi', 'envi'],
'imageryBaseMapsEarthCover_EarthCover': ['regi', 'envi'],
'imageryBaseMapsEarthCover_Imagery': ['regi', 'envi'],
'location': ['regi', 'envi'],
'elevation': ['regi', 'envi'],
'boundaries': ['regi', 'envi'],
'planningCadastre': ['regi', 'envi'],
'planningCadastre_Planning': ['regi', 'envi'],
'planningCadastre_Cadastre': ['regi', 'envi'],
'geoscientificInformation': ['regi', 'envi'],
'geoscientificInformation_Geology': ['regi', 'envi'],
'geoscientificInformation_Soils': ['regi', 'envi'],
'geoscientificInformation_NaturalHazards': ['regi', 'envi'],
'biota': ['regi', 'envi', 'agri'],
'oceans': ['regi', 'envi'],
'inlandWaters': ['regi', 'envi'],
'climatologyMeteorologyAtmosphere': ['regi', 'envi'],
'environment': ['regi', 'envi'],
'environment_EnvironmentalProtection': ['regi', 'envi'],
'environment_NatureProtection': ['regi', 'envi'],
'society': ['regi', 'educ', 'soci'],
'health': ['regi', 'heal'],
'structure': ['regi', 'soci'],
'transportation': ['regi', 'tran'],
'utilitiesCommunication': ['regi', 'envi', 'ener', 'educ'],
'utilitiesCommunication_Energy': ['regi', 'ener', 'envi'],
'utilitiesCommunication_Utilities': ['regi', 'envi'],
'utilitiesCommunication_Communication': ['regi', 'educ'],
'intelligenceMilitary': ['regi', 'gove'],
'farming': ['regi', 'agri'],
'economy': ['regi', 'econ'],
}
ogdch_groups = []
for category in geocat_categories:
Expand Down
Loading