In protege a reflexive property is assigned to all individuals relgardless of domain and range and the class to which individuals belongs.
so what is the use of this restriction?
P.S: lets say there is three individuals:
NamedIndividual( :John )
NamedIndividual( :alex )
NamedIndividual( :BMW )
and an object proeprty:
ObjectProperty( :hasFriend )
ReflexiveObjectProperty(:hasFriend)
running pellet deduce that :
BMW hasFriend BMW
This inference is conceptually meaningless
Papers like The even more irresistible SROIQ and Foundations of Description Logics point out that reflexive and irreflexive properties are closely related to the exists r.Self concept. I.e. Narcissist can be defined as Narcissist \sqsubseteq loves.Self.
The SROIQ paper actually mentions that the main use cases for reflexive and irreflexive properties are limited and only make sense when used along with cardinality restrictions. I.e. if you define PopularPerson as someone with at least 2 friends, and hasFriend is reflexive, then by asserting an individual has 1 known friend will result in that individual being classified as a PopularPerson because the individual is already assumed to be its own friend.
Interestingly, the paper also mentions that reflexive(r) is equivalent to adding the GCI top \sqsubseteq exists r.Self to the TBox. Personally for me this is more intuitive and provides the control I think you seem to want to achieve. In particular this allows you to replace \top with whatever class of your choice. A similar equivalent exists for irreflexive properties.
Related
I'm using Protege 4.3 to create my first ontology, so I encountered a few problems
let's say we have the classes Person and Department and the properties employs and hasPart
So the problem is: I defined some classes like BigShopas Equivalent To employs min 6 Person and hasPart some Department but when I activate the reasoner I don't get the results I'm waiting for, I also tried SubClass Of with the same two restrictions but nothing happened
Any idea why?
I think I am going crazy! I have followed the various tutorials for Owl and Protege and still cannot figure out the answer. Use case is simple. I have defined a class called ‘Person’. I have defined a data property called hasFirstName. I have added a ‘subclass of’ restriction to Person like this : ‘hasFirstName exactly 1 string’. I have also added an individual called Alex of type Person, and have not added the hasFirstName property. I expect the reasoner to complain as I have specified the cardinality of 1, and asserted that Alex is a Person, but have not added the property value to Alex individual, yet the reasoner does not complain. If however I add two statements e.g. hasFirstName ‘Alex’ and hasFirstName ‘John’ then I get a complain. What I am doing wrong? Any help will be most appreciated, thanks.
There's no inconsistency in the first case. OWL makes the open world assumption, which means that something being unknown is different from it being known to be true or known to be false. Your username, at the time I'm writing this answer is user3552593. I'm relatively confident that you have a name, and that's not inconsistent with the fact that I don't know what it is yet.
By saying that
Person ⊑ =1 hasFirstName.String
and that
Alex : Person
you can infer that
Alex : =1 hasFirstName.String
There's nothing inconsistent with that; Alex, by virtue of Alex's personhood, has exactly one first name—we just don't know what it is yet.
How to represent a "part-of" SQL relationship in OWL ontology language?
For example:
CREATE TABLE DevelopmentTask (
DevelopmentTaskID INT,
SoftwareProjectID INT FOREIGN KEY REFERENCES SoftwareProject (SoftwareProjectID),PRIMARY KEY(DevelopmentTaskID, SoftwareProjectID))
In the above table the DevelopmentTask table is part of the SoftwareProject. How I can represent this in OWL, may be it can be represented using intersectionOf property in OWL.
Thanks,
You can simply introduce an ObjectProperty or a DataTypeProperty depending on what exactly you need to display. For example, I would introduce:
hasDevelopmentTask
And then add the following restriction:
SoftwareProject hasDevelopmentTask some DevelopmentTask
The "some" restriction also depends on your relation. If it is 1-n this relation holds, otherwise replace it with "min", "max", "exactly", or "only".
Also, since your example contains IDs, I would add them as instances or individuals of either SoftwareProject or DevelopmentTask. In this case, every instance of SoftwareProject will have "some" DevelopmentTask.
As another answer mentioned, you can simply create a property hasDevelopmentTask, or something similar. If you are going to make things a bit more complex in the future (e.g., if a software project has a development task, and a development task a (sub-)development task…) you might want to take a look at the W3C Working Draft, Simple part-whole relations in OWL Ontologies.
First, some theory
OWL doesn't provide built-in primitives for defining part-whole relations (as explained in the W3C Working Draft).
However, you can represent part-of (and any other non is-a) relations using OWL's objectProperties and their restrictions.
So, in your case you want to define the concept DevelopmentTask as part of the concept SoftwareProject.
In this case, you need to:
create an owl:Class for each concept (2 classes in this example).
create an owl:ObjectProperty to represent the relation partOf and its restrictions.
extend the part class to be a subClassOf of a restriction over values from the whole class on that property.
Second, the RDF/XML syntax
So to express that as an OWL ontology in RDF/XML syntax, the final layout would look like this:
<owl:Class rdf:about="SoftwareProject"/>
<owl:ObjectProperty rdf:about="partOf"/>
<owl:Class rdf:about="DevelopmentTask">
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="partOf"/>
<owl:someValuesFrom rdf:resource="SoftwareProject"/>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class>
In OWL, is it possible to query a class that does not have a property?
Suppose I have an object property R and I want to retrieve all classes that do not have the property R. Also, suppose that I have already closed all classes with closures.
I was trying this:
suppose the propety in question is hasProperty, my query was this
hasProperty only Nothing
But it doesn't work
What do you mean by "class that does not have a property"?
Semantically, a class is a set of individuals and a property is a set of pairs of individuals. Given these two sets, what do you mean by "class has / has not a property"?
Regarding your example query
hasProperty only Nothing
lets rewrite it a bit so that we can think about it in natural language. This gives better intuition about the meaning of this query.
First lets rename hasProperty to follows (or whatever English verb), then we have:
follows only Nothing
This is semantically equivalent to
follows only (not Thing)
which is semantically equivalent to
not (follows some Thing)
Now we have gotten rid of the only which is a confusing part of OWL and is better avoided. So now we can verbalize the query in English as:
those who do not follow anything
or
who does not follow anything?
or more formally
which individuals of the ontology are known
not to have a follow relationship to any other individual
E.g. if your ontology states that
John does not follow Mary.
John does not follow himself.
Every individual in the ontology is either John or is Mary.
then John will be the answer to the above query.
You can also get a named class as the query answer if the asked restriction holds for a (named) group of individuals. In any case, the following must hold: if you asserted that the answer (or a member of it) does have a follow-relation to some individual then it would render the ontology inconsistent.
OWL does not have any means for querying the data. SPARQL is used for that. So the SPARQL query to find all class definitions that do not have the property :R would be:
SELECT ?cls
WHERE {
?cls a owl:Class .
FILTER NOT EXISTS {?cls :R ?o}
}
What is the difference between EquivalentClass and SubClass of? While reading through OWL primer, i find the tutorial uses SubClassOf a lot to declare a new class, as follows
SubClassOf(
:Teenager
DataSomeValuesFrom( :hasAge
DatatypeRestriction( xsd:integer
xsd:minExclusive "12"^^xsd:integer
xsd:maxInclusive "19"^^xsd:integer
)
)
)
Can I write
EquivalentClass(
:Teenager
DataSomeValuesFrom( :hasAge
DatatypeRestriction( xsd:integer
xsd:minExclusive "12"^^xsd:integer
xsd:maxInclusive "19"^^xsd:integer
)
)
)
instead?
When stating that A is a subclass of B, this restricts A to necessarily inherit all characteristics of B, but not the other way around. In your example, A = Teenager, and B = hasAge [12:19] (my own notation, but you get the idea).
This means that any instance of Teenager in the OWL ontology must necessarily also have the property hasAge with a value in the range [12:19], but not the other way around. Specifically, this does not mean that any instance of something with the property hasAge with a value in the range [12:19] is also an instance of Teenager. To make this clear, consider an instance (called c) of class Car. We might also say that:
c . hasAge 13
This says that instance c of Car is 13 years old. However, with the subclass axiom defining Teenager above, a reasoner would not infer that c is also an instance of Teenager (perhaps as we'd want, if teenagers are people, not cars).
The difference when using equivalence is that the subclass relationship is implied to go in both directions. So, if we were to instead include the second axiom that defined Teenager to be equivalent to anything with the property hasAge with a value in the range [12:19], then a reasoner would infer that the car c is also an instance of Teenager.
Equivalent classes might have the same members, e.g.,
:USPresident owl:equivalentClass :USCommanderInChief
will both have the same individuals (all or some of the US presidents). So if we assert that John Adams was a USCommanderInChief it can be inferred that John Adams was also a US President.
With subclass, we're indicating a hierarchy. e.g., GrannySmithApple is a type of Apple.
:USPresident owl:equivalentClass :USCommanderInChief .
is the same as
:USPresident rdfs:subClassOf :USCommanderInChief ;
:USCommanderInChief rdfs:subClassOf :USPresident .