How to retrieve direct instances of a class?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to retrieve direct instances of a class?

S04dEGR4gE
This post was updated on .
This will return individuals of a class and children of a class. Could anybody show me if there is a way to only return the individuals directly annotated to a class?

>>> from owlready2 import default_world
>>> default_world.set_backend(filename = 'helis_v1.10.sq3')
>>> default_world.search_one(label='Red Meat').instances()
Reply | Threaded
Open this post in threaded view
|

Re: How to retrieve direct instances of a class?

Jiba
Administrator
Use .direct_instances()

Jiba