I have some individuals A,B,C,D,E, and two properties P1, P2.
A P1 B
C P1 D
E P2 C
I want to build a Class that only captures A but not C. so I set a Class like,
myClass EquivalentTo: (P1 some owl:Thing) and (P1 only owl:Thing)
myClass EquivalentTo: (P1 some owl:Thing) and (not inverse P2 some owl:Thing)
but all of those tries failed. How can I differentiate the individual A and C?
myClass EquivalentTo: (P1 some owl:Thing) and (P1 only owl:Thing)
fails because the class expression is really equivalent to P1 some Thing. Since every individual is an instance of Thing, the right hand side of the intersection really doesn't add anything.
myClass EquivalentTo: (P1 some owl:Thing) and (not inverse P2 some owl:Thing)
This is actually correct for the description that you gave. You want individuals that have some value for P1 (good), and that are not the P2 value of some other individual. This is the way to describe that.
I think the issue that you're having is that while while your data set doesn't contain any triples of the form
x P2 A
there's nothing in the ontology that says that such a thing is impossible. So you can't be sure that A actually has the type (not inverse P2 some Thing). This phenomenon is known as the open world assumption (OWA). If you search for that, you'll find some other questions on Stack Overflow about OWA in OWL. See, for instance:
Why is this DL-Query not returning any individuals?
Strange query behaviour in OWL!
In this case, if you want to say that A isn't the P2 value of some other individual, you'd probably have to do it manually, by adding a type to A like:
inverse P2 only owl:Nothing
Once you do that, you'll get the results you want:
Related
In SHOIN(D) that is equivalent to the DL family used by OWL-DL;
Is this expression legal:
F ⊑ (≤1 r. D) ⊓ (¬ (=0 r. D))
Where F, D are concepts, r is a role. I want to express that each instance of F is related to at most one instance of D through r, and not to zero instances.
In general, how to decide that some expression is legal w. r. t. a specific variation of DL? I thought that using BNF syntax of the variation may be what I'm targeting.
One easy way is to check whether you can write it in Protege. Most of the things that you can write in Protege will be legal OWL-DL. In Protege you can write:
F SubClassOf ((r max 1 D) and not(r exactly 0 D))
Of course, saying that something has at most 1 value, and not exactly one would be exactly the same as saying that it has exactly 1:
F SubClassOf r exactly 1 D
But there are a few things that you'll be able to do in Protege that won't be legal OWL-DL. The more direct way to find out what these are is the standard, specifically §11 Global Restrictions on Axioms in OWL 2 DL. Generally the only problems you might run into is trying to use composite properties where you're not allowed to.
If you don't want to check by hand, then you could try uploading your ontology into the OWL Validator and selecting the OWL2 DL profile.
Actually, I'm getting lost about what can be done and cannot be done using a reasoner in general.
My question is two fold:
I used to think that a reasoner is only dedicated for sumbsumption and taxonomies. Recently, I discovered that a reasoner can be used in multiple ways within some algorithms for example this reference introduces using a reasoner to search for entities compliant to a specific pattern in the ontology:
What is meant by a DL generic reasoning algorithm and how can it
be implemented through a reasoner?
Can you please refer my to
any references where I can get more familiar to things that can be
achieved by reasoning algorithms if any?
My original problem is that: given an OWL ontology and two classes C1 and C2, I want to check whether there is a functional property chain connecting them, i.e.
let's consider (C1 P1 C3), (C3 P2 C4)and (C4 P3 C2) where P1, P2 and P3 are functional object properties, thus the result will be (P1, P2, P3) which is the functional property chain connecting C1 and C2.
I have a UML conceptual diagram; and I want to express it as DL ontology. UML classes are captured as DL concepts, where associations are captured by means of roles. One important perspective is multiplicities among UML classes. A to-one multiplicity (0..* - 0..1) is captured by a functional object property, and to make the one (0..1) side mandatory, i.e. (0..* - 1) references talk about mandatory participation implying a maximum and minimum multiplicity of 1 on the to-one side.
Here is the reference
An association A between classes C1 and C2 is formalized in DL by means of a
role A on which we enforce the assertions
To express the multiplicity ml..mu on the participation of instances of C2 for each
given instance of C1, we use the assertion
I just cannot understand how the mandatory participation of C2 in the assertion is expressed by an assertion on C1, how is the last assertion read?
Using A a as a property name is a bit unusual, so I'm going to use p instead. The UML diagram doesn't express the direction of the property either, which makes the rest of the discussion a bit confused. Some information can be gleaned from the axioms you've provided, though.
If the UML is designed to express:
Instances of C1 are related by p to at least nl and and most nu instances of C2.
At least ml and and most mu instances of C1 are related by p to each instance of C2.
then you could use the DL axioms:
C1 ⊑ ≥nl p.C2
C1 ⊑ ≤nu p.C2
C2 ⊑ ≥ml p-1.C1
C2 ⊑ ≥mu p-1.C1
Those say that if x is a C1 (C2) then x is related to the appropriate number of C2 (C1) instances by p (p-1). Now, since the relationship as expressed in UML will only relate instances of the two classes, i.e., no other types of instances will be related by property p, then it's more likely that you would declare the domain and range of p as C1 and C2, respectively, with:
∃p ⊑ C1
∃p-1 ⊑ C2
and then use a simpler version of the axioms above:
C1 ⊑ ≥nl p
C1 ⊑ ≤nu p
C2 ⊑ ≥ml p-1
C2 ⊑ ≥mu p-1
To answer the very specific question:
just cannot understand how the mandatory participation of C2 in the
assertion is expressed by an assertion on C1, how is the last
assertion read?
The notation in the last axiom in the question is unusual, and I'm not sure exactly what's supposed to be. I'm not sure what the little circumflexes are suppose to be. It looks like:
C1 ⊑ ∃ p
though. If that's what it is, it's read as
C1 is a subclass of ∃ p
which means that that
If x is an instance of C1 then x is an instance of ∃ p
which means that
If x is an instance of C1 then x is an instance of the class of things that have at least value for p (i.e., there is at least one y such that p(x,y)).
In first-order logic, you could express it as:
∀x.(C1(x) → ∃y.p(x,y))
I have:
U-> PT….. 1
Q-> SU……2
etc...
in using the reflexivity axiom can I then say
Q-> S , Q-> U
Q-> PT
I trying to ask how this axiom works using the example above.
To derive
Q->S
Q->U
from
Q->SU
I'd use the decomposition rule, not the reflexivity axiom. Then I'd apply the transitivity axiom to Q->U, U->PT to derive Q->PT.
If you're asking what the reflexivity axiom means, it means
If Y is a subset of X, then X->Y.
In your example, it looks like you might be trying to say that
SU is a subset of Q, therefore Q->S and Q->U.
But it's not given that SU is a subset of Q. To make sure you get this point, Q->SU doesn't mean SU is a subset of Q.
For example, if you're in the military, your last name and blood type (among other things) are functionally dependent on your service number. Let's let the service number attribute be represented by "S", last name by "L", and blood type by "B". Then
S->LB
But neither "last name" nor "blood type" are subsets of "service number".
On the other hand, let's imagine that you're given this to start with.
U->PT
Q->SU
Q = {SUV} (New information!)
Since Q={SUV}, {S} is a subset of {SUV}, and {U} is a subset of {SUV}, then you can apply the reflexivity axiom to derive
Q->S (or SUV->S)
Q->U (or SUV->U)
But that axiom only applies in this example because you're given Q={SUV}.
I am half way reading the OWL2 primer and is having problem understanding the universal quantification
The example given is
EquivalentClasses(
:HappyPerson
ObjectAllValuesFrom( :hasChild :HappyPerson )
)
It says somebody is a happy person exactly if all their children are happy persons. But what if John Doe has no children can he be an instance of HappyPerson? What about his parent?
I also find this part very confusing, it says:
Hence, by our above statement, every childless person would be qualified as happy.
but wouldn't it violate the ObjectAllValuesFrom() constructor?
I think the primer actually does quite a good job at explaining this, particularly the following:
Natural
language indicators for the usage of
universal quantification are words
like “only,” “exclusively,” or
“nothing but.”
To simplify this a bit further, consider the expression you've given:
HappyPerson ≡ ∀ hasChild . HappyPerson
This says that a HappyPerson is someone who only has children who are also HappyPerson (are also happy). Logically, this actually says nothing about the existence of instances of happy children. It simply serves as a universal constraint on any children that may exist (note that this includes any instances of HappyPerson that don't have any children).
Compare this to the existential quantifier, exists (∃):
HappyPerson ≡ ∃ hasChild . HappyPerson
This says that a HappyPerson is someone who has at least one child that is also a HappyPerson. In constrast to (∀), this expression actually implies the existence of a happy child for every instance of a HappyPerson.
The answer, albeit initially unintuitive, lies in the interpretation/semantics of the ObjectAllValuesFrom OWL construct in first-order logic (actually, Description Logic). Fundamentally, the ObjectAllValuesFrom construct relates to the logical universal quantifier (∀), and the ObjectSomeValuesFrom construct relates to the logical existential quantifier (∃).
I am facing the same kind of issue while reading the "OWL 2 Web Ontology Language Primer (Second Edition - 2012)" and I am not convinced that the answer by Sharky clarifies the issue.
At page 15, when introducing the universal quantifier ∀, the book states:
"Another property restriction, called universal quantification is used to describe a class of individuals for which all related individuals must be instances of a given class. We can use the following statement to indicate that somebody is a happy person exactly if all their children are happy persons."
[I omit the OWL statements in the different sintaxes, they can be found in the book.]
I think that a more formal and may be less ambiguos representation of what the author states is
(1) HappyPerson = {x | ∀y (x HasChild y → y ∈ HappyPerson)}
I hope every reader understands this notation, because I find the notation used in the answer less clear (or may be I am just not accustomed to it).
The book proceeds:
"... There is one particular misconception concerning the universal role restriction. As an example, consider the above happiness axiom. The intuitive reading suggests that in order to be happy, a person must have at least one happy child [my note: actually the definition states that every children should be happy, not just at least one, in order for his/her parents to be happy. This appears to be a lapsus of the author]. Yet, this is not the case: any individual that is not a “starting point” of the property hasChild is a class member of any class defined by universal quantification over hasChild. Hence, by our above statement, every childless person would be qualified as happy . ..."
That is, the author states that (assume '~' for logical NOT), given
(2) ChildessPerson = { x | ~∃y( x HasChild y)}
then (1) and the meaning of ∀ imply
(3) ChildessPerson ⊂ HappyPerson
This does not seem true to me.
If it were true then every child, as far as s/he is a childless person, is happy and so only some parents can be unhappy persons.
Consider this model:
Persons = {a,b,c}, HasChild = {(a,b)}, HappyPerson={a,b}
and c is unhappy (independently from the close world or open world assumption). It is a possible model, which falsifies the thesis of the author.