UnboundLocalError: local variable 'entity' referenced before assignment

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

UnboundLocalError: local variable 'entity' referenced before assignment

houzw
When I try to load the RDF Concepts Vocabulary (RDF) file ( "http://www.w3.org/1999/02/22-rdf-syntax-ns#")(because I want to use rdf:List), I get an error :

UnboundLocalError: local variable 'entity' referenced before assignment

Following is my code:

from owlready2 import *
from os import path
onto_path.append(path.normpath(path.dirname(__file__)) + '/')

rdf_ont = get_ontology('rdf.rdf').load(only_local=True)
print(rdf_ont)

Any advise? thanks!
Reply | Threaded
Open this post in threaded view
|

Re: UnboundLocalError: local variable 'entity' referenced before assignment

houzw
It seems this error is caused by the file. I downloaded a correct one from http://www.w3.org/1999/02/22-rdf-syntax-ns.rdf, and it works fine.