Hello,
I have to use the namespace to define my ontology. I used a namespace for defining several classes in one ontology and then use ".classes()" and other attributes to return result from this namespace. I can have access to each class individually but
I could not get a list of all classes through namespace. Is there any solution?
>>> from owlready2 import *
>>> onto1 = get_ontology("
http://test.org/onto1.owl")
>>> obo1 = onto1.get_namespace('
http://test.org/')
>>> with obo1:
class MyNewClass1(Thing): pass
class MyNewClass11(Thing): pass
class MyNewClass111(Thing): pass
>>> print(obo1.base_iri)
http://test.org/>>> print(obo1.MyNewClass1)
test.org.MyNewClass1
>>> print(list(obo1.classes()))
Traceback (most recent call last):
File "<pyshell#13>", line 1, in <module>
print(list(obo1.classes()))
TypeError: 'NoneType' object is not callable