Skip to content
Snippets Groups Projects
Commit 8506ed82 authored by anonymous's avatar anonymous
Browse files

Fixed error: rdf-export now allows for URIRef as URIRef (not Literal)

parent 287edbcc
Branches
Tags
No related merge requests found
from ckanext.dcatde.profiles import DCATdeProfile, DCATDE, DCAT, VCARD, dcat_theme_prefix , DCATDE_1_0 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.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 from ckan.model.license import LicenseRegister
import rdflib import rdflib
import ckanext.dcatde.dataset_utils as ds_utils import ckanext.dcatde.dataset_utils as ds_utils
...@@ -60,6 +60,9 @@ class ODSHEuropeanDCATAPProfile(EuropeanDCATAPProfile): ...@@ -60,6 +60,9 @@ class ODSHEuropeanDCATAPProfile(EuropeanDCATAPProfile):
for s,p,o in self.g.triples((None, DCT.language, None)): for s,p,o in self.g.triples((None, DCT.language, None)):
if o.decode() in get_language(): 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): class ODSHDCATdeProfile(DCATdeProfile):
def parse_dataset(self, dataset_dict, dataset_ref): def parse_dataset(self, dataset_dict, dataset_ref):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment