In the African Wildlife Ontology example in the paper Web Ontology Language: OWL, Grigoris Antoniou and Frank van Harmelen write the following code to represent the fact that branches are parts of trees and leaves parts of branches:
<owl:Class rdf:ID="branch">
<rdfs:comment>Branches are parts of trees </rdfs:comment>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#is-part-of"/>
<ow:allValuesFrom rdf:resource="#tree"/>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class>
<owl:Class rdf:ID="leaf">
<rdfs:comment>Leaves are parts of branches</rdfs:comment>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#is-part-of"/>
<owl:allValuesFrom rdf:resource="#branch"/>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class>
This says that every branch either does not participate as a predecessor to any is-part-of relation, or is the predecessor of one or more is-part-of relations, the successors of which are always trees. Similarly the second part says that every leaf either does not participate as a predecessor to any is-part-of relation, or is the predecessor of one or more is-part-of relations, the successors of which are always branches.
The problem is that they then write:
<owl:TransitiveProperty rdf:ID="is-part-of"/>
Obviously an is-part-of relation has to be transitive (after all if a finger is part of a hand and the hand is part of the body, then the finger is necessarily part of the body), but in our case it means that a leaf can also be part of a tree (by transitivity).
But transitivity contradicts the fact that in all is-part-of relations with a leaf as predecessors, successors are necessarily branches (and hence a leaf can never be part of a tree).
I can hardly imagine these people—who are among the founders of OWL—to do such a trivial mistake, so obviously there is something I'm missing, could you please tell me what?
PS. I opened the ontology with Protégé, when I define is-part-of as being transitive the reasoner says that the ontology is inconsistent, when I remove the transitivity property it becomes consistent again… I'm naïvely inclined to believe that there is an error in the Antoniou & van Harmelen code.
Related
What is the difference in OWL, between a
universal restriction : which restrict the relationships for a given property to individuals that are members of a specific class.
closure axiom : consists of a universal restriction that acts along the property to say that
it can only be filled by the specified fillers.
covering axiom
Both covering axiom and closure axiom are used for Closing Down the Open World assumption in OWL, however i do not really understand the difference between them...
A universal (someValuesFrom) axiom is a specific construct in the OWL specification, see the OWL primer
In contrast, the term “closure axiom” refers to a particular pattern of axiom usage, in which the goal is to “close doors” left open by the open world assumption. Universal restrictions can serve as closure axioms, but not every universal restriction is a closure axiom. Equivalence axioms combined with disjointness axioms can also serve this role. See the explanation in http://ontogenesis.knowledgeblog.org/1001/
A universal restriction (owl:allValuesFrom) such as hasTopping only MozzarellaTopping defines all individuals x that are associated via the hasTopping object property to only individuals y that are of type MozzarellaTopping and of no other type. A source of confusion is that this also includes all individuals x that are not linked via the hasTopping object property to a individual y at all.
A existential restriction (owl:someValuesFrom) such as hasTopping some MozzarellaTopping defines all individuals x that are associated via the hasTopping object property with at least 1 individual y that is of type MozzarellaTopping.
A closure axiom is a particular pattern of axiom use that forms part of the OnlySome design pattern/macro. An example is
hasTopping some MozzarellaTopping and
hasTopping some TomatoTopping and
hasTopping some PeperroniTopping and
hasTopping only (MozzarellaTopping or TomatoTopping or PepperonniTopping)
In this case
hasTopping only (MozzarellaTopping or TomatoTopping or PepperonniTopping)
is the closure axiom for the existential restrictions
hasTopping some MozzarellaTopping and
hasTopping some TomatoTopping and
hasTopping some PeperroniTopping
See this paper for more details on this.
I tried to use the same object property between multiple classes, but I got a warning that the same object property has been set multiple times as follows, can you please let me know what is wrong with that and how to solve it? Does this restrict reasoning later on (i.e. confuse the reasoner since the same object property is set multiple times)?
Thanks
Contrary to the comments it actually is very problematic to use the same object property between multiple classes.
What you don't see in your visualization is that in RDF/OWL, the starting point of your relation arrows is modelled as rdfs:domain and the target point of the arrows is modelled as rdfs:range.
The semantic of an OWL class is that it is a set of individuals and rdfs:domain and rdfs:range specify the domain, respectively range of a relation. That is, they specify the sets of allowed values in subject, respectively object position of a triple with that relation in the predicate position.
If you express your example in RDF Turtle it would look like this:
:hasPart rdfs:domain :ClassA, :ClassB;
rdfs:range :ClassB, :ClassC, :ClassD.
This causes multiple problems:
Intersection
The semantic of multiple domains, respectively ranges, is the intersection of those classes, not the union!
Even if we disregard the relation between :ClassB and :ClassD, this means :hasPart is only allowed by individuals that are instances of class C and class D at the same time!
For example, lets say class A is "car", class B is "tire" and class C is "motor". Now you want to say that a car can have tires and motors but what you actually specify is that a car can only have things that are a motor and a tire at the same time!
Unwanted but allowed usage
If you fix the first problem but specifying the union instead of the intersection, it will be very messy in serialized RDF because you need a large amount of triples to represent OWL restrictions such as unions. But even if you do that, you could now connect an instance of class A with an instance of class D, which is not allowed in the image.
Solution
The solution is simple, just separate those relations, for example into :hasB, :hasC and :hasD, although in a real scenario you can probably find a more suitable naming scheme, where the "has" prefix is often not used. For example, in DBpedia, the property for the country of a city is expressed using dbo:country, not dbo:hasCountry.
For example, I have three classes: Flock, Bird, Velocity. I also have two properties: hasMember (the domain is Flock, range is Bird), and hasAttribute (the domain is Bird, and the range is Velocity). Now I want to add a EquivalentClass restriction to Flock class as the definition. Let consider a very simple definition: in a flock, all birds have the same velocity. How to express this in OWL?
Warning: this answer is in fact incorrect, please look at the comments to see why.
To the question "Could we use owl:sameAs in an OWL restriction?" the answer is no, not in an OWL (2) ontology. However, you can do whatever you like in an OWL Full ontology (i.e., an RDF graph interpreted according to the OWL RDF-based semantics). Yet, this is irrelevant to the details of your question where you want to say something about the velocity of the birds in a flock.
There is a solution to your problem within the limits of OWL 2 DL. Introduce a property flockVelocity and make the property chain hasMember o hasAttribute a subproperty of flockVelocity. Make flockVelocity a functional property and you're done. Alternatively, you could define a cardinality restriction on flockVelocity. In Turtle:
:hasMember a owl:ObjectProperty;
rdfs:domain :Flock;
rdfs:range :Bird .
:hasAttribute a owl:ObjectProperty; # why not :hasVelocity?
rdfs:domain :Bird;
rdfs:range :Velocity .
:flockVelocity a owl:ObjectProperty, owl:FunctionalProperty;
owl:propertyChainAxiom (:hasMember :hasAttribute) .
Done. If you don't care about being in OWL DL and allow yourself total OWL Full freedom, you could use a blank node instead of :flockVelocity such that you don't have to introduce an artificial property name.
I have OWL ontology without individuals. Given two classes
Cs
and
Cd
How will the query look like an what type of reasoners can be used to find all the property chains such that:
(Cs subClassOf PropertyP exactly 1 Cd)
Where Cs is the domain of PropertyP and Cd is its range.
Chain means that this inference must be transitive, i.e. if
(Cs subClassOf PropertyP1 exactly one Ctemp) and (Ctemp subClassOf PropertyP2 exactly one Cd)
then, {PropertyP1, PropertyP2} must be considered a property chain between Cs and Cd.
Please note that I'm not talking about property chain such that one in OWL2, because in the case of OWL2, I have to define this chain previously, while in my case I cannot do so.
I have modelled the following in my Ontology:
Club employs some Player, Player hasNationality some Nationality, Player hasNationalStatus value National_Player, Country is equivalent to Nationality.
I want the Ontology to infer that:
If a Player hasNationality some Nationality and, Player hasNationalStatus value National_Player then, Country(Same as the nationality the player has) employs Player.
As an example:
{Steven_Gerrard} hasNationality value England and, {Steven_Gerrard} hasNationalStatus value National_Player therefore, {England} employs [Steven_Gerrard}.
Is there a possible way to add this knowledge to Protege?
Thanks.
Edit:
Error Messages:
Error 42 Logged at Tue Apr 01 20:49:24 BST 2014
OWLReasonerRuntimeException: Non-simple object property 'http://www.semanticweb.org/u1cjd/ontologies/2014/1/untitled-ontology-2#employs' is used as a simple one
and
Error 43 Logged at Tue Apr 01 20:49:24 BST 2014
ReasonerInternalException: tRole.cpp:243: assertion 'Ancestor.empty() && Descendant.empty()' fails
This is possible, and it's actually very similar to the technique I mentioned in an answer to your previous question, Adding statements of knowledge to an OWL Ontology in Protege), and the structure of this answer is almost identical to my answer to a recent answers.semanticweb.com question, OWL property inference from blank node - modelling.
You just need to use some rolification and a property chain axiom. The point to note is that the existing data has the form of the upper arrows, and the desired information is in the lower arrows.
It's not enough to give employs the subproperty hasNationality-1, because you want to ensure that the player has a particular national status. This is where you need rolification. You want employs to have a subproperty chain of hasNationality-1 • p, where p is a special property that only relates players with national status to themselves. You can do that with rolification. Just declare a new object property RNationalPlayers and assert the axioms
hasNationalStatus value National_Player EquivalentTo R_NationalPlayer some Self
inverse(hasNationality) o R_NationalPlayer subPropertyOf employs
In the description logic syntax, these would be something like:
=hasNationalStatus.National_Player ≡ ∃RNationalPlayer.Self
hasNationality-1 • RNationalPlayer ⊑ employs
This will work in some reasoners, but unfortunately, this does bring us out of OWL 2 DL and into OWL full. This was discussed in some detail in the comments on this answer. As the error message in the updated question indicates, employs is now a non-simple property, and used in a place where only simple properties should be used. See 11.1 Property Hierarchy and Simple Object Property Expressions for more about what makes a property simple or not, and 11.2 The Restrictions on the Axiom Closure for more about properties can appear where.
However, it sounds like you're using a reasoner that supports SWRL rules, in which case you could simply add the rule:
hasNationality(?player,?country) ∧ hasNationalStatus(?player,National_Player) → employs(?country,?player)