Re: How to use .instances() method to iterate through all Instances of owl:Thing in owlready2?

Posted by Jiba on
URL: http://owlready.306.s1.nabble.com/How-to-use-instances-method-to-iterate-through-all-Instances-of-owl-Thing-in-owlready2-tp2663p2670.html

Hi,

Thing.instances() should work for iterating through all individuals.
You can also use ontology.individuals().

Notice that both actually search for entity of type NamedIndividual. If the instances are not declared as NamedIndividual, it will not work (Owlready declares them properly as NamedIndividual, as well as Protege, but few RDF files that lack OWL semantics do not).

Jiba