Issue #1 new

Recursion time exceeded

magicrebirth
repo owner created an issue

Try:

python ontoinspector/onto_inspector.py "http://semanticscience.org/ontology/sio.owl"


[michele.pasin]@L4917:~/Dropbox/code/python/semweb>python ontoinspector/onto_inspector.py "http://semanticscience.org/ontology/sio.owl"
Traceback (most recent call last):
  File "ontoinspector/onto_inspector.py", line 1032, in <module>
    main(sys.argv[1:])
  File "ontoinspector/onto_inspector.py", line 961, in main
    ontoInspector = OntoInspector(argv[0])
  File "ontoinspector/onto_inspector.py", line 90, in __init__
    self.loadUri(uri)
  File "ontoinspector/onto_inspector.py", line 118, in loadUri
    self.tree = self.__getTree()
  File "ontoinspector/onto_inspector.py", line 291, in __getTree
    self.__getTree(potentialfather, out)
  File "ontoinspector/onto_inspector.py", line 297, in __getTree
    self.__getTree(ch, out)
  File "ontoinspector/onto_inspector.py", line 297, in __getTree
    self.__getTree(ch, out)
  File "ontoinspector/onto_inspector.py", line 297, in __getTree
    self.__getTree(ch, out)
  File "ontoinspector/onto_inspector.py", line 297, in __getTree
    self.__getTree(ch, out)
 .......
.........
..........
  File "ontoinspector/onto_inspector.py", line 294, in __getTree
    children = self.get_classDirectSubs(father)
  File "ontoinspector/onto_inspector.py", line 389, in get_classDirectSubs
    for s, v, o in self.rdfGraph.triples((None, RDFS.subClassOf , aClass)):
  File "build/bdist.macosx-10.8-intel/egg/rdflib/graph.py", line 1080, in triples
  File "build/bdist.macosx-10.8-intel/egg/rdflib/plugins/memory.py", line 467, in triples
  File "build/bdist.macosx-10.8-intel/egg/rdflib/term.py", line 147, in __eq__
RuntimeError: maximum recursion depth exceeded while calling a Python object

Comments (3)

  1. magicrebirth reporter

    Tried using this

    http://code.activestate.com/recipes/474088-tail-call-optimization-decorator/

    But the code break later due to a NoneType error

    === Traceback (most recent call last): File "ontoinspector/onto_inspector.py", line 1066, in <module> main(sys.argv[1:]) File "ontoinspector/onto_inspector.py", line 995, in main ontoInspector = OntoInspector(argv[0]) File "ontoinspector/onto_inspector.py", line 124, in init self.loadUri(uri) File "ontoinspector/onto_inspector.py", line 153, in loadUri self.maxdepth = self.get_MAXTreeLevel() File "ontoinspector/onto_inspector.py", line 371, in get_MAXTreeLevel temp = self.get_classTreeLevel(aClass) File "ontoinspector/onto_inspector.py", line 62, in func return g(args, *kwargs) File "ontoinspector/onto_inspector.py", line 357, in get_classTreeLevel for element in self.tree[key]: TypeError: 'NoneType' object is not subscriptable ===

  2. Log in to comment