Pizzas

The CO-ODE OWL tutorial uses an example model based on pizzas. Pizzas consist of a base along with a number of toppings. These toppings can be of a number of different types, with subcategories of toppings including Meat, Fish and Vegetarian toppings. We can then go on to define various subclasses of pizza, for example a Vegetarian Pizza is one that only contains vegetarian toppings.

It is not always easy, however, to precisely capture exactly what we mean when we say that a pizza can "only have vegetarian toppings". In particular, the open world assumption can sometimes result in unexpected inferences being drawn.

A model of pizzas (kindly provided by Nick Drummond from the CO-ODE project at the University of Manchester) illustrates a number of different ways in which one might try to define Vegetarian Pizzas. These are named as VegePizza1 through to VegePizza10.

Load the ontology into your editor/browser of choice, and before using a reasoner or classification engine examine each of the VegePizzaN definitions. Try and see if can determine exactly what the definition really means — do you think it accurately captures the notion of a Vegetarian Pizza? What relationships might there be between the various definitions? Are some of them equivalent? Do some of them subsume others? Once you've made your decisions, use a reasoner to classify the ontology and compare the results. A number of explanations are also given below.


Namespace: owl = <http://www.w3.org/2002/07/owl#>
Namespace:  = <http://owl.cs.manchester.ac.uk/2009/07/sssw/pizza#>

Ontology: <http://owl.cs.manchester.ac.uk/2009/07/sssw/pizza>

ObjectProperty: hasTopping
    Domain: 
        Pizza

ObjectProperty: hasMaterialState
    Characteristics: 
        Functional

Class: owl:Thing

Class: MeatFishAndVegetarianPizza-Closed
    SubClassOf: 
        ClosedPizza,
        hasTopping some FishTopping,
        hasTopping only (FishTopping
                         or MeatTopping
                         or VegetarianTopping)
    
Class: LiquidSolidIceCream
    Annotations: 
        rdfs:comment "A class that uses a functional property (hasMaterialState)
                      twice. This is not inconsistent unless MaterialStates have
                      been declared disjoint"
    EquivalentTo: 
        IceCream
        that hasMaterialState some Liquid
        and hasMaterialState some Solid

Class: VegetarianToppingsPizza-Closed
    SubClassOf: 
        ClosedPizza,
        hasTopping some VegetarianTopping,
        hasTopping only VegetarianTopping


Class: IceCream
    Annotations: 
        rdfs:comment "All IceCreams must have at least 1 topping.
Any individual that has a topping must be a Pizza.
Therefore all IceCreams must be Pizzas.
Icecream is inferred to be a subclass of Pizza."
    SubClassOf: 
        PizzaDomainConcept,
        hasTopping some FishTopping

Class: MeltedIceCream
    EquivalentTo: 
        IceCream
        that hasMaterialState some Liquid


Class: OneToppingPizza
    SubClassOf: 
        TestPizza,
        hasTopping exactly 1 owl:Thing

Class: FishTopping
    SubClassOf: 
        PizzaTopping
    DisjointWith: 
        MeatTopping,
        VegetarianTopping


Class: MeatTopping
    SubClassOf: 
        PizzaTopping
    DisjointWith: 
        FishTopping,
        VegetarianTopping

Class: EmptyPizza
    SubClassOf: 
        TestPizza,
        hasTopping exactly 0 owl:Thing

Class: MeatAndFishPizza-Closed
    SubClassOf: 
        ClosedPizza,
        hasTopping some FishTopping,
        hasTopping only (FishTopping
                         or MeatTopping)

Class: Pizza
    Annotations: 
        rdfs:comment "We have not asserted that all pizzas must have at least 1 topping"
    SubClassOf: 
        PizzaDomainConcept
    DisjointWith: 
        PizzaTopping

Class: PizzaTopping
    SubClassOf: 
        PizzaDomainConcept
    DisjointWith: 
        Pizza

Class: OpenPizza
    Annotations: 
        rdfs:comment "Pizzas that could be extended - they have the given toppings, but could also have other, unspecified toppings"
    SubClassOf: 
        TestPizza

Class: ClosedPizza
    Annotations: 
        rdfs:comment "Pizzas that have been closed to limit what toppings they can have"
    SubClassOf: 
        TestPizza

Class: TestPizza
    SubClassOf: 
        Pizza

Class: Solid
    SubClassOf: 
        MaterialState

Class: PizzaDomainConcept

Class: MeatPizza-Closed
    SubClassOf: 
        ClosedPizza,
        hasTopping some MeatTopping,
        hasTopping only MeatTopping

Class: MeatFishAndVegetarianPizza-Open
    SubClassOf: 
        OpenPizza,
        hasTopping some FishTopping

Class: MeatAndFishPizza-Open
    SubClassOf: 
        OpenPizza,
        hasTopping some FishTopping

Class: Gas
    SubClassOf: 
        MaterialState


Class: VegetarianToppingsPizza-Open
    SubClassOf: 
        OpenPizza,
        hasTopping some VegetarianTopping

Class: FishPizza-Open
    SubClassOf: 
        OpenPizza,
        hasTopping some FishTopping


Class: MaterialState
    Annotations: 
        rdfs:comment "The MaterialStates should be disjoint, but this has been left out - see LiquidSolidIceCream"

Class: VegetarianTopping
    SubClassOf: 
        PizzaTopping
    DisjointWith: 
        FishTopping,
        MeatTopping
    
Class: FishPizza-Closed
    SubClassOf: 
        ClosedPizza,
        hasTopping some FishTopping,
        hasTopping only FishTopping

Class: MeatPizza-Open
    SubClassOf: 
        OpenPizza,
        hasTopping some MeatTopping

Class: Liquid
    SubClassOf: 
        MaterialState

Class: VegePizza01
    EquivalentTo: 
        Pizza
        that hasTopping some VegetarianTopping

Class: VegePizza02
    EquivalentTo: 
        Pizza
        that hasTopping only VegetarianTopping

Class: VegePizza03
    EquivalentTo: 
        Pizza
        that hasTopping some VegetarianTopping
        and hasTopping only VegetarianTopping

Class: VegePizza04
    EquivalentTo: 
        Pizza
        and not (hasTopping some FishTopping)
        and not (hasTopping some MeatTopping)

Class: VegePizza05
    EquivalentTo: 
        Pizza
        that hasTopping only (not (FishTopping
                                   or MeatTopping))
    
Class: VegePizza06
    EquivalentTo: 
        Pizza
        that hasTopping only (not (FishTopping
        and MeatTopping))
    
Class: VegePizza07
    EquivalentTo: 
        Pizza
        that hasTopping some (not (FishTopping
                                   or MeatTopping))

Class: VegePizza08
    EquivalentTo: 
        Pizza
        that hasTopping some (not (FishTopping
        and MeatTopping))

Class: VegePizza09
    EquivalentTo: 
        Pizza
        that hasTopping some (not (FishTopping
                                   or MeatTopping))
        and hasTopping only (not (FishTopping
                                  or MeatTopping))
    
Class: VegePizza10
    EquivalentTo: 
        Pizza
        that hasTopping some (not (FishTopping
        and MeatTopping))
        and hasTopping only (not (FishTopping
        and MeatTopping))

Class: VegePizza11
    EquivalentTo: 
        Pizza
        that hasTopping some owl:Thing
        and hasTopping only VegetarianTopping

Now use the reasoner to classify the ontology and examine the subsumption relationships that you get between the various classes, in particular between the various definitions of VegePizza. You will find that some of the definitions are "tighter" than others, while some of the definitions actually admit instances that would not be considered vegetarian. Can you explain why the inferences are occurring — in particular those "unexpected" inferences, for example where a Pizza containing Meat and or Fish ends up being classified beneath one of our VegePizza definitions?

VegePizza01
Class: VegePizza01
    EquivalentTo: 
        Pizza
        that hasTopping some VegetarianTopping

This definition simply states that a VegePizza01 is a Pizza that has some Vegetarian topping. It says nothing at all about any other toppings that it may have, only that there must be at least some Vegetarian topping. Thus there may be Pizzas (for example one with mushrooms and ham) that fit this description, but which are not vegetarian.

VegePizza02
Class: VegePizza02
    EquivalentTo: 
        Pizza
        that hasTopping only VegetarianTopping

This definition states that a VegePizza02 is a Pizza that only has Vegetarian toppings. This captures more accurately than VegePizza01 the notion of a Vegetarian pizza. Note, however, that this description will include pizzas that are known to have no toppings at all. In addition, it will not include pizzas for which we don't have complete information about their toppings.

VegePizza03
Class: VegePizza03
    EquivalentTo: 
        Pizza
        that hasTopping some VegetarianTopping
        and hasTopping only VegetarianTopping

This definition states that a VegePizza03 is a Pizza that has at least one Vegetarian topping, and only has Vegetarian toppings. This helps to prevent situations such as that encountered by a friend of mine who, upon asking for a veggie burger ("a burger with no meat") in a burger bar, was served an empty bun along with the explanation: "there you go, a burger with no meat".

Again, this doesn't include those pizzas for which we don't have complete information about their toppings.

VegePizza04
Class: VegePizza04
    EquivalentTo: 
        Pizza
        and not (hasTopping some FishTopping)
        and not (hasTopping some MeatTopping)

This definition states that a VegePizza04 is a Pizza that does not have a FishTopping and does not have a MeatTopping. As with VegePizza02, this will include those pizzas with no toppings at all.

Again, this doesn't include those pizzas for which we don't have complete information about their toppings. It will also include pizzas which are topped with things that aren't actually toppings, for example a pizza topped with Ice Cream (note that there are no domain and range restrictions on the hasTopping relationship.

VegePizza05
Class: VegePizza05
    EquivalentTo: 
        Pizza
        that hasTopping only (not (FishTopping
                                  or MeatTopping))

This definition states that a VegePizza05 is a Pizza that only has toppings that are not MeatTopping or FishTopping. This definition is in fact equivalent to VegePizza05 (recall the distribution laws introduced earlier).

Again, if we don't know all there is to know about the toppings that a pizza has, we can't tell if it is an instance of this class.

This definition is actually equivalent to VegePizza04 (cf distribution rules).

VegePizza06
Class: VegePizza06
    EquivalentTo: 
        Pizza
        that hasTopping only (not (FishTopping
        and MeatTopping))

This definition states that a VegePizza06 is a Pizza that only has toppings that are not MeatTopping and FishTopping. The restriction posed here is redundant. As we know that MeatTopping and FishTopping are disjoint, everything is in the complement of the intersection of MeatTopping and FishTopping. Thus this definition actually says "Those pizzas that are only topped wth things". This is thus equivalent to Pizza.

VegePizza07
Class: VegePizza07
    EquivalentTo: 
        Pizza
        that hasTopping some (not (FishTopping
                                   or MeatTopping))

This definition states that a VegePizza07 is a Pizza with a topping that is not FishTopping or MeatTopping. Thus any instance of this class must have a topping that of any class except MeatTopping or FishTopping. However, there could be other toppings that are MeatTopping or FishTopping, thus this fails to capture our vegetarian pizza correctly.

VegePizza08
Class: VegePizza08
    EquivalentTo: 
        Pizza
        that hasTopping some (not (FishTopping
        and MeatTopping))

This definition states that a VegePizza08 is a Pizza with a topping that is not FishTopping and MeatTopping. As with VegePizza06, the problem here is the use of the intersection between FishTopping and MeatTopping. This is empty, thus the complement is the whole domain, and this description simply characterises all those pizzas that have any topping at all.

VegePizza09
Class: VegePizza09
    EquivalentTo: 
        Pizza
        that hasTopping some (not (FishTopping
                                   or MeatTopping))
        and hasTopping only (not (FishTopping
                                  or MeatTopping))

A VegePizza09 is a Pizza that has a topping that is neither FishTopping nor MeatTopping and which is only topped with toppings that are neither FishToppings or MeatToppings.

VegePizza10
Class: VegePizza10
    EquivalentTo: 
        Pizza
        that hasTopping some (not (FishTopping
        and MeatTopping))
        and hasTopping only (not (FishTopping
        and MeatTopping))

Again we see here the negation of the intersection of MeatTopping and FishTopping resulting in a description of all things. Thus an instance of VegePizza10 has some topping which could be anything (cf. VegePizza08). Similarly, the universal restriction states that all toppings must be things, which is redundant (cf VegePizza06). This description is thus equivalent to VegePizza08.

VegePizza11
Class: VegePizza11
    EquivalentTo: 
        Pizza
        that hasTopping some owl:Thing
        and hasTopping only VegetarianTopping

This definition states that a VegePizza11 is a Pizza that has at least one topping, and only has Vegetarian toppings. This turns out to be equivalent to VegePizza03 — the presence of the universal rstriction means that we don't need to explicitly state the filler in the existential quantification.

Summary

In summary, we can see that VegePizza11 probably best captures the notion of a Vegetarian Pizza. All the toppings must be VegetarianToppings, and it must have at least some topping (so we're not just being served bread).