Protege unexpected behavior with owl max restriction - max

I am creating an ontology in Protégé modelling desserts. There are two main base classes Dessert and Ingredient and a hasIngredient property to connect them. An example of a dessert looks as follows;
NeapolitanIceCream subclass of Dessert
hasIngredient exactly 1 IceCream
hasIngredient exactly 1 wafers
hasIngredient only (IceCream or Wafers)
And I have 2 primitive classes SimpleDessert and ComplexDessert
SimpleDessert subclass of Dessert and (hasIngredient max 3 Ingredient)
ComplexDessert subclass of Dessert and (hasIngredient min 5 Ingredient)
SimpleDessert(min) performs as expected but ComplexDessert(max) has no subclasses when I run the reasoner. My understanding of the Open World Principle thought that the exactly 1 clauses and the only clause make it clear that there are only these two possible ingredients and the quantity is clear.
I'm probably missing something obvious but would love any help here.

This axiom may not mean what you want it to mean:
SimpleDessert subclass of Dessert and (hasIngredient max 3 Ingredient)
This says that "if something is a SimpleDessert, then it is a Dessert and has at most three ingredients. It does not say that "if something is a Dessert and has at most three ingredients, then it is a SimpleDessert."
I you want to say the latter, then you need the subclass axiom in the other direction:
Dessert ⊓ ≤3 hasIngredent.Ingredient ⊑ SimpleDessert
In Protege, you do that using the General Axioms tab. (See my answer to owl protege how can I describe a class that has just some properties? for an example and screenshots.)

Related

In OWL, is it possible to assert that a class is not "empty"?

Given the different types of axioms available in OWL, is it possible to assert that a class is not "empty"? Or in other words, can we assert that there exists at least one individual that is part of the specified class?
So, basically I am looking for an equivalence of:
ObjectAssertNotEmpty(a:SomeClass)
In an RDF serialization, all it takes is to identify such an individual:
[] a a:SomeClass .
I presume the OWL syntax should be able to specify it this way:
ClassAssertion( a:SomeClass a:SomeIndividual )
It doesn't matter that you call the individual a:SomeIndividual here, it could very well be owl:sameAs any other individual. Once you state that something is in the class, it follows that the class is not empty.
That is exactly what the model theoretic underpinning of Description Logics aim to do is to assume that all concepts (or OWL classes) are not empty. When a reasoner is run over an ontology, it will give an error if a class is found to be empty. Such a class is deemed to be unsatisfiable. That is the basis of satisfiability checking (and consistency checking, since satisfiability checking can be translated to consistency checking).
See An introduction to Description Logics text for details.
Here is a simple example ontology to illustrate this:
Class: A
Class: NotA
EquivalentTo: not (A)
Class: B
EquivalentTo: A and NotA
Individual: b
Types: B
Note that class B will be equivalent to owl:Nothing which is the empty set. Now setting individual b to be an instance of B will lead to an inconsistency with explanation as shown below.
The answer as given by #IS4 will only work if SomeClass is found to be satisfiable (that is not empty), otherwise the reasoner will give an inconsistency.

what is the differenc between these two "statments" in desciption logic

I don't know if you call this statement or not, but I have this question
what is the difference between these two statments :
A ⊑ B ⊓ C
and
A ASSERTA_SYMBOL = B ⊓ C
sorry I don't know how to write the ASSERTA_SYMBOL, but it is in this image
a real example is this:
Both expressions describe or define a concept (or class or set).
The difference is subclass vs equivalent class.
An elephant is one kind of grey, large animals. There might be other kinds.
A happy father is a man who has at least one daughter and any man with at least one daughter is a happy father. There are no others.
⊑ represents a subconcept relationship, ≐ means agreement (sometimes called the same as constructor).

Describe a film (entity and attribute) using the first order logic

Good morning,
I want to understand how can I describe something using the first order logic.
For example I want to describe what is a film (an entity) and what is an attribute (for example actor: Clooney) for the film. How can I describe that using the first order logic?
******* UPDATE ********
What I need to explain in first logic order is:
ENTITY: an element, an abstraction or an object that can be described with a set of properties or attributes. So I think that I must says that the entity has got a set of attributes with their respective values. An Entity describes an element, an abstraction or an object.
ATTRIBUTE: an attribute has always got a value and it always associated to an entity. It describes a specific feature/property of the entity.
DOCUMENT: a pure text description (pure text it not contains any html tags). Every document describes only ONE entity through its attribute.
To state that an object has a certain property you would use a single place predicate. For example, to state that x is a film you could write Film(x). If you want to attribute some value to an object you can use two (or more) place predicate. Using your example you could say that Clooney starred in a film as Starred(clooney, x).
There are certain conventions that people use. For example, predicates start with capital letters (Actor, Film, FatherOf) and constants start with a lower case letter (x, clooney, batman). Constants denote objects and predicates say something about the objects. In case of predicates with more than one argument the first argument is usually the subject about which you are making the statement. That way you can naturally read the logical formula as a sentence in normal language. For example, FatherOf(x, y) would read as "x is the father of y".
Answer for the update:
I am not sure whether you can do that in first order logic. You could describe an Entity as something that has certain properties by formula such as
\forall x (Entity(x) ==> Object(x) | Element(x) | Abstraction(x))
This is a bit more difficult for the Attribute. In first order logic an attribute ascribes some quality to an object or relates it to another object. You could probably use a three place predicate as in:
\forall attribute (\exists object (\exists value (Has(object, attribute, value))))
As to the document, that would be just a conjunction of such statements. For example, the description of George Clooney could be the following:
Entity(clooney) & Has(clooney, starred, gravity) & Has(clooney, bornIn, lexington) & ...
The typical way to do this is to explain that a specific object exists and this object has certain attributes. For example:
(∃x)(property1(x) & property2(x) & ~property3(x))
aka: There exists a thing that satisfies properties 1 and 2 but does not satisfy property 3.
Your current question formulation makes it unclear as to what you mean by attributes and documents. Perhaps towards your idea of attributes: it's possible to describe as the domain of property1 all the entities that satisfy it; so, for example, the domain of blue is all blue objects.
First-order logic has nothing to do with HTML -- are you trying to use HTML to represent an entity in first-order logic somehow? It remains incredibly unclear what your question is.

Ruby: Ice cream with decorators

I am writing a simple program that calculates the cost of ice cream.
The process is pretty simple: pick a cone, pick some flavors, pick some toppings, then pay the amount.
There are a bunch of different cones, and a bunch of different flavors, and a bunch of different toppings.
My design is to use decorator classes to wrap the ice cream similar to how you would place an order.
So I have my base Ice Cream class that provides an "amount" attribute indicating how much the thing costs, along with decorator classes for the Cone, Flavor, and Toppings. Each class will take an ice cream object and add to the amount, so you basically mix and match different types of ice creams.
I have another class that handles the actual money transaction, which takes various objects and calculates the price. In particular, if it sees an Ice Cream, it will perform some ice cream related processes.
Now, this design sounds fine and all, but how do I check whether the object that comes out of the ice cream maker is an ice cream type? After all, it will in theory be wrapped around with a bunch of decorators, so if you ask for its class you'll probably see something like Topping rather than just ice cream. Ice Cream isn't necessary the super class either; it might be several classes up in the hierarchy.
<topping ice cream>.Instanceof(Ice_Cream) doesn't seem to work.
Also, I've implemented it using a set of classes. Are there other ways in ruby that I can use to achieve this type of design?
You should show us some code, but Ruby has Object#is_a? and Class#=== that can be helpful here:
class MyString < String ; end
MyString.new.is_a? String #=> true
String === MyString.new #=> true
class AnotherString < MyString ; end
AnotherString.new.is_a? String #=> true
String === AnotherString.new #=> true
If you wonder about Class#===, it's mostly for use in case statements:
case value
when String
# something
when Array
# something else
end
For more idiomatic design approaches, you probably should look into modules and their use as mixins:
http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html

Predicate vs Functions in First order logic

I have been so confused lately regarding difference between predicate and function in first order logic.
My understanding so far is,
Predicate is to show a comparison or showing a relation between two objects such as,
President(Obama, America)
Functions are to specify what a particular object is such as,
Human(Obama)
Now am I heading on right track to differentiate these two terms or I am completely wrong and need a brief explanation, I would like to have opinion from expert to clarify my knowledge(or approve my understanding). Thanks in advance
Krio
A predicate is a function that returns true or false.
Function symbols,
which map individuals to individuals
–
father-of(Mary) = John
–
color-of(Sky) = Blue
•
Predicate symbols,
which map individuals to truth values
–
greater(5,3)
–
green(Grass)
–
color(Grass, Green)
From what I understand
Function returns a value that is in the domain, mapping n elements to a single member of the domain.
Predicate confirms whether the relation you are trying to make is true or not according to the axioms and inference rules you are following in your system.
Predicate is confirmation for a particular property an objects or relation between objects. that is telling that property exists for that object. if you are given a formula P for president of America then
P(Obama,America)=true.
it tells you you are right and that property of Obama being President of America is true and that relation of Obama being president of America is true but
P(Putin,America)=false.
tells Putin being Americas president is false thus telling you that an object or objects holds or does not hold a particular property or relation.
As for functions returns the value associated with a specific property of an object like America's President , Ann's mother etc. You give them a value and they will return a value.Like let P be a function that returns the president of country passed as arguments
P(America)=Obama.
P(Russia)=Putin.
Functions are relations in which there is only one value for a given input.
source : AIMA (Artificial Intelligent A Modern Approach Book)
more description in the image:

Resources