Immediate descendants

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

Immediate descendants

moi
Thanks for this great library, I am enjoying using it.

It is possible to only fetch immediate descendants of a Class instead of all the descendants.

For example:

If I have Mojito subClassOf Cocktail subClassOf ColdBeverage subClassOf Beverage

onto.Beverage.descendants() returns [ColdBeverage, Cocktail, Mojito] but I will like to only get ColdBeverage i.e., the immediate and direct descendant.

I get the same results with onto.search(subclass_of = onto.Beverage)

Thanks
moi
Reply | Threaded
Open this post in threaded view
|

Re: Immediate descendants

moi
Hi,

Ignore this question, I found the solution to this.

onto.Beverage.subclasses()