python - rdflib "repeat node-elements" parse error with OWL/XML file -


i have owl file prepared in protege else. i'm trying parse following python code, keep getting parse error.

import rdflib g=rdflib.graph() result = g.parse(r'myfile.owl') 

rdflib.exceptions.parsererror: file:///myfile.owl:461:27: repeat node-elements inside property elements: http://www.w3.org/2002/07/owl#class

the line , character numbers refer start of <class iri="#gas"/> line in owl file. indicate 'subclassof' construct wrong, or need plugin use rdflib properly, or else? owl file looks this:

<declaration>     <class iri="#acetylene"/> </declaration> <declaration>     <class iri="#gas"/> </declaration> ... <subclassof>     <class iri="#acetylene"/>     <class iri="#gas"/> </subclassof> 

the xml code you're showing in not rdf/xml; it's owl/xml. such, it's not surprising rdflib can't parse it. rdflib should able parse rdf/xml serialization of rdf mapping of owl ontology, that's not same thing owl/xml serialization of ontology. should either use owl tool convert owl/xml file rdf/xml file, or ask provider of ontology provide rdf/xml serialization.

see also


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -