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
- why getting different results using 2 different ways of validating xml? (my answer provides more discussion of rdf/xml , owl/xml are, how both can considered owl files, aren't both rdf files.)
- owl/xml vs rdf/xml serialization
- owl/xml or rdf/xml-abbrev ? (the question contains misinformation, answers clarify.)
Comments
Post a Comment