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.
Related
In first place i have to apologize for my very, very poor english.
I've been studying the representation of knowledge in the context of design of experts systems trough ontologies. In particular, i've been using protégé as an OWL ontology editor.
After a large number of fails, finally i've started to realize the huge impact of the OWA on the process of inference and reasoning, mainly when i try to performance some automatic classification task.
I've solve many of the basic problems about that but, going deeper on the idea of making more and more specific classifications, i ran into the need for use cardinality restrictions. (which, at first, i tought that i cleary understand, but in the end, i realize that i'm nowhere close it)
Well, so far i've made a mess. Only a very few classification has been working as i spected. I guess that, as usual, i've been losing sight of the OWA.
Mi concrete doubt is this: What's the point on creating a restriction over an object property with a 'max' and, specially, 'exactly' cardinality in a context where we assume that the world is open?
I bring to you this simple example, based on the Pizza Tutorial, since many concepts can be extrapolated from there: Suppose that i want to define the class of pizzas named "FourChessePizza" and i want that, in principle, any individual that has four "ChesseTopping", i.e., four relationships along the "hasTopping" property with individuals of class "CheeseTopping", are inferred as belonging that class.
So i create an individual and, in "types", i assert this:
hasTopping some MozzarellaToping
hasTopping some ParmesanTopping
hasTopping some FontinaTopping
hasTopping some BlueChesseTopping
All the fillers are disjoints.
(The names of each chesse are merely demostrative; i don't know which cheeses are used)
So far, the reasoner have no way to say that that individual belongs to "FourChessePizza" since, although it has four relationships, the OWA considers the possibility that it can have more relations that might not have been "said". No 'max' or 'exactly' cardinality restriction can be applied since the uncertainty about "how much relations" really have the individual.
So, with only this information i can't found any restriction to my "FourCheesePizza" that clasify this simple individual as own.
Beyond this particular example, my question is more general about the generic process of "counting" asserted relationships with the less possible information.
¿Is there any solution to this kind of problems?¿What is what i'm not thinking in the rigth way to solve this and similar problems?
Thank you very much in advance for your time and your good will.
Cheers!
This is a surprisingly intricate problem! At first sight, it looks like what you need is simply a "closure axiom", something that is describe in the Protégé tutorial with the Pizza ontology. There, the concept of a Margherita pizza is at first described as a pizza that has some mozzarella topping and some tomato topping. But even if you know a pizza has mozzarella and tomato, it is not sufficient to classify it as a Margherita pizza, because other kinds of pizzas have mozzarella and tomato. So the solution is to say that a Margherita pizza only has mozarella and tomato toppings.
Similarly, it would be possible to say that your example pizza only has Mozzarella, Parmesan, Fontina, and Blue Cheese toppings. But would this be sufficient to qualify as a FourCheesePizza? Well, it depends how you define 4 cheese pizzas. If a FourCheesePizza is one that has at least 4 cheese toppings, then yes. But we don't want to have 5-cheese pizzas classified as 4-cheese pizzas, right?
A simple conceptualisation of 4-cheese pizzas would be that it has exactly 4 cheese toppings:
FourCheesePizza subClassOf hasTopping exactly 4 CheeseToppings
So, it means that for any instance of FourCheesePizza, there exists x1, x2, x3, x4 four distinct instances of CheeseTopping. The problem is, the four instances could be all distinct instances of MozzarellaTopping.
In the case of Hector Coscia's example, if we have:
FourCheesePizza subClassOf (
hasTopping some MozzarellaTopping and
hasTopping some ParmesanTopping and
hasTopping some FontinaTopping and
hasTopping some BlueChesseTopping and
hasTopping only (MozzarellaToping or ParmesanTopping or FontinaTopping or BlueChesseTopping)
then it is possible that there are 2 mozzarella toppings, 5 parmesan toppings, 16 fontina toppings, and 42 blue cheese toppings. And yet, this woud arguably be fine as a 4-cheese pizza because what matters is that it uses exactly 4 types of cheeses. But how to express that a pizza only has 4 types of toppings?
In OWL, it is not possible to restrict the number of classes used in a definition. For instance, it is not possible to say: the instances that are member of only 2 classes. Even if it was possible, it would be useless, because every instance X belongs to infinitely many classes: it belongs to the singleton class {X}, it belongs to every superclass of this singleton, and it belongs to the union of {X} with all the classes that are disjoint from {X}.
So the only option is to change the modelling pattern: to make TypeOfCheese a class, and to make Mozzarella, Parmesan, Fontina, Blue Cheese instances of this class. Then it is possible to restrict how many types of cheeses are used. To do so, you may proceed as follows:
create a property typeOfCheese that connects instances of CheeseTopping to instances of TypeOfCheese
create another propery usesTypeOfCheese that connects pizzas to types of cheeses
define a property chain axiom that says: hasTopping o typeOfCheese subPropertyOf usesTypeOfCheese
define FourCheesePizza as the subclass of usesTypeOfCheese exactly 4 TypeOfCheese
define the instances of TypeOfCheese: mozzarella, parmesan, fontina, blueCheese, cancoillotte, etc.
define MozzarellaTopping subClassOf typeOfCheese value mozzarella, ParmesanTopping subClassOf typeOfCheese value parmesan, etc.
We are using GraphDB 8.4.0 as a triple store for a large data integration project. We want to make use of the reasoning capabilities, and are trying to decide between using HORST (pD*) and OWL2-RL.
However, the literature describing these is quite dense. I think I understand that OWL2-RL is more "powerful", but I am unsure how so. Can anyone provide some examples of the differences between the two reasoners? What kinds of statements are inferred by OWL2-RL, but not HORST (and vice versa)?
Brill, inside there GraphDB there is a single rule engine, which supports different reasoning profiles, depending on the rule-set which was selected. The predefined rule-sets are part of the distribution - look at the PIE files in folder configs/rules. One can also take one of the existing profiles and tailor it to her needs (e.g. remove a rule, which is not necessary).
The fundamental difference between OWL2 RL and what we call OWL-Horst (pD*) is that OWL2RL pushes the limits of which OWL constructs can be supported using this type of entailment rules. OWL Horst is limited to RDFS (subClassOf, subSpropertyOf, domain and range) plus what was popular in the past as OWL Lite: sameAs, equivalentClass, equivalentProperty, SymmetricProperty, TransitiveProperty, inverseOf, FunctionalProperty, InverseFunctionalProperty. There is also partial support for: intersectionOf, someValuesFrom, hasValue, allValuesFrom.
What OWL 2 RL adds on top is support for AsymmetricProperty, IrreflexiveProperty, propertyChainAxiom, AllDisjointProperties, hasKey, unionOf, complementOf, oneOf, differentFrom, AllDisjointClasses and all the property cardinality primitives. It also adds more complete support for intersectionOf, someValuesFrom, hasValue, allValuesFrom. Be aware that there are limitations to the inference supported by OWL 2 RL for some of these properties, e.g. what type of inferences should or should not be done for specific class expressions (OWL restrictions). If you chose OWL 2 RL, check Tables 5-8 in the spec, https://www.w3.org/TR/owl2-profiles/#OWL_2_RL. GraphDB's owl-2-rl data set is fully compliant with it. GraphDB is the only major triplestore with full OWL 2 RL compliance - see the this table (https://www.w3.org/2001/sw/wiki/OWL/Implementations) it appears with its former name OWLIM.
My suggestion would be to go with OWL Horst for a large dataset, as reasoning with OWL 2 RL could be much slower. It depends on your ontology and data patterns, but as a rule of thumb you can expect loading/updates to be 2 times slower with OWL 2 RL, even if you don't use extensively its "expensive" primitives (e.g. property chains). See the difference between loading speeds with RDFS+ and OWL 2 RL benchmarked here: http://graphdb.ontotext.com/documentation/standard/benchmark.html
Finally, I would recommend you to use the "optimized" versions of the pre-defined rule-sets. These versions exclude some RDFS reasoning rules, which are not useful for most of the applications, but add substantial reasoning overheads, e.g. the one that infers that the subject, the predicate and the object of a statement are instances of rdfs:Resource
Id: rdf1_rdfs4a_4b
x a y
-------------------------------
x <rdf:type> <rdfs:Resource>
a <rdf:type> <rdfs:Resource>
y <rdf:type> <rdfs:Resource>
If you want to stay 100% compliant with the W3C spec, you should stay with the non-optimized versions.
If you need further assistance, please, write to support#ontotext.com
In addition to what Atanas (our CEO) wrote and your excellent example, http://graphdb.ontotext.com/documentation/enterprise/rules-optimisations.html provides some ideas how to optimize your rulesets to make them faster.
Two of the ideas are:
ptop:transitiveOver is faster than owl:TransitiveProperty: quadratic vs cubic complexity over the length of transitive chains
ptop:PropChain (a 2-place chain) is faster than general owl:propertyChainAxiom (n-place chain) because it doesn't need to unroll the rdf:List underlying the representation of owl:propertyChainAxiom.
Under some conditions you can translate the standard OWL constructs to these custom constructs, to have both standards compliance and faster speed:
use rule TransitiveUsingStep; if every TransitiveProperty p (eg skos:broaderTransitive) is defined over a step property s (eg skos:broader) and you don't insert p directly
if you use only 2-step owl:propertyChainAxiom then translate them to custom using the following rule, and infer using rule ptop_PropChain:
Id: ptop_PropChain_from_propertyChainAxiom
q <owl:propertyChainAxiom> l1
l1 <rdf:first> p1
l1 <rdf:rest> l2
l2 <rdf:first> p2
l2 <rdf:rest> <rdf:nil>
----------------------
t <ptop:premise1> p1
t <ptop:premise2> p2
t <ptop:conclusion> q
t <rdf:type> <ptop:PropChain>
http://rawgit2.com/VladimirAlexiev/my/master/pubs/extending-owl2/index.html describes further ideas for extended property constructs, and has illustrations.
Let us know if we can help further.
After thinking this for bit, I came up with a concrete example. The Oral Health and Disease Ontology (http://purl.obolibrary.org/obo/ohd.owl) contains three interrelated entities:
a restored tooth
a restored tooth surface that is part of the restored tooth
a tooth restoration procedure that creates the restored tooth surface (e.g., when you have a filling placed in your tooth)
The axioms that define these entities are (using pseudo Manchester syntax):
restored tooth equivalent to Tooth and has part some dental restoration material
restored tooth surface subclass of part of restored tooth
filling procedure has specified output some restored tooth surface
The has specified output relation is a subproperty of the has participant relation, and the has participant relation contains the property chain:
has_specified_input o 'is part of'
The reason for this property chain is for reasoner to infer that if a tooth surface participates in a procedure, then the whole tooth that the surface is part of participates in the procedure, and, furthermore, the patient that the tooth is part of also participates in the procedure (due to the transitivity of part of).
As a concrete example, let define some individuals (using pseudo rdf):
:patient#1 a :patient .
:tooth#1 a :tooth; :part-of :patient#1
:restored-occlusal#1 a :restored-occlusal-surface; :part-of tooth#1 .
:procedure#1 :has-specified-output :restored-occlusal#1 .
Suppose you want to query for all restored teeth:
select ?tooth where {?tooth a :restored-tooth}
RDFS-Plus reasoning will not find any restored teeth b/c it doesn't reason over equivalent classes. But, OWL-Horst and OWL2-RL will find such teeth.
Now, suppose you want to find all patients that underwent (i.e. participated in) a tooth restoration procedure:
select ?patient where {
?patient a patient: .
?proc a tooth_restoration_procedure:; has_participant: ?patient .
}
Again, RDFS-Plus will not find any patients, and neither will OWL-Horst b/c this inference requires reasoning over the has participant property chain. OWL2-RL is needed in order to make this inference.
I hope this example is helpful for the interested reader :).
I welcome comments to improve the example. Please keep any comments within the scope of trying to make the example clearer. Its purpose is to give insight into what these different levels of reasoning do and not to give advice about which reasoner is most appropriate.
I have a background in frame-based ontologies, in which classes represent concepts and there's no restriction against assertion of class:class relationships.
I am now working with an OWL2 ontology and trying to determine the best/recommended way to represent "canonical part-of" relationships - conceptually, these are relationships that are true, by definition, of the things represented by each class (i.e., all instances). The part-of relationship is transitive, and I want to take advantage of that so that I'd be able to query the ontology for "all parts of (a canonical) X".
For example, I might want to represent:
"engine" is a part of "car", and
"piston" is a part of "engine"
and then query transitively, using SPARQL, for parts of cars, getting back both engine and piston. Note that I want to be able to represent individual cars later (and be able to deduce their parts by reference to their rdf:type), and of course I want to be able to represent sub-classes of cars as well, so I can't model the above-described classes as individuals - they must be classes.
It seems that I have 3 options using OWL, none ideal. Is one of these recommended (or are any discouraged), and am I missing any?
OWL restriction axioms:
rdfs:subClassOf(engine, someValuesFrom(partOf, car))
rdfs:subClassOf(piston, someValuesFrom(partOf, engine))
The major drawback of the above is that there's no way in SPARQL to query transitively over the partOf relationship, since it's embedded in an OWL restriction. I would need some kind of generalized recursion feature in SPARQL - or I would need the following rule, which is not part of any standard OWL profile as far as I can tell:
antecedent (body):
subClassOf(B, (P some A) ^
subClassOf(C, (P some B) ^
transitiveProperty(P)
consequent (head):
subClassOf(C, (P some A))
OWL2 punning: I could effectively represent the partOf relationships on canonical instances of the classes, by asserting the object-property directly on the classes. I'm not sure that that'd work transparently with SPARQL though, since the partOf relationships would be asserted on instances (via punning) and any subClassOf relationships would be asserted on classes. So if I had, for example, a subclass six_cylinder_engine, the following SPARQL snippet would not bind six_cylinder_engine:
?part (rdfs:subClassOf*/partOf*)+ car
Annotation property: I could assert partOf as an annotation property on the classes, with values that are also classes. I think that would work (minus transitivity, but I could recover that easily enough with SPARQL paths as in the query above), but it seems like an abuse of the intended use of annotation properties.
I think you have performed a good analysis of the problem and the advantages/disadvantages of different approaches. I don't know if any one is discouraged or encouraged. IMHO this problem has not received sufficient attention, and is a bigger problem in some domains than others (I work in bio-ontologies which frequently use partonomies, and hence this is very important).
For 1, your rule is valid and justified by OWL semantics. There are other ways to implement this using OWL reasoners, as well as RDF-level reasoners. For example, using the ROBOT command line wrapper to the OWLAPI, you can run the reason command using an Expression Materializing Reasoner. E.g
robot reason --exclude-tautologies true --include-indirect true -r emr -i engine.owl -o engine-reasoned.owl
This will give you an axiom piston subClassOf partOf some car that can be queried using a non-transitive SPARQL query.
The --exclude-tautologies removes inferences to owl:Thing, and --include-indirect will include transitive inferences.
For your option 2, you have to be careful in that you may introduce incorrect inferences. For example, assume there are some engines without pistons, i.e. engine SubClassOf inverse(part_of) some piston does not hold. However, in your punned shadow world, this would be entailed. This may or may not be a problem depending on your use case.
A variant of your 2 is to introduce different mapping rules for layering OWL T-Tboxes onto RDF, such as described in my OWLStar proposal. With this proposal, existentials would be mapped to direct triples, but there is another mechanism (e.g. reification) to indicate the intended quantification. This allows writing rules that are both safe (no undesired inferences) and complete (for anything expressible in OWL-RL). Here there is no punning (under the alternative RDF to OWL interpretation). You can also use the exact same transitive SPARQL query you wrote to get the desired results.
I am trying to define two reverse object properties.
The object properties are :
hasChild
hasParent
As it's obvious if JOHN hasParent ANNA, then ANNA hasChild JOHN.
This seems to be accomplished by using Protege's InverseOf but then if we assume ANNA is Happy,
The below DL Query:
hasChild only Happy
returns JOHN too. The reasoner explains that hasChild is inverseOf hasParent.
Can someone help me clear things up? Thanks in advance!
hasChild only Happy is a universal restriction without accompanying existential restriction. Under Open World assumption, these universal restrictions end up including all individuals defined, because for all includes the cases where there is no filler for the property.
To verify if this is the case, create a named classe defined as hasChild only Happy and check which classes are equivalent to it. Most likely, you'll find owl:Thing in the results. therefore, all individuals will be answers to that query.
To avoid this, add hasChild some Happy to your query, so that there must be a filler before the inference can be drawn.
However, notice that you want the parent to be happy. Maybe you meant to reverse the direction and say hasParent only Happy?
While studying description logics (DL), it is very common to read that it is a fragment of first order logics (FOL), but it is hard to read something explicitely on what is excluded from DL which is part of FOL, which makes DL (with all its dialects ALC, SHOIN etc...) decidable.
Or in another words, could you provide me some examples in FOL which are not expressible
through DL (and which are the reason for semi/non-decidability in FOL) ?
The following facts about description logics are closely related to decidability:
(a form of) tree-model property — this property is important for tableu methods;
embeddability into multimodal systems — which are known to be "robustly decidable";
embeddability into the so-called guarded fragments of FOL — see below;
embeddability into two-variables FOL fragments — which are decidable;
locality — see below.
Some of these facts are syntactical, while some are semantical. Here below are two interesting, decidability-related, and more or less syntactical characteristics of description logics:
Locality (from The Description Logic Handbook, 2nd edition, section 3.6):
One of the main reasons why satisfiability and subsumption in many Description Logics are decidable – although highly complex – is that
most of the concept constructors can express only local properties
about an element 〈...〉 Intuitively, this implies that
a constraint regarding x will not “talk about” elements which are
arbitrarily far (w.r.t. role links) from x. This also means that in
ALC, and in many Description Logics, an assertion on an individual
cannot state properties about a whole structure satisfying it.
However, not every Description Logic satisfies locality.
Guarded fragment (from The Description Logic Handbook, 2nd edition, section 4.2.3)
Guarded fragments are obtained from first-order logic by allowing the
use of quantified variables only if these variables are guarded by
appropriate atoms before they are used in the body of a formula.
More precisely, quantifiers are restricted to appear only in the form
∃y(P(x,y) ∧ Φ(y))
or ∀y(P(x,y) ⊃ Φ(y))
(First Guarded Fragment)
∃y(P(x,y) ∧ Φ(x,y))
or ∀y(P(x,y) ⊃ Φ(x,y))
(Guarded Fragment)
for atoms P, vectors of variables x and y and (first) guarded fragment
formulae Φ with free variables in y and x (resp. in y).
From these points of view, analyze the examples from #JoshuaTaylor's comments:
∀x.(C(X) ↔ ∃y.(likes(x,y) ∧ ∃z.(likes(y,z) ∧ likes(z,x))))
∀x.(C(x) ↔ ∃z.(favoriteTeacher(x,z) ∧ firstGradeTeacherOf(x,z)))
The reasons why DL is preferred to FOL for knowledge representation are not only decidability or computational complexity related. Look at the slide called "FOL as Semantic Web Language?" in this lecture.
As shown by Turing and Church, FOL is undecidable, because there is no algorithm for deciding if a FOL formula is valid. Many description logics are decidable fragments of first-order logic, however, some description logics have more features than FOL, and many spatial, temporal, and fuzzy description logics are undecidable as well.