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 ThingandhasChild exactly 2 Thingdenote the classes of individuals which are related to exactly one or two other individuals by thehasChildproperty, respectively. Since the class expression in the restriction isThing, it is probably more common to see the versions without a class:hasChild exactly 1andhasChild exactly 2.Universal or AllValuesFrom Restrictions
The expression
hasChild only Xdenotes the class of individuals which are such that if they are related to any other individual by thehasChildproperty, 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 beXs.Existential or SomeValuesFrom Restrictions
The expression
hasChild some Xdenotes the class of individuals which are related to at least one other individual that is anXby thehasChildproperty. It does not impose any constraint that every other individual related by thehasChildis 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
AandBare equivalent, then both(A or B)and(A and B)are equivalent toAand 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 besomeoronly.(hasChild some A) and (hasChild exactly 1 Thing)This class expression denotes the class of individuals which are related by the
hasChildproperty to at least one individual of typeA, and that are related to exactly one other individual by thehasChildproperty (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
hasChildproperty to at least one individual of typeA, and that are related to exactly two individuals by thehasChildproperty (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
hasChildproperty only to individuals of typeA, and that are related to exactly one other individual by thehasChildproperty (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
hasChildproperty to some individual of typeA, and that are related to exactly two individuals by thehasChildproperty (and by the left side, both of these individuals must that individual of typeA).If A and B are disjoint
If
AandBare disjoint, then the class expressionA and Bdenotes the empty class, since nothing can be both anAand 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 Bs for anything to be related to. There are two such cases:The combination of
only (A and B)andexactly nis unsatisfiable, since (as long asnis not 0), it says that an individual must be related to exactlynthings, and that each of thosenthings 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
someandonly. 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
Aor aB.This is the class of things that have exactly two children, each of which must be an
Aor aB.