How to use .instances() method to iterate through all Instances of owl:Thing in owlready2?
Posted by mario7111 on
URL: http://owlready.306.s1.nabble.com/How-to-use-instances-method-to-iterate-through-all-Instances-of-owl-Thing-in-owlready2-tp2663.html
I can iterate through all instances of a class in owlready2 by using the following code which works fine:
>>> for i in Drug.instances(): print(i)
But I need to iterate through all instances of the ontology (through owl:Thing). I tried the following but it doesn't work:
>>> for i in Thing.instances(): print(i)
>>> for i in onto.Thing.instances(): print(i)
>>> for i in Thing.subclasses.instances(): print(i)