Re: Issues using W3C Time Ontology

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

I tried following your steps, but it did not work.  I downloaded http://www.w3.org/2006/time using Protégé, and saved in RDF/XML format into time.owl.

I then tested the following:

time = get_ontology('time.owl').load()
ctime = get_ontology('http://ontology.eil.utoronto.ca/tove/ctime.owl').load()
ctime.imported_ontologies.append(time)

I received the following error when loading the ctime file (which imports http://www.w3.org/2006/time):

* Owlready2 * Warning: optimized Cython parser module 'owlready2_optimized' is not available, defaulting to slower Python implementation
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 "/Users/markfox/Dropbox/Research/TOVE2/Code/OWL Time/timeTest.py", line 7, in <module>
    ctime = get_ontology('http://ontology.eil.utoronto.ca/tove/ctime.owl').load()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/owlready2/namespace.py", line 816, in load
    imported_ontologies = [self.world.get_ontology(self._unabbreviate(abbrev_iri)).load() for abbrev_iri in self.world._get_obj_triples_sp_o(self.storid, owl_imports)]
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/owlready2/namespace.py", line 816, in <listcomp>
    imported_ontologies = [self.world.get_ontology(self._unabbreviate(abbrev_iri)).load() for abbrev_iri in self.world._get_obj_triples_sp_o(self.storid, owl_imports)]
  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#2016, line 11.