Greetings!

I want to list all superclasses of a class using the listSuperClasses()-Method of OntClass. For most classes that's not a problem, but in some special cases I just receive a null as a superclass. For example I've got this ontology:

...
    <!-- [..]#Student -->

    <Class rdf:about="[..]#Student">
        <rdfs:subClassOf rdf:resource="[..]#Person"/>
        <rdfs:subClassOf>
            <Class>
                <unionOf rdf:parseType="Collection">
                    <rdf:Description rdf:about="[..]#Man"/>
                    <rdf:Description rdf:about="[..]#Woman"/>
                </unionOf>
            </Class>
        </rdfs:subClassOf>
    </Class>
...

The [..] are just to shorten the ontology reference which is definitely correct. The Person is recognized without any problem, but whenever the ontology contains a "<rdfs:subClassOf> ... </rdfs:subClassOf>", it won't find the superclass and returns null instead (ontClass.hasSuperClass() returns true though). There are not only unions but also restrictions in this form, that can't be found.

How can I correctly read these superclasses, whenever I receive a null?

Thanks in advance!

Reply via email to