OWL:Difference between object property function on individual vs class - owl

Lets say an ontology is defined as:
classA:
rel1 some classB
classB
-------------------
individual_1 rel1 individual_2
individual_2
-------------------
objectProperty: rel1
rel1 domain :classA
rel1 range: classB
rel1 inverse of rel2
objectProperty: rel2
Pellet deduce individual2 rel2 individual2 -that is OK, but does not deduce classB rel2 some classA.
why deducing between individual and class is different?
Also reasoner does not say anything about domain and range of rel2.
(I expect to declare classB as domain and classA as range of rel2)

Related

How do I use Manchester Syntax in WebProtege to group only some individuals from from a different class based on individual name

I would like to create a new class PossibleNoduleFinding, grouping some individuals from another class Finding based on the individual name. Finding has a relationship hasFinding with each individual. Example maybe individual name nodule.
I'm trying:
Class: PossibleNodueFinding
Annotations: [in root-ontology]
rdfs:label "PossibleNoduleFinding"#en
SubClassOf: [in root-ontology]
SoftwareMapping
EquivalentTo: (Finding and hasFinding value nodule),
EquivalentTo: (Finding and hasFinding value density)
The Owl editor is not recognizing this syntax.

OWL/Protege: Model inferred class of persons, who are not members of a group

I try to create an ontology in OWL, using Protégé 5.5.0. No I have a little trouble with inferred classes.
I have three classes: Agents and as subclasses Groups and Persons. Persons can be members of Groups. Now I want to create two inferred classes: a) "Members of groups" and b) "Not members of groups" (both as subclasses of Person)
I was successful with a), using the axiom equivalent class: Person and member_of some Group.
I created one individual, which is a person and member of a group and it was inferred to be member of the class "Members of groups".
Now I'm stuck with b). I tried several options for the equivalent class, for example:
Person and member_of max 0 Group
Or: Person and member_of exactly 0 Group
Or: Person and not member_of some Group
I created an individual which is a person but no groupmember. But the reasoner does not agree with me about the fact, that this individual should belong to the inferred class "Not members of groups".
What did I do wrong?
One way to achieve this in OWL, using your Person and not member_of some Group,
is to define a MemberOfGroup class that is defined as you suggested. Then define a NotMemberOfGroup class, that is disjoint with the MemberOfGroup class. If you now define your individual to be of type Person, as well as of type not member_of some Group, then your individual will be classified as belonging to the NotMemberOfGroup class.
The reason why you have to do this, is that OWL uses the open world assumption and hence it can only make inferences about things it knows for sure. I.e. saying that the individual is a Person, while making no statement regarding member_of provides the reasoner with zero explicit info to determine that the individual either belongs or does not to a group.
The other option is to use SHACL/SHEX/SPIN.

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?

How to find overlapping classes?

Full ontology:
Prefix: : <http://www.semanticweb.org/l.smolaga/ontologies/2018/0/untitled-ontology-14#>
Prefix: xsd: <http://www.w3.org/2001/XMLSchema#>
Ontology: <http://www.semanticweb.org/l.smolaga/ontologies/2018/0/untitled-ontology-14>
Datatype: xsd:int
DataProperty: hasAge
Characteristics:
Functional
Domain:
Person
Range:
xsd:int
Class: Person
Class: Student
EquivalentTo:
Person
and (hasAge some xsd:int[>= "18"^^xsd:int , <= "26"^^xsd:int])
Class: Teenager
EquivalentTo:
Person
and (hasAge some xsd:int[>= "11"^^xsd:int , <= "19"^^xsd:int])
I'm trying to find a way to check if two classes overlap.
For example let's consider we have an ontology with 3 classes (Person, Teenager and Student).
Teenager is equivalent to Person and hasAge some xsd:int[>= 11, <=19 ]
Student is equivalent to Person and hasAge some xsd:int[>= 18, <=26 ]
I want to check which class overlaps with Student. How I can do this using owlapi/jena ?
The easiest way will be to create an individual, say x, which is of type (Person and Student and Teenager). Invoke the reasoner and if your ontology is consistent, it means it is possible for an individual to belong to all classes. If the ontology is inconsistent, it means an individual cannot belong to all the classes simultaneously.
You should be able to do this in an ontology editor, or programmatically via the owl-api or jena.

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