Parse an OWL file using RDFLib generetes errors

24 Views Asked by At

Here's the code snippet where I'm facing issues:

from rdflib import Graph
g = Graph()
g.parse('./Ontology/sample.owl', format='owl')

And I'm getting an error:

Error: raise PluginException("No plugin registered for (%s, %s)" % (name, kind)) rdflib.plugin.PluginException: No plugin registered for (owl, <class 'rdflib.parser.Parser'>)

When I try using a different format:

g.parse('./Ontology/sample.owl', format='xml')

I encounter another error:

Error: xml.sax._exceptions.SAXParseException: file://sample.owl:1:0: not well-formed (invalid token)

Tried formats OWL, XML, and application/rdf+xml, but none worked.

0

There are 0 best solutions below