I am a newbie coding with the Manchester syntax for OWL. I need to understand the role of exactly
. Which of these restrictions is correct:
(hasChild (A or B)) and (hasChild exactly 1 Thing)
(hasChild (A or B)) and (hasChild exactly 2 Thing)
(hasChild (A and B)) and (hasChild exactly 1 Thing)
(hasChild (A and B)) and (hasChild exactly 2 Thing)
Can you explain it when A
and B
are equivalent, and when they are disjoint?
The meaning of class expressions is defined in section 2.2.3 Class Expressions of the OWL 2 Web Ontology Language Direct Semantics W3C recommendation.
The four class expressions given in the question aren't quite well formed, as I understand the Manchester OWL syntax, as
hasChild (A or/and B)
really needs to behasChild some/only (A or/and B)
. That said, we can still discuss the meaning of the various combinations.Exact Cardinality Restrictions
The restrictions
hasChild exactly 1 Thing
andhasChild exactly 2 Thing
denote the classes of individuals which are related to exactly one or two other individuals by thehasChild
property, respectively. Since the class expression in the restriction isThing
, it is probably more common to see the versions without a class:hasChild exactly 1
andhasChild exactly 2
.Universal or AllValuesFrom Restrictions
The expression
hasChild only X
denotes the class of individuals which are such that if they are related to any other individual by thehasChild
property, then the other individual is an instance ofX
. It does not impose any constraint that there are such individuals, but only that if there are any, then they must beX
s.Existential or SomeValuesFrom Restrictions
The expression
hasChild some X
denotes the class of individuals which are related to at least one other individual that is anX
by thehasChild
property. It does not impose any constraint that every other individual related by thehasChild
is anX
, just that at least one is.The meaning of the expressions
The class expressions in the problem aren't well formed at the moment, and should either be
hasChild some (A or/and B)
orhasChild only (A or/and B)
. This means that there are a number of cases to consider, but fortunately some of them condense down.If A and B are equivalent
If
A
andB
are equivalent, then both(A or B)
and(A and B)
are equivalent toA
and toB
. This means that the expressions in the question can be simplified into two cases, depending on whether the restriction on the left hand side should besome
oronly
.(hasChild some A) and (hasChild exactly 1 Thing)
This class expression denotes the class of individuals which are related by the
hasChild
property to at least one individual of typeA
, and that are related to exactly one other individual by thehasChild
property (and by the left side, that one individual must be that individual of typeA
).(hasChild some A) and (hasChild exactly 2 Thing)
This class expression denotes the class of individuals which are related by the
hasChild
property to at least one individual of typeA
, and that are related to exactly two individuals by thehasChild
property (and by the left side, one of these individuals must that individual of typeA
).(hasChild only A) and (hasChild exactly 1 Thing)
This class expression denotes the class of individuals which are related by the
hasChild
property only to individuals of typeA
, and that are related to exactly one other individual by thehasChild
property (and by the left side, that one individual must be of typeA
).(hasChild only A) and (hasChild exactly 2 Thing)
This class expression denotes the class of individuals which are related by the
hasChild
property to some individual of typeA
, and that are related to exactly two individuals by thehasChild
property (and by the left side, both of these individuals must that individual of typeA
).If A and B are disjoint
If
A
andB
are disjoint, then the class expressionA and B
denotes the empty class, since nothing can be both anA
and aB
. That means that that four of the cases are unsatisfiable.The cases that involve
hasChild some (A and B)
are unsatisfiable, because there are noA and B
s for anything to be related to. There are two such cases:The combination of
only (A and B)
andexactly n
is unsatisfiable, since (as long asn
is not 0), it says that an individual must be related to exactlyn
things, and that each of thosen
things must be anA and B
(of which there can be none. There are two such cases:The remaining cases are all fairly straightforward, given the meaning of
some
andonly
. Though there are four class expressions, there are only two distinct classes.This is the class of things that have exactly one child, which must be an
A
or aB
.This is the class of things that have exactly two children, each of which must be an
A
or aB
.