Superclass name

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

Superclass name

Girish Joglekar
Here is a code.snippet that is giving me problem. m is JenaOWLModel.

        iIter = m.getUserDefinedOWLNamedClasses().iterator();
        while(iIter.hasNext()) {
            OWLNamedClass nc = (OWLNamedClass) iIter.next();
            pw.println("Class: "+nc.getLocalName()+" Superclass: "+
                    nc.getFirstSuperclass().getLocalName());
        }
If a class has a property with restrictions (Cardinality = 1) it prints some junk string for superclass

Class: KwdWithValue Superclass: @A36_bd1057ff_b0b2_4f3a_9cbc_a4aa589e7a83

For the other classes, the correct superclass name is printed. How do I get the asserted superclass of a class?
Please help. Thanks.
Girish Joglekar

_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
Reply | Threaded
Open this post in threaded view
|

Re: Superclass name

Thomas Russ

On Jul 8, 2011, at 1:09 PM, Girish Joglekar wrote:

> Here is a code.snippet that is giving me problem. m is JenaOWLModel.
>
>         iIter = m.getUserDefinedOWLNamedClasses().iterator();
>         while(iIter.hasNext()) {
>             OWLNamedClass nc = (OWLNamedClass) iIter.next();
>             pw.println("Class: "+nc.getLocalName()+" Superclass: "+
>                     nc.getFirstSuperclass().getLocalName());
>         }
> If a class has a property with restrictions (Cardinality = 1) it prints some junk string for superclass
>
> Class: KwdWithValue Superclass: @A36_bd1057ff_b0b2_4f3a_9cbc_a4aa589e7a83

Yes.  That is because that is an anonymous class that is typically just the restriction.

>
> For the other classes, the correct superclass name is printed. How do I get the asserted superclass of a class?

I don't think there is a function that gets the asserted superclass.

But what you probably want is getNamedSuperclasses() instead.


_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03