Suppose we have a class named A
, and a DataProperty called hasRestriction
. What is the difference between these statements:
A SubClassOf (hasRestriction value 2)
A SubClassOf (hasRestriction exactly 2)
A SubClassOf (hasRestriction only 2)
TL;DR: read AKSW's comments, they are good and concise.
Long version:
Your question is asking how to interpret class expressions in Protégé. Protégé uses the OWL 2 Manchester syntax to describe classes, and Protégé assumes that ontologies are interpreted according to the OWL 2 Direct Semantics. If the property hasRestriction
is a DataProperty in Protégé, then it means that hasRestriction
denotes a set of pairs (x,y) where x is an individual (an element of the universe of discourse) and y is a data value (like a number, a string, a date). In Protégé, class expressions are used to denote sets of individuals.
In the statements you provide there are three class expressions:
hasRestriction value 2
hasRestriction exactly 2
hasRestriction only 2
The first one, hasRestriction value 2
, identifies the set of things that have the property hasRestriction
with the value 2. So if x belongs to this class, then (x, 2) belongs to what hasRestriction
denotes. If A
is a subClass of this class, then a triple x rdf:type A
entails the triple x hasRestriction 2
.
The second one, hasRestriction exactly 2
, identifies the set of things that have exactly 2 values for the property hasRestriction
. So if x belongs to this class, then there are two distinct values v and w such that (x, v) and (x,w) belong to what hasRestriction
denotes. If A
is a subClass of this class, then a triple x rdf:type A
entails the triples x hasRestriction _:v
and x hasRestriction _:w
and _:v owl:differentFrom _:w
(I use a quasi-Turtle syntax here).
The third one, hasRestriction only 2
is a syntax error because if hasRestriction
is a datatype property, then you must use a datatype expression after the keyword only
. For instance, hasRestriction only xsd:integer
.
In the second case, a given individual x
in class A
may have known values for the property hasRestriction
. For instance, there could be the triples x rdf:type A
, x hasRestriction 1
, x hasRestriction 2
, in which case, we know that x
exactly has 1 and 2 as values for hasRestriction
. If, additionally, we know that x hasRestriction 3
, then there is a contradiction, because 1, 2 and 3 are three distinct values, while the expression tells us that there must be exactly two.