[dxwg] owlready2 not playing well with DCAT (#1575)

digitalrager has just created a new issue for https://github.com/w3c/dxwg:

== owlready2 not playing well with DCAT ==
I'm receiving errors from DCAT when trying to pull it into owlready2.  This is the most important rdf we would like to leverage but the only rdf that seems to fail.  Are there any known issues/fixes for leveraging DCAT with owlready2?  

A rough example - happy to answer questions.  

`from owlready2 import *

dcat_onto = get_ontology("http://www.w3.org/ns/dcat#").load()
onto = get_ontology("https://example/")

onto.imported_ontologies.extend([dcat_onto])

with onto:  
    class Dataset(dcat_onto.Dataset):
        pass`

Once that output is save the following code with throw errors when trying to add named entities: 

`from owlready2 import *

# Set the default world
world = World()

# Load the OWL file into the world
onto = world.get_ontology("saved_rdf_file_from_previous.rdf").load()
dataset = onto.Dataset(title="asdf")`

This results in an error with the owlready2 parser:
line 755, in _load_by_storid
    return entity
UnboundLocalError: local variable 'entity' referenced before assignment

I have also run across this error when trying to use the rdf: 

RDF/XML parsing error in file https://www.w3.org/ns/dcat, line 11, column 2.



Please view or discuss this issue at https://github.com/w3c/dxwg/issues/1575 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 28 June 2023 23:29:35 UTC