OWL limit individual to have only one type of ObjectProperty - owl

I have this:
[1]: https://i.stack.imgur.com/SGHD1.png
[2]: https://i.stack.imgur.com/7apGR.png
[3]: https://i.stack.imgur.com/hCSNU.png
And i want to force to every individual of class Machine to have only isInState relation

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.

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.

How make restriction on the data property to have a distinct value for individuals

I have a class Sensor, and each sensor hasID data property. Each sensor has a distinct ID# which cannot take by another sensor. In other word, two sensors cannot have a same ID#. How can I represent this?
You can create a HasKey axiom on Sensor specifying hasID as a property. HasKey is described in the OWL 2 specs.

Can an object have more than one literal value for a data property in OWL?

I designed an ontology model for a Smart House. A sensor attached to each object. In my ontology, I have a class Sensor. Each object in this class has an Id-number. For example, Cabinet is an individual of Sensor. I have several Cabinet with different Id-number in the Kitchen such as Cabinet hasID# 42, Cabinet hasID# 52. I am using protege, I define hasID as a data property and locatedIn as an object property. I want to know is it possible to have:
Cabinet locatedIn Kitchen
Cabinet hasID 42
Cabinet hasID 52
or should I change the hasID to an object property and define a class IdNumber?
You are approaching this the wrong way, I think. You do not have one Cabinet with several IDs, you have several different cabinets. In other words, you have two individuals, each of type Cabinet. One has id 42, the other has id 52.
In (pseudo) RDF triples:
:cabinet42 a :Cabinet ;
:locatedIn :kitchen ;
:hasID 42 .
:cabinet52 a :Cabinet ;
:locatedIn :kitchen ;
:hasID 52 .
So in Protege, you need to create two separate individuals, one for each cabinet, and then give each individual its own ID property.
As an aside, as you can see in the above RDF, it may not even be necessary to give them :hasID properties at all: they each already have their own unique identifier (namely their URIs: :cabinet42 and :cabinet52).

In OWL, is it possible to query a class that does not have a property?

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}
}

Resources