Search code examples
ontologyprotege

How to define self referring relationships among classes in Protégé


I am struggling to understand how i can model a relationship that refers a class to another instance of itself. For example:

Take a class X. I would like X to be able to have a relationship to other instances of its own class. Taking a look at the available object property characteristics immediately shows reflexive as a possibility, however my understanding is that a reflexive relationship means that the class can be related to itself using that property, i.e. an instance of the class can be related to itself through the property, not two instances of the same class related through the relationship. This would mean that an instance of X is related to itself, not two separate instances of X related to each other.

Am i misunderstanding how these properties work? It seems like it would be a good idea to have the ability to relate instances of classes on a class level. I am aware that what i am seeking to achieve can be done on an individual level, i.e. create individuals a and b, make them of type X and then assign the desired relationship between them, however this does not provide visibility of the relationship at the class level.

Thank you for taking the time to read this question and i hope you can help me understand.

DethMetalDuck


Solution

  • You can do something like the following, assuming you have class A that is and the object property hasProp:

    ObjectProperty: hasProp
      Characteristics:Reflexive
      Domain: A
      Range: A
    
    Class: A
      SubClassOf: hasProp some A
    

    This basically states that class A is a subset of the set of individuals that is related via hasProp to individuals of type class A.