From 8506ed82fe5ed9f57304859659dbd5fa651a608f Mon Sep 17 00:00:00 2001 From: anonymous <anonymous> Date: Fri, 26 Apr 2019 14:54:17 +0200 Subject: [PATCH] Fixed error: rdf-export now allows for URIRef as URIRef (not Literal) --- ckanext/odsh/profiles.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ckanext/odsh/profiles.py b/ckanext/odsh/profiles.py index 2431877e..d60026af 100644 --- a/ckanext/odsh/profiles.py +++ b/ckanext/odsh/profiles.py @@ -1,6 +1,6 @@ from ckanext.dcatde.profiles import DCATdeProfile, DCATDE, DCAT, VCARD, dcat_theme_prefix , DCATDE_1_0 from ckanext.dcat.utils import resource_uri -from ckanext.dcat.profiles import EuropeanDCATAPProfile, DCT +from ckanext.dcat.profiles import EuropeanDCATAPProfile, DCT, URIRefOrLiteral from ckan.model.license import LicenseRegister import rdflib import ckanext.dcatde.dataset_utils as ds_utils @@ -59,7 +59,10 @@ class ODSHEuropeanDCATAPProfile(EuropeanDCATAPProfile): self.g.set((s, DCT['format'], rdflib.URIRef(resource_formats_export()[o2.decode()]))) for s,p,o in self.g.triples((None, DCT.language, None)): if o.decode() in get_language(): - self.g.set((s, p, rdflib.URIRef(get_language()[o.decode()]))) + self.g.set((s, p, rdflib.URIRef(get_language()[o.decode()]))) + elif type(o) == rdflib.Literal and type(URIRefOrLiteral(o.decode())) == rdflib.URIRef: + self.g.set((s, p, rdflib.URIRef(o.decode()) )) + class ODSHDCATdeProfile(DCATdeProfile): def parse_dataset(self, dataset_dict, dataset_ref): -- GitLab