Search code examples
taxonomyontologyowlprotege

Ontology: OWL - Creating connections between classes


I ve got an Ontology written in OWL with Protege. But I don't find a solution for creating relations between Classes. Of course, there is a "subclass" relation, but I want to define my own relations. So I have a class hierarchy (which consists out of "subclass"-relations) but I want to create a relation, i.e. "has_Relation", to connect two classes.

My aim is to write a java programm in which I can get the information "which class is parentclass of a class?" and "to which class is a has_Relation connection?"

(I am not talking about individuals - I'm just talking about classes)

Thank you very much for your help in advance!

Best Regards Natan


Solution

  • The simplest way to do this is to use an annotation property. In Protégé, select the class you want to relate to another class, then click the + beside "Annotations" in the Annotations tab. Then add the has_Relation property with the second button on the top left of the window. Then select the Entity IRI tab and the Classes subtab, select the other class you want to relate to and you're done.

    However, you should rather not do this if has_Relation is an object property or a datatype property. If such is the case, you can use "punning", that is, you can make new individuals in the Individuals tab with the same names as the classes you want to relate. Then you relate them as if they were normal individuals. Note that this is allowed and valid in OWL 2 DL.