4

I am trying to create an OWL ontology using Protege. I want to use inverse functional properties as a resemblance for primary keys from relational databases. For example, I have a property, that has a unique id as object, thus identifying the entity and no other entity should be allowed to use this value with that property.

As the object value is a string, it has to be a data property. But in Protege, you cannot assign the Inverse functional characteristic to a data property.

Why can't I declare a data property to be a inverse functional property and how else should I create the "unique key" logic if not like this?

Thanks in advance,
Frank

Aaginor
  • 4,516
  • 11
  • 51
  • 75
  • 1
    Antoine Zimmermann has given a complete explanation. In short, if a datatype property is made inverse functional, the literal can become the subject of a triple - which is not allowed. – Ignazio Apr 11 '17 at 23:19
  • Simply use the OWL 2 feature of keys: https://www.w3.org/TR/owl2-new-features/#F9:_Keys – UninformedUser Apr 12 '17 at 04:52
  • Ignazio, are you not confusing `owl:inverseOf` and `owl:InverseFunctionalProperty`? In any case, the reason why it is not allowed is unrelated to this syntactic restriction. In OWL Full, inverse functional properties are allow even on datatype properties, and you can also define the inverse of a datatype property in OWL Full even though literals cannot be subject of a triple. – Antoine Zimmermann Apr 12 '17 at 11:04

1 Answers1

7

The restriction on datatype properties is purely due to computational complexity. Without the restriction, the logic of OWL 2 DL would not be decidable. However, it is possible to express a notion of unique key in OWL 2:

ex:key  a  owl:DatatypeProperty .
owl:Thing  owl:hasKey  ( ex:key ) .

However, there is a subtle difference between this and an inverse functional property. Consider the following:

ex:this  a  [
    a  owl:Restriction;
    owl:onProperty  ex:prop;
    owl:minCardinality  2;
    owl:onClass  [
        a  owl:Restriction;
        owl:onProperty  ex:key;
        owl:hasValue  1
    ]
] .

If ex:key is a key for owl:Thing, then this ontology is consistent. However, if ex:key could be an inverse functional property, then this ontology would not be consistent. The reason is due to the way keys work in OWL 2. For a key to identify something, the thing has to be named explicitly. There could be several unnamed things having the same key (here, the key is the number 1) and yet, they would not be considered equal as long as they are not declared explicitly in the ontology. However, with inverse functional property, it is not the case. As a result, we would be able to infer that everything having value 1 on property ex:key is the same thing, and therefore, ex:this cannot have 2 values for the property ex:prop.

Antoine Zimmermann
  • 5,314
  • 18
  • 36
  • 1
    Thank you very much for the reply, Antoine! If I get it right ... with OWL full I **could** make data properties inverse functional properties? How can I tell Protege to tread my ontology as OWL full (thus allowing me to make data properties inverse functional)? And second, how do I define the owl:hasKey relation with Protege? – Aaginor Apr 12 '17 at 12:26
  • Late answer, but better late than never: Protégé is an OWL 2 DL editor, so you cannot use features that are not part of OWL 2 DL, such as inverse functional datatype properties. To add such thing to your ontology, you can save it in an RDF format, then edit the RDF directly. Keys can be added via the Class tab. You select a class, then in the Description panel on the right, you can add a "Target for key". – Antoine Zimmermann Mar 05 '23 at 10:07