Search code examples
taxonomyjenaontologyowlprotege

Relating classes in ontology


I have problems relating classes (not individuals) in my ontology. I need to know which one OWL(full-dl-lite) allows to relate classes. i mean the domain and range of property be http://www.w3.org/2002/07/owl#Class. Is it possible to do that? thanks for any hint.


Solution

  • First, forget about the spec at http://www.w3.org/TR/owl-guide/, http://www.w3.org/TR/owl-ref/ and http://www.w3.org/TR/owl-semantics/. The official recommendation for a Web Ontology Language is OWL 2, where the various sublanguages are OWL 2 EL, OWL 2 QL, OWL 2 RL, OWL 2 DL and OWL 2 Full (read about the new features of OWL 2). OWL Lite does not exist anymore and should be forgotten forever.

    Second, in OWL (both 1 and 2), it has always been possible to relate classes using annotation properties, like this in Turtle:

    # valid in all variants and OWL 1 and OWL 2
    :prop  a  owl:AnnotationProperty .
    :C1  a  owl:Class .
    :C2  a  owl:Class;
         :prop  :C2 .
    

    In OWL 1, it was not possible to define a domain or range for an annotation property but it is now possible in OWL 2:

    # works in all variants of OWL 2
    :prop  a  owl:AnnotationProperty;
           rdfs:domain  owl:Class;
           rdfs:range  owl:Class .
    

    Your other option is to rely on the notion of "punning", that is, using the IRI of a class for an individual, like so:

    # works in all variants of OWL 2
    :prop  a  owl:ObjectProperty .
    :C1  a  owl:Class .
    :C2  a  owl:Class;
         :prop  :C2 .
    

    However, you cannot use owl:Class as the domain or range of an object property. The last possibility is to not care and use OWL (1/2) Full:

    # works in OWL 1 Full, OWL 2 Full
    :prop  rdfs:domain  owl:Class;
           rdfs:range  owl:Class .
    :C1  a  owl:Class;
         :prop  :C2 .
    

    Note that most OWL DL reasoners will not crash on that input (more precisely, all reasoners that I've ever tested would not crash), so it's pretty safe in fact.