Protege Merging Individuals - semantic-web

I have created an ontology. There is a temperature sensor class and humidity sensor class. the can have sensor values.
Now I want to define a class where if the temperature sensor has value less than 25 and humidity sensor has value less than 20 then it will define a normal state. I m not sure should I define a class or something else. In the result I want that when a temperature sensor's and a humidity sensor's value is less than defined rule I can call them as a member of normal state. but any of the sensor violate the rule neither sensor will be the member of that class

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema#
PREFIX temp: http://www.sensor.com/Temper#
select *
{
?a temp:value ?c
}
if(value>25 "NORMAL", "NON-NORMAL")

Related

Protege OWL Calculate the sum of a property of the children of a class

in my ontology i got a Recipe-Class which got multiple "children", which are of the class Food. Those foods have Nutritions (protein, carbs, fats...).
Recipe->Food->Nutrition->NutritionAmount
Is it possible to calculate the sum of the proteins of Recipe x with reasoning rules? With Sparql its working well.

Adding qualifier to objectProperty in OWL

I want to express the following in an OWL ontology in Protege: IndividualA is composed of IndividualB1 at X %, IndividualB2 at Y % and so on, up until 100%.
Does a pattern exists to model this?
I want to express the following in an OWL ontology in Protege:
IndividualA is composed of IndividualB1 at X %, IndividualB2 at Y %
and so on, up until 100%.
Does a pattern exists to model this?
I don't think you'll be able to get the guarantee/restriction on sums that you're looking for in OWL. But part of the structure that you're talking about is just an n-ary relationship. Instead of a two place relationship
isComposedOf(IndividualA, IndividualB1)
you have a three place relationship:
isComposedOfByPercent(IndividualA, IndividualB1, 0.34)
There are lots of ways to represent n-ary relationships using semantic technologies, so many so that the W3C published a working note, Defining N-ary Relations on the Semantic Web. In OWL, one of the most common approaches might be:
x a Composition ;
hasComposite IndividualA ;
hasComponent IndividualB1 ;
hasPercentage 0.34 .
Another might be:
IndividualA hasCompositePart y .
y a CompositePart ;
hasComponent IndividualB1 ;
hasPercentage 0.34 .

Is it possible to represent Sufficient Condition relation in OWL?

Related questions Necessary and sufficient conditions for inferring a property, Representing if-then sentence using OW
Base on my understanding of owl:equivelantClass and rdfs:subClassOf we can represent Necessary Condition and Necessary and Sufficient Condition using subClassOf relation (one directional subClassOf or bi-direction subClassOf which is equivalentClass).
If we want to represent condition N is Necessary Condition of S (IF S THEN N), we can model this in following:
S rdf:type owl:Class;
rdfs:subClassOf [
rdf:type rdf:Restriction;
owl:onProperty :N;
owl:hasValue :D
].
or just say:
S rdfs:subClassOf N.
If we want to represent condition N is Necessary and Sufficient Condition of S (N IIF S), we can model this in following:
N rdf:type owl:Class;
owl:equivalentClass [
rdf:type rdf:Restriction;
owl:onProperty :S;
owl:hasValue :D
].
or just say:
N owl:equivalentClass S.
My question is can we represent sufficient condition using OWL? I'm thinking maybe I can represent the Sufficient Condition by reverse the order of Restriction Class and A.
Edit
According to the definition of Necessary and Sufficient condition, the assertion of N is Necessary for S is equivalent to S is Sufficient to N, we can understand this as N is super-set of S or S is subset of N.
Base on the accepted answer, we can model this relationship as S rdfs:subClassOf N or define a superClassOf property:
:superClassOf owl:inverseOf rdfs:subClassOf
and assert N :superClassOf S.
Conclusion
So the answer is yes, we can represent Sufficient condition by reverse the order (define a inverse property of rdfs:subClassOf) of Necessary condition.
Conditions, of course, refers to "conditions on an individual for class membership", and are expressed in terms of defining ever-smaller (more restricted) subclasses of the overall "class of all things".
In that context, a sufficient condition is simply the inverse of a necessary condition. So in effect, every time you specify a necessary condition, you also specify a sufficient condition.
Let's spell that out.
A necessary condition on a class X is the following: "IF the individual i is an instance of the class X, THEN the condition must be true". subClassOf(X, Y) means that IF an i is of class X, THEN it must also be of class Y, so in other words if we want to say that i is in X, it's necessary that it is also in Y. But it's not sufficient for i to be in Y to conclude that it is in X.
A necessary and sufficient condition on class X is a condition where in addition it also holds that "IF the condition is true, THEN the individual must be an instance of the class". In other words "if i is in class Y, this is sufficient evidence that it is also in X". This is the equivalence relation, which specifies that the sets of individuals of two classes are exactly the same (so if i is in Y, it must be also in X, vice versa).
A condition on X that is only sufficient, but not necessary, would mean that you have some relation R(X,Y) for which it holds that IF an indivual is in Y, it is also in X, but not necessarily that IF it is in X, THEN it is also in Y. This is the superclass relation, in other words the inverse of the subclass relation.
So when you say subClassOf(X, Y) you have not only defined a necessary condition for X, but effectively also a sufficient condition for Y. After all, if we know an individual i is an instance of X, then that is sufficient to conclude it's also an instance of Y. But it's not necessary for i to be an instance of X to also be an instance of Y: there can be instances of Y that are not in X.
In OWL there is no explicit separate owl:superClassOf relation. However if you really wanted to express it in those terms, you could conceivably introduce a superClass relation yourself, simply be defining it as the owl:inverseOf the subClassOf relation.

DL QUERY : Pizza Ontology : Is there a way to get the toppings ON the pizza? [duplicate]

I'm using Protege v4.3 for making ontologies.
I have a question about OWL ontology and DL query.
For instance, in the Pizza ontology,
http://owl.cs.manchester.ac.uk/co-ode-files/ontologies/pizza.owl
I can execute the DL query
hasTopping some CheeseTopping
The result is
American, AmericanHot, Cajun,.. etc. That's OK.
Now, i tried DL query
isToppingOf some American
But the result is nothing.
Because the property isToppingOf is inverse property of hasTopping,
I expected to get the result including FourCheesesTopping, CheeseyVegetableTopping, etc. from that query(by inference). Bud it didn't.
Is there any ways automatic reasoning like that?
The class expression
hasTopping some CheeseTopping
is the set of individuals each of which is related to some CheeseTopping by the hasTopping property. In the Pizza ontology, where there are no individuals, you can still get class subclass results for this query because the definition of certain types of Pizzas (e.g., American) are such that any Pizza that is an American must have such a topping.
Now, the similarly-structured query
isToppingOf some American
is the set of individuals each of which is related to some American pizza by the isToppingOf property. However, the Pizza ontology defines no particular individuals, so there aren't any individuals as candidates. But what about classes that might be subclasses of this expression? For instance, you mentioned the FourCheeseTopping. Now, some particular instance of FourCheeseTopping, e.g., fourCheeseTopping23 could be a topping of some American pizza, e.g.:
fourCheeseTopping23 isToppingOf americanPizza72
However, fourCheeseTopping might not have been placed on any particular pizza yet. When we choose an arbitrary individual of type FourCheeseTopping, we can't infer that it is a topping of some American pizza, so we cannot infer that the class FourCheeseTopping is a subclass of
isToppingOf some American
because it's not the case that every instance of FourCheeseTopping must be the topping of some American pizza. For a similar case that might make the logical structure a bit clearer, consider the classes Employer and Person, and the object property employs and its inverse employedBy. We might say that every Employer must have some Person as an Employee (since otherwise they wouldn't be an employer):
Employer &sqsubseteq; employs some Person
However, since a person can be unemployed, it is not true that
Person &sqsubseteq; employedBy some Employer
even though employs and employedBy are inverses.
What you can do, though, if you want to know whether toppings of a particular type could be placed an pizza of a particular type, is to ask whether
PizzaType &sqcap; ∃hasTopping.ToppingType
is equivalent to, or a subclass of, owl:Nothing. For instance, since an American pizza has only toppings of type TomatoTopping, MozzarellaTopping, and PeperoniTopping [sic], the class
American &sqcap; ∃hasTopping.MixedSeafoodTopping
is equivalent to owl:Nothing:
On the other hand, since an American pizza must have a MozzarellaTopping, the class
American &sqcap; ∃hasTopping.MozzarellaTopping
is equivalent to American:
When you ask what are the subclasses of:
isToppingOf some American
you are asking what classes contain toppings that are necessarily used on top of American pizzas. But in the pizza ontology, no such class exists. Consider cheese toppings: Are all cheese toppings on top of some American pizzas? No, some cheese toppings are on top of Italian pizzas. The same holds for all topping classes.

Difference between accuracy with location

When setting the location , we would like to get the best battery performance, and the least accuracy( but not using the "significant change" )
When setting the manager i do :
self.locationManager.desiredAccuracy =kCLLocationAccuracyThreeKilometers;
Whats the different between :
kCLLocationAccuracyThreeKilometers
kCLLocationAccuracyKilometer
and the rest of them .
as far as i see, even when the device is on the table, both gives me background locations in same frequency, that is every few seconds .
According to Docs
kCLLocationAccuracyThreeKilometers
Accurate to the nearest three kilometers.
kCLLocationAccuracyKilometer
Accurate to the nearest kilometer
Note : It never says about the updating frequency it is the accuracy parameter depending on the range