Could someone please provide examples of what kind (if any) dependecies between Data Properties we can declare in Protege?
Basically what I am trying to do is to declare simple rules, that e.g one Data Property (year) can or can not be before the other one ( like Birth Year <= Death Year). Is that possible to be done using Data Properties?
The only dependencies that can be expressed between DataProperties are subproperty and disjointness properties. SWRLTab in Protege can be used to express rules. Assuming the following ontology:
ObjectProperty: hasDeathCertificate
Domain: Person
Range: DeathCertificate
DataProperty: dateOfBirth
Domain: Person
Range: xsd:dateTime
DataProperty: dateOfDeath
Domain: DeathCertificate
Range: xsd:dateTime
Class: DeathCertificate
Class: Person
the following SWRL rule can be specified to ensure that the date of death on a DeathCertificate is after the date birth of the person.
Person(?p)^dateOfBirth(?p, ?birth)^DeathCertificate(?d)^dateOfDeath(?p, ?death)
^swrlb:greaterThan(?death, ?birth)->hasDeathCertificate(?p, ?d)
Good luck!
Related
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.
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.
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.
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?
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}
}