OWL: scoped domain and range - owl

What is the difference between scoped domain and domain? Also scoped range and range. And how is it defined in Protege for a single property to have two different scoped domains or scoped ranges?
P.S. I mean using two different scoped domain means:
R has range B if domain is A
R has range D if domain is C

The fact that the domain of the object property R is A could be written in this way:
R some owl:Thing SubClassOf A
The fact that the range of the object property R is B could be written in this way:
owl:Thing SubClassOf R only B
One can generalize these records slightly.
The domain of R scoped with / by B is A:
R some B SubClassOf A
The range of R scoped with / by A is B:
A SubClassOf R only B
In Protégé, one can type these axioms in these places (pressing the ⊕ button as many times as one wishes):
Active Ontology > General Class Axioms > General Class Axioms, or
Entities > Classes > [Class] > Description > General Class Axioms.
Also, the OWLAx plugin can generate both scoped and non-scoped axioms.
In DL terms, scoped domain and range axioms are:
∃R.B ⊑ A instead of ∃R.⊤ ⊑ A,
A ⊑ ∀R.B instead of ⊤ ⊑ ∀R.B.
In SWRL terms:
B(?y) ^ R(?x,?y) -> A(?x) instead of R(?x,?y) -> A(?x),
A(?x) ^ R(?x,?y) -> B(?y) instead of R(?x,?y) -> B(?y).

Related

How to make reasoning of classes with property chain

I have an OWL2 ontology combining technological processes and numerical models. I need to find out, which process might be modeled with which model. I introduced Requirements, that areFulfilled by Process while Models hasRequirements. I am able to do it with individuals, but not classes.
I am using Protege 5.1, Fact++ reasoner.
Classes:
Processes
Proc1 EquivalentTo: Processes and (fulfillRestriction exactly 1 Req1)
Requirements
Req1 Equivalent to Requirements and (hasTemperature exactly 1 (temperature only xsd:double[ "5.0"^^xsd:double , <= "150.0"^^xsd:double])
Models
Model1 EquivalentTo: Models and (hasRestriction exactly 1 Req1)
Now I have an object property:
ObjectProperty: testIsModelOf
SubPropertyChain: hasRestriction o inverse (fulfillRestriction)
I defined individuals:
Individual: mod1
Types: Model1
Facts: hasRestriction requir1
Individual: requir1
Types: Req1
Individual: process1
Types:
Proc1
Facts: fulfillRestriction requir1
Asking for (with DLQuery):
Models that testIsModelOf some Proc1
If I define individuals for those three classes and define object properties between them, the result is as expected (DLQuery says mod1 is an instance of Models that testIsModelOf some Proc1). I expected that I will also get the Model1 class as a Direct Subclass (or equivalent class?) of the query result, but it does not happen. Is this possible to get the class, not only individual - without SWRL?

Query for intersection of dispositions; Protege

I want to identify when an object contains the intersection of two properties, as opposed to either property.
Example:
object:
A (has_disposition some disposition_A; has_disposition some disposition_B)
B (has_disposition some disposition_B; disjoint with A)
disposition:
disposition_A
disposition_B
disposition_AB (EquivalentTo: disposition and ((disposition_A) and (disposition_B))
The object property has_disposition takes object as its domain and disposition as its range.
The following DL Query in Protege using HermiT produces nothing:
has_disposition some disposition_AB
The following queries give the correct answer:
has_disposition some disposition_A (gives A)
has_disposition some disposition_B (gives A, B)
The following actions did not help:
Changing parentheses in the EquivalentTo expression.
Declaring nothing disjoint.
Declaring each part of the EquivalentTo expression separately.
I was unable to find examples of a disposition being defined as the intersection of other dispositions in OGMS, the Infectious Disease Ontology, or the Cardiovascular Disease Ontology.
No results for disposition_AB means the equivalent axiom cannot be matched against the individuals you have.
I'm not clear on where the disposition type would come from for A and B - I suspect that's not being inferred as you expect.

Class query not detecting the corresponding instances in Protégé OWL

I have MultiPetsOwner class in my ontology, and with the current set up I expect 2 Instances to be detected for it (Harry and Alex).
But when I run the DL Query "hasPet min 2 Animal" for it, there are no corresponding instances.
At the same time, the DL Query "hasPet some Animal" seems to work - it gives me the PetOwner class instances I expected.
What am I doing wrong? If the "hasPet min 2 Animal" query is incorrect, what should I use instead to get all the MultiPetsOwners?
The contents of my .owl file can be found here: http://pastebin.com/5xcriLRE
In OWL there is no Unique Names Assumption (UNA), which means two individuals with a different URI are not necessarily different from each other. This means, a standard OWL reasoner, which is what's used for DL queries can't answer your query without having the information in your ontology that e.g. two animals a and b are not the same individuals (via owl:differentFrom):
Your ontology:
hasPet(x, a), Animal(a)
hasPet(x, b), Animal(b)
-> Q: hasPet min 2 Animal?
-> A: NO RESULT
With the additional OWL axiom
hasPet(x, a), Animal(a)
hasPet(x, b), Animal(b)
a ≠ b
-> Q: hasPet min 2 Animal?
-> A: x
Alternative way: Use SPARQL as query language
SELECT ?x WHERE {
?x :hasPet ?pet .
?pet a :Animal
} GROUP BY ?x
HAVING(COUNT(?pet) >= 2)
Note, this query might probably not take needed inferences into account.
OWL is working in Open World Assumption. In your case, that means than it is not assumed the individuals are different. You have to assert it explicitly. In Protégé, this is done when all individuals are selected, in your case all animals, and then Edit -> "Make all individuals different".
If you run the hasPet min 2 Animal it will give you the expected results, but you can see them already after running the reasoner in the inferred instances of the class MultiPetsOwner.

Defining a class individuals as a combination of another class individuals

In an OWL ontology, given a class Student; I want to define another class StudentsPair, which is any pair of students, in such a way that automatically computes all the possible dual combinations of Student, i.e.
Student(x) and Student (y) --> StudentsPair(x,y)
I want StudentsPair as a class, not a property, because it may have additional features (such as averagePerformanceForPair, etc.).
For example,
Premise
Student(John)
Student(Alex)
Student(Mary)
-----------------
Conclusion
StudentPair((John, Alex))
StudentPair((John, Mary))
StudentPair((Alex, Mary))
The reasoner has to somehow create these new individuals! Is this possible?
You need an additional role student, then you can use Description Logic Rules, something like that might work:
Student ≡ ∃student.Self
student ◦ U ◦ student ⊑ StudentPair

OWL's EquivalentClass vs. SubClassOf

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 .

Resources