Owlready2 0.9 has been released!

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

Owlready2 0.9 has been released!

Jiba
Administrator
This new version allows the use of PostgresQL instead of SQLite3 (however, performances are
usually lower). It also facilitate the access to SOME restrictions on classes,
using the dotted notation "class.property".

Here are the changes in version 0.9:

* PostgresQL backend (in addition to SQLite3)
* Add 'exclusive = False' option for SQLite3 backend (slower, but allows multiple uses)
* Use unique index in sqlite3 quadstore on resources table
* Optimize sqlite3 quadstore by caching IRI dict (5% faster)
* Add == support for class construct
* Add get_namespace() support on World
* Add 'existential restrictions as class properties' feature
* Bugfixes:
  - Fix imported ontologies
  - Fix saving ontologies in onto_path
  - Fix clear() on CallbackList
  - Fix bug in Class IRI in ontologies whose base IRI ends with a /
  - Fix imported ontologies in ontologies whose base IRI ends with a /
 
The new version be downloaded from PyPI (Python Package Index):
https://pypi.python.org/pypi/Owlready2
Reply | Threaded
Open this post in threaded view
|

Re: Owlready2 0.9 has been released!

Ulrich18
Hi.

I have an ontology project which work well on Owlready2 0.5.
When i use Owlready2 0.9 i got this error OwlReadyOntologyParsingErro: NTriples parsing error in file???

How can i fix it?

Thank you
Reply | Threaded
Open this post in threaded view
|

Re: Owlready2 0.9 has been released!

Jiba
Administrator
Hi,

Could you send me the ontology, or an extract that raises this error please?

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Owlready2 0.9 has been released!

Ulrich18
i got this error when i trying to load these ontology :

-idomal,( idomal.owl.xml) downloaded from http://www.obofoundry.org/ontology/idomal.html
-po (po.owl.xml) downloaded form http://www.obofoundry.org/ontology/po.html
-doid, (doid.owl.xml) downloaded from http://www.obofoundry.org/ontology/doid.html
Reply | Threaded
Open this post in threaded view
|

Re: Owlready2 0.9 has been released!

Ulrich18
Traceback:

File "/app/.heroku/python/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
  35.             response = get_response(request)

File "/app/.heroku/python/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  113.         resolver_match = resolver.resolve(request.path_info)

File "/app/.heroku/python/lib/python3.6/site-packages/django/urls/resolvers.py" in resolve
  498.             for pattern in self.url_patterns:

File "/app/.heroku/python/lib/python3.6/site-packages/django/utils/functional.py" in __get__
  36.         res = instance.__dict__[self.name] = self.func(instance)

File "/app/.heroku/python/lib/python3.6/site-packages/django/urls/resolvers.py" in url_patterns
  540.         patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)

File "/app/.heroku/python/lib/python3.6/site-packages/django/utils/functional.py" in __get__
  36.         res = instance.__dict__[self.name] = self.func(instance)

File "/app/.heroku/python/lib/python3.6/site-packages/django/urls/resolvers.py" in urlconf_module
  533.             return import_module(self.urlconf_name)

File "/app/.heroku/python/lib/python3.6/importlib/__init__.py" in import_module
  126.     return _bootstrap._gcd_import(name[level:], package, level)

File "<frozen importlib._bootstrap>" in _gcd_import
  994. <source code not available>

File "<frozen importlib._bootstrap>" in _find_and_load
  971. <source code not available>

File "<frozen importlib._bootstrap>" in _find_and_load_unlocked
  955. <source code not available>

File "<frozen importlib._bootstrap>" in _load_unlocked
  665. <source code not available>

File "<frozen importlib._bootstrap_external>" in exec_module
  678. <source code not available>

File "<frozen importlib._bootstrap>" in _call_with_frames_removed
  219. <source code not available>

File "/app/ontoprojet/urls.py" in <module>
  29.     path('ontologia/', include('ontologia.urls')),

File "/app/.heroku/python/lib/python3.6/site-packages/django/urls/conf.py" in include
  34.         urlconf_module = import_module(urlconf_module)

File "/app/.heroku/python/lib/python3.6/importlib/__init__.py" in import_module
  126.     return _bootstrap._gcd_import(name[level:], package, level)

File "<frozen importlib._bootstrap>" in _gcd_import
  994. <source code not available>

File "<frozen importlib._bootstrap>" in _find_and_load
  971. <source code not available>

File "<frozen importlib._bootstrap>" in _find_and_load_unlocked
  955. <source code not available>

File "<frozen importlib._bootstrap>" in _load_unlocked
  665. <source code not available>

File "<frozen importlib._bootstrap_external>" in exec_module
  678. <source code not available>

File "<frozen importlib._bootstrap>" in _call_with_frames_removed
  219. <source code not available>

File "/app/ontologia/urls.py" in <module>
  3. from . import views

File "/app/ontologia/views.py" in <module>
  19. from ontologia.python.ontology_class import Ontology

File "/app/ontologia/python/ontology_class.py" in <module>
  11. from owlready2 import *

File "/app/.heroku/python/lib/python3.6/site-packages/owlready2/__init__.py" in <module>
  106. default_world = IRIS = World()

File "/app/.heroku/python/lib/python3.6/site-packages/owlready2/namespace.py" in __init__
  224.       self.graph = Graph(filename)

File "/app/.heroku/python/lib/python3.6/site-packages/owlready2/triplelite.py" in __init__
  55.       self.execute("""CREATE TABLE resources (storid TEXT PRIMARY KEY, iri TEXT) WITHOUT ROWID""")

Exception Type: OperationalError at /
Exception Value: near "WITHOUT": syntax error
Reply | Threaded
Open this post in threaded view
|

Re: Owlready2 0.9 has been released!

Jiba
Administrator
Hello,

I tried to load these ontologies. The problem (owlready2.base.OwlReadyOntologyParsingError: NTriples parsing error) is caused because doid.owl imports ontology "http://purl.obolibrary.org/obo/doid/obo/ext.owl", which is not a a format readable by Owlready2 (currently, NTriple, RDF/XML or OWL/XML).

The only solution is to translate this file in a supported format (e.g. manually using Protege), and to save it as a local copy in a directory listed in onto_path.

Notice that the same will apply for any other ontologies loaded by ext.owl.

Best regards,
Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Owlready2 0.9 has been released!

Ulrich18
Hello,

Thank you for your help.
now I have this error 'owlready2' has no attribute 'namespace'

Please tell me how can i fix it.

Thank you
Reply | Threaded
Open this post in threaded view
|

Re: Owlready2 0.9 has been released!

Jiba
Administrator
Hi,

Maybe :

        import owlready2.namespace

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Owlready2 0.9 has been released!

Ulrich 18
I think This is an internal error inside the owlready2 library because
It indicate in the file __init__  of owlready2 one line in which it try to call "owlready2.namespace".

Please can you help me ?
Reply | Threaded
Open this post in threaded view
|

Re: Owlready2 0.9 has been released!

Jiba
Administrator
Hello,

Could you send me a small program that raises this error ? I need to experiment it.

Best regards,
Jean-Baptiste Lamy
MCF, LIMICS, Université Paris 13
Reply | Threaded
Open this post in threaded view
|

Re: Owlready2 0.9 has been released!

Ulrich18

Helllo,

This is the code to load my ontologies. It works well in my computer but when i try to send my appl on a remote server(i use heroku platform) i got this error :module 'owlready2' has no attribute 'namespace'

Python code:

    def load_ontologies(self, ontology_path=os.path.dirname('/ontologia/ontologies')):
        global number_ontologies
        onto_path.append(ontology_path)
        for name in self.ontologies:
            onto = get_ontology(self.ontologies[name])
            onto.load()
            self.target_names.append(name)
            self.number_ontologies += 1
            self.get_classes_ontology(onto)
            self.obo = onto.get_namespace("http://purl.obolibrary.org/obo/")


url of my heroku app : https://ontologia.herokuapp.com/
 
Thank you
Reply | Threaded
Open this post in threaded view
|

Re: Owlready2 0.9 has been released!

Jiba
Administrator
Hello,

I've looked at the error message on your server; the importation error is caused by an error related to SQLite3 at line 55 in owlready2/triplelite.py:    

   55.     self.execute("""CREATE TABLE resources (storid TEXT PRIMARY KEY, iri TEXT) WITHOUT ROWID""")

It seems that your server does not recognize the "WITHOUT ROWID", possibly because the SQLite3 version is too old?

You can either update it, or simply remove "WITHOUT ROWID" (it is an optimization, but Owlready will work also without it).

In the development version of Owlready, I'm adding an "except" statement for fixing this problem.

Best regards,
Jean-Baptiste Lamy
MCF HDR, Laboratoire LIMICS, Université Paris 13