diff --git a/ckanext/dcatapchharvest/profiles.py b/ckanext/dcatapchharvest/profiles.py index 3a266ec..401ba80 100644 --- a/ckanext/dcatapchharvest/profiles.py +++ b/ckanext/dcatapchharvest/profiles.py @@ -436,14 +436,14 @@ def _get_groups(self, subject): new_theme_url = dcat_theme_url.replace( OGD_THEMES_URI, CHTHEMES_URI) eu_theme_url = unicode( - eu_theme_mapping[URIRef(new_theme_url)]) + eu_theme_mapping[URIRef(new_theme_url)][0]) # Case 2: We get a dcat-ap.ch theme (the same as the # opendata.swiss themes, but different base url). Get # the correct EU theme from the theme mapping. elif dcat_theme_url.startswith(CHTHEMES_URI): eu_theme_url = unicode( - eu_theme_mapping[URIRef(dcat_theme_url)]) + eu_theme_mapping[URIRef(dcat_theme_url)][0]) # Case 3: We get an EU theme and don't need to look it up in # the mapping. diff --git a/ckanext/dcatapchharvest/tests/fixtures/catalog-themes.xml b/ckanext/dcatapchharvest/tests/fixtures/catalog-themes.xml new file mode 100644 index 0000000..44e87bd --- /dev/null +++ b/ckanext/dcatapchharvest/tests/fixtures/catalog-themes.xml @@ -0,0 +1,35 @@ + + + + BFS - OGD Collection + BFS - OGD Collection + + + 346252@bundesamt-fur-statistik-bfs + 1990-12-31T23:00:00Z + 1991-02-19T23:00:00Z + + + + + 346252@bundesamt-fur-statistik-bfs + 1992-12-31 + 1993-02-19 + + + + + 346252@bundesamt-fur-statistik-bfs + 1994-12 + 1995-02 + + + + + 346252@bundesamt-fur-statistik-bfs + 1996 + 1997 + + + +