Issues using W3C Time Ontology

Posted by MK on
URL: http://owlready.306.s1.nabble.com/Issues-using-W3C-Time-Ontology-tp2204.html

Hi There,
I'm wondering whether there is a parameter I can set when loading ontologies to request them in a specific format. I am currently having an issue loading the W3C Time ontology (and similarly, loading other ontologies that import the time ontology), because it seems that the IRI dereferences to a turtle file by default. See below for an example.

I can get around this issue when loading the time ontology individually by specifying a ".rdf" extension, but this does not resolve issues when loading ontologies that reuse the time ontology with its standard IRI. Has anyone run into this? Any suggestions on how I might resolve it?

Thanks in advance!

Megan

time = get_ontology('http://www.w3.org/2006/time')
>>> time.load()
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/owlready2/driver.py", line 148, in parse
    s,p,o = splitter.split(line[:-3], 2)
ValueError: not enough values to unpack (expected 3, got 1)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/owlready2/namespace.py", line 777, in load
    try:     new_base_iri = self.graph.parse(fileobj, default_base = self.base_iri, **args)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/owlready2/driver.py", line 182, in parse
    raise OwlReadyOntologyParsingError("NTriples parsing error (or unrecognized file format) in %s, line %s." % (getattr(f, "name", getattr(f, "url", "???")), current_line)) from e
owlready2.base.OwlReadyOntologyParsingError: NTriples parsing error (or unrecognized file format) in http://www.w3.org/2006/time, line 11.