querying asserted descendants!

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

querying asserted descendants!

Rajverma

Hi List,

 

I want to know whether there is any method from the Protégé API to retreive all the descendants from the asserted ontology… For example, with “Collection inferredDescendantClasses = reasoner.getDescendantClasses(vegetarianPizza, null);”  we can get all the descendants of the class ‘vegetarianPizza’ from the inferred ontology after the reasoner does the classification… With “Collection assertedDescendantClasses = vegetarianPizza.getNamedSubclasses();”  we can get only the top-level sub-classes of the asserted ontology…
 
So what I want now is, I also want to get all the descandants of this ‘vegetarianPizza’ from the asserted hierarchy… Is there any method or class in Protégé API that deals with the descendants of a class of asserted hierarchy? If there is none, what is the best way to achieve this? Is it a good way to write a new recursive loop on sub-classes if I want to retrieve the descendants of a class from asserted hierarchy?
 
Thanx,
Raj

 

Reply | Threaded
Open this post in threaded view
|

Re: querying asserted descendants!

Matthew Horridge
Hi Raj,


> Hi List,
>
>
>
> I want to know whether there is any method from the Protégé API to  
> retreive all the descendants from the asserted ontology… For  
> example, with “Collection inferredDescendantClasses =  
> reasoner.getDescendantClasses(vegetarianPizza, null);”  we can get  
> all the descendants of the class ‘vegetarianPizza’ from the  
> inferred ontology after the reasoner does the classification… With  
> “Collection assertedDescendantClasses =  
> vegetarianPizza.getNamedSubclasses();”  we can get only the top-
> level sub-classes of the asserted ontology… So what I want now is,  
> I also want to get all the descandants of this ‘vegetarianPizza’  
> from the asserted hierarchy… Is there any method or class in  
> Protégé API that deals with the descendants of a class of asserted  
> hierarchy? If there is none, what is the best way to achieve this?  
> Is it a good way to write a new recursive loop on sub-classes if I  
> want to retrieve the descendants of a class from asserted  
> hierarchy? Thanx,Raj

I think getSubClasses(true) should do it.

Cheers,

Matthew

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html