Owlready2 0.24 has been released!

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Owlready2 0.24 has been released!

Jiba
Administrator
Hi everybody,

This new release includes several small changes and bugfixes. It now uses the Git versionning system, instead of Mercurial.

Here are the changes:

* Support intersection of searches (e.g. World.search(...) & World.search(...))
* Add owlready2.reasoning.JAVA_MEMORY
* Move development repository to Git
* Bugfixes:
  - Fix parsing of NTriples files that do not end with a new line
  - Fix KeyError with Prop.python_name when several properties share the same name
  - Fix get_ontology() calls in Python module imported by ontologies in a World that is not default_world
  - Fix use of PyMedTermino2 in a World that is not default_world
  - Fix World.as_rdflib_graph().get_context(onto) for ontology added after the creation of the RDFLIB graph
  - Fix destroying SWRL rules
  - Fix disjoint with non-atomic classes

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Owlready2 0.24 has been released!

Mike Bergman
Hi jiba,

All of this was great news. I have installed and tried to run the new version, but I keep getting the error below. While I have been doing active development, I have not called the full ontology since installing the new version. Further, I have never seen a traceback this deep.

I think I have checked all file calls and they are good. Do you have any ideas?

Thanks!

Mike

kb = world.get_ontology(kbpedia).load()

rc = kb.get_namespace('http://kbpedia.org/kko/rc/')              



skos = world.get_ontology(skos_file).load()

kb.imported_ontologies.append(skos)

core = world.get_namespace('http://www.w3.org/2004/02/skos/core#')



kko = world.get_ontology(kko_file).load()

kb.imported_ontologies.append(kko)

kko = kb.get_namespace('http://kbpedia.org/ontologies/kko#')

---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
C:\1-PythonProjects\Python\lib\site-packages\owlready2\namespace.py in load(self, only_local, fileobj, reload, reload_if_newer, **args)
    771         if _LOG_LEVEL: print("* Owlready2 *     ...loading ontology %s from %s..." % (self.name, f), file = sys.stderr)
--> 772         try:     fileobj = urllib.request.urlopen(f)
    773         except:  raise OwlReadyOntologyParsingError("Cannot download '%s'!" % f)

C:\1-PythonProjects\Python\lib\urllib\request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
    221         opener = _opener
--> 222     return opener.open(url, data, timeout)
    223

C:\1-PythonProjects\Python\lib\urllib\request.py in open(self, fullurl, data, timeout)
    530             meth = getattr(processor, meth_name)
--> 531             response = meth(req, response)
    532

C:\1-PythonProjects\Python\lib\urllib\request.py in http_response(self, request, response)
    640             response = self.parent.error(
--> 641                 'http', request, response, code, msg, hdrs)
    642

C:\1-PythonProjects\Python\lib\urllib\request.py in error(self, proto, *args)
    562         args = (dict, proto, meth_name) + args
--> 563         result = self._call_chain(*args)
    564         if result:

C:\1-PythonProjects\Python\lib\urllib\request.py in _call_chain(self, chain, kind, meth_name, *args)
    502             func = getattr(handler, meth_name)
--> 503             result = func(*args)
    504             if result is not None:

C:\1-PythonProjects\Python\lib\urllib\request.py in http_error_302(self, req, fp, code, msg, headers)
    754
--> 755         return self.parent.open(new, timeout=req.timeout)
    756

C:\1-PythonProjects\Python\lib\urllib\request.py in open(self, fullurl, data, timeout)
    530             meth = getattr(processor, meth_name)
--> 531             response = meth(req, response)
    532

C:\1-PythonProjects\Python\lib\urllib\request.py in http_response(self, request, response)
    640             response = self.parent.error(
--> 641                 'http', request, response, code, msg, hdrs)
    642

C:\1-PythonProjects\Python\lib\urllib\request.py in error(self, proto, *args)
    568             args = (dict, 'default', 'http_error_default') + orig_args
--> 569             return self._call_chain(*args)
    570

C:\1-PythonProjects\Python\lib\urllib\request.py in _call_chain(self, chain, kind, meth_name, *args)
    502             func = getattr(handler, meth_name)
--> 503             result = func(*args)
    504             if result is not None:

C:\1-PythonProjects\Python\lib\urllib\request.py in http_error_default(self, req, fp, code, msg, hdrs)
    648     def http_error_default(self, req, fp, code, msg, hdrs):
--> 649         raise HTTPError(req.full_url, code, msg, hdrs, fp)
    650

HTTPError: HTTP Error 404: Not Found

During handling of the above exception, another exception occurred:

OwlReadyOntologyParsingError              Traceback (most recent call last)
<ipython-input-4-1b134679e975> in <module>
----> 1 kb = world.get_ontology(kbpedia).load()
      2 rc = kb.get_namespace('http://kbpedia.org/kko/rc/')
      3
      4 skos = world.get_ontology(skos_file).load()
      5 kb.imported_ontologies.append(skos)

C:\1-PythonProjects\Python\lib\site-packages\owlready2\namespace.py in load(self, only_local, fileobj, reload, reload_if_newer, **args)
    811
    812     # Load imported ontologies
--> 813     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)]
    814     self._imported_ontologies._set(imported_ontologies)
    815

C:\1-PythonProjects\Python\lib\site-packages\owlready2\namespace.py in <listcomp>(.0)
    811
    812     # Load imported ontologies
--> 813     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)]
    814     self._imported_ontologies._set(imported_ontologies)
    815

C:\1-PythonProjects\Python\lib\site-packages\owlready2\namespace.py in load(self, only_local, fileobj, reload, reload_if_newer, **args)
    771         if _LOG_LEVEL: print("* Owlready2 *     ...loading ontology %s from %s..." % (self.name, f), file = sys.stderr)
    772         try:     fileobj = urllib.request.urlopen(f)
--> 773         except:  raise OwlReadyOntologyParsingError("Cannot download '%s'!" % f)
    774         try:     new_base_iri = self.graph.parse(fileobj, default_base = self.base_iri, **args)
    775         finally: fileobj.close()

OwlReadyOntologyParsingError: Cannot download 'http://kbpedia.org/ontologies/kko'!

Reply | Threaded
Open this post in threaded view
|

Re: Owlready2 0.24 has been released!

Mike Bergman
Hi jiba,

Hmm, this looks to be a false alarm on the new version.

First, I reverted back to version 0.23 and saw the same problem. However, when I execute the code block above (using Jupyter Notebook) for a SECOND time, the code processes without error. This had not happened before, so I must have done something to my environment that is not evident or that I can not recollect.

So, I reinstalled the new version (0.24) and can now confirm that the first execution of the code block fails the first time, succeeds the second time, for both versions. Again, this has not happened before and I can not understand what has transpired.

Sorry to have raised a false alarm before, but do you have any idea of what might be causing this perplexing behavior?

Thanks, Mike
Reply | Threaded
Open this post in threaded view
|

Re: Owlready2 0.24 has been released!

Jiba
Administrator
Hi,

It seems that Owlready was unable to find the ontology. Possibly, the file indicated in the  kko_file variable was missing?

Jiba