diff --git a/ckanext/dcatapchharvest/dcat_helpers.py b/ckanext/dcatapchharvest/dcat_helpers.py index 992b758..444d594 100644 --- a/ckanext/dcatapchharvest/dcat_helpers.py +++ b/ckanext/dcatapchharvest/dcat_helpers.py @@ -243,11 +243,10 @@ def get_license_values(): try: for license_pref_label in g.objects(subject=ogdch_license_ref, predicate=SKOSXL.prefLabel): - for literal in g.objects(subject=license_pref_label, - predicate=SKOSXL.literalForm): - license_literal = literal + license_literal = next(g.objects(subject=license_pref_label, + predicate=SKOSXL.literalForm)) + if license_literal is not None: break # Assume one literal per concept - license_homepages_literal_mapping[license_homepage] = license_literal # noqa license_ref_literal_mapping[ogdch_license_ref] = license_literal license_homepage_ref_mapping[license_homepage] = ogdch_license_ref