[owl-s] R: finding children of a type

Leonardo Ayres leoayres at gmail.com
Wed Jun 7 13:34:23 EDT 2006


I tried this:

OWLKnowledgeBase kb = OWLFactory.createKB();
        OWLOntology onto2 = OWLFactory.createOntology(URI.create("
http://localhost:8080/psm/computers.owl"));
        OWLClass classe=onto2.createClass(URI.create("
http://mia.unifor.br/computers.owl#Peca"));

        Set sub=classe.getSubClasses(true);
        Set superr=classe.getSuperClasses(true);

But the Sets came empty. I tried too:

        OWLType owlType = kb.getType(new URI("
http://localhost:8080/psm/computers.owl#Peca"));

But owlType cames null.
:(

Anybody can help me?

Leonardo


On 6/5/06, G. Fenza <g.fenza at tin.it> wrote:
>
>  Hi,
>
> sorry for my bad english. About your question I think that you can use
> OWLClass on your OWL type.
>
> OWLClass has method that provide the set of direct superclasses and
> subclasses (if I remember the signature is "Set getSuperClasses(boolean
> direct)").
>
> You can obtain OWLClass instance from your OWLKnowledgebase instance. For
> example:
>
>
>
> //kb instance of OWLKnowledgebase
>
> OWLType owlType = kb.getType(new URI("http://www.w3.org/2002/07/owl#Thing
> ");
>
> If( owlType.isClass() ){
>
>             OWLClass clazz = (OWLClass) owlType;
>
>             Set superClasses = clazz.getSuperclasses(true);
>
>>
> }
>
>
>
> I hope this is useful.
>
>
>  ------------------------------
>
> *Da:* owl-s-bounces at lists.mindswap.org [mailto:
> owl-s-bounces at lists.mindswap.org] *Per conto di *Leonardo Ayres
> *Inviato:* lunedì 5 giugno 2006 13.16
> *A:* Hossein Pourreza
> *Cc:* owl-s at lists.mindswap.org
> *Oggetto:* Re: [owl-s] finding children of a type
>
>
>
> I wanna know how to do this too.
>
> On 6/2/06, *Hossein Pourreza* <pourreza at yahoo.com> wrote:
>
> Hi,
>
> I am wondering if there is a way to find the list of
> first level children of a type in OWL. For example, if
> I have type X and X1, X2, and X3 to be subtypes of
> type X, is there any way to find this list? Is this a
> valid requirement?
>
> We have isSubType() method but it needs two types to
> be known.
>
> Any help will be greatly appreciated
> Hossein
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> OWL-S mailing list
> OWL-S at lists.mindswap.org
> http://lists.mindswap.org/mailman/listinfo/owl-s
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mindswap.org/pipermail/owl-s/attachments/20060607/640d9936/attachment.html 


More information about the OWL-S mailing list