0

我有一段非常简单的代码,但它已经遇到了错误。我的一段代码应该只遍历本体中的类名并将它们打印出来。这适用于前 20 个左右,但随后会发生此错误:

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 

我使用 owlready2 的代码只有这 4 行:

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

你能指出我的错误吗?我最初在 MacBook 上尝试过,但现在我也在运行 Arch 的计算机上进行了测试,同样的错误。

4

0 回答 0