querying sub-sub-sub-... classes

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

querying sub-sub-sub-... classes

Rajverma

Hi List,

 
At http://protege.stanford.edu/plugins/owl/api/ReasonerAPIExamples.html it was shown that we can query the subclasses (asserted or inferred) with the statement like “Collection inferredSubclasses = reasoner.getSubclasses(vegetarianPizza, null);”... However, with this ‘get.Subclasses’ method it gives only the upper-level subclasses but not deep into the hierarchy… So, what I want to know is how can we get all the subclasses of a particular class, including the subclasses subsubclasses and so on… One way to do this is to code it in such a way that for every subclass check whether there are any further subclasses for this subclass, if yes then lest them, if not continue till the end of the upper-level subclasses… Is this right?
Is there any other way, I mean existing code from Protégé API for this specific purpose?
 
Thanx,
Raj
Reply | Threaded
Open this post in threaded view
|

Re: querying sub-sub-sub-... classes

Olivier Dameron
On Tue, 9 May 2006 18:16:45 +0200, "Mudunuri, Raj"
<[hidden email]> wrote:

> At
> http://protege.stanford.edu/plugins/owl/api/ReasonerAPIExamples.html
> it was shown that we can query the subclasses (asserted or inferred)
> with the statement like "Collection inferredSubclasses =
> reasoner.getSubclasses(vegetarianPizza, null);"... However, with this
> 'get.Subclasses' method it gives only the upper-level subclasses but
> not deep into the hierarchy... So, what I want to know is how can we
> get all the subclasses of a particular class, including the
> subclasses subsubclasses and so on...

I think that you are looking for the getDescendantClasses() method
http://protege-owl.sourceforge.net/javadoc/edu/stanford/smi/protegex/owl/inference/protegeowl/ProtegeOWLReasoner.html#getDescendantClasses(edu.stanford.smi.protegex.owl.model.OWLClass,%20edu.stanford.smi.protegex.owl.inference.protegeowl.task.ReasonerTaskListener)

Hope this helps,
Olivier
-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html