pwin/owlready2

[BUG] Recursion Error on Cycle in Ontology

Closed this issue · 4 comments

creyD commented

I have a really simple piece of code but it already runs into an error. My piece of code
should just iterate over the class names in an ontology and print them out. This works for the first 20 or
so, but then this error occurs:

Fatal Python error: Cannot recover from stack overflow. 

Current thread 0x0000000106d2ae00 (most recent call first): 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/util.py", line 249 in __enter__ 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 543 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 540 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 538 in _get_by_storid 
  File "/Users/PATH/.env/lib/python3.7/site-packages/owlready2/namespace.py", line 558 in _load_by_storid 
  ... 
[1]    51983 abort      python owl_to_nodenames.py 

My simple code is:

from owlready2 import get_ontology 
onto = get_ontology("Ontologie.owl").load() 
for this in onto.classes(): 
    print(this) 

Can you point me to the error? I originally tried it on a MacBook, but now I also tested it on a computer running Arch, same error.

pwin commented

This is a fork of an older version of owlready2. The original is at https://bitbucket.org/jibalamy/owlready2/src/master/ and you might want to try that first - it is several modifications ahead of this repo

creyD commented

I actually used this, but as there is no bug reporting in place there, I thought I might ask here.

pwin commented

http://www.lesfleursdunormal.fr/static/informatique/owlready/forum_en.html is the main discussion forum - I suggest you post to that