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. Look at each of the definitions and try and see if you can determine exactly what the definition really means — do you think it accurately captures the notion of a Vegetarian Pizza?
Namespace(rdf = <http://www.w3.org/1999/02/22-rdf-syntax-ns#>) Namespace(xsd = <http://www.w3.org/2001/XMLSchema#>) Namespace(rdfs = <http://www.w3.org/2000/01/rdf-schema#>) Namespace(owl = <http://www.w3.org/2002/07/owl#>) Namespace(a = <http://owl.man.ac.uk/2006/sssw/pizza#>) Ontology( <http://owl.man.ac.uk/2006/sssw/pizza> ObjectProperty(a:hasMaterialState Functional) ObjectProperty(a:hasTopping domain(a:Pizza)) Class(a:ClosedPizza partial a:TestPizza) Class(a:EmptyPizza partial a:TestPizza restriction(a:hasTopping cardinality(0))) Class(FishPizza-Closed partial restriction(a:hasTopping allValuesFrom(a:FishTopping)) restriction(a:hasTopping someValuesFrom(a:FishTopping)) a:ClosedPizza) Class(FishPizza-Open partial restriction(a:hasTopping someValuesFrom(a:FishTopping)) a:OpenPizza) Class(a:FishTopping partial a:PizzaTopping) Class(a:Gas partial a:MaterialState) Class(a:IceCream partial a:PizzaDomainConcept restriction(a:hasTopping someValuesFrom(a:FishTopping))) Class(a:Liquid partial a:MaterialState) Class(a:LiquidSolidIceCream complete intersectionOf(restriction(a:hasMaterialState someValuesFrom(a:Liquid)) a:IceCream restriction(a:hasMaterialState someValuesFrom(a:Solid)))) Class(a:MaterialState partial) Class(MeatAndFishPizza-Closed partial restriction(a:hasTopping allValuesFrom(unionOf(a:FishTopping a:MeatTopping))) restriction(a:hasTopping someValuesFrom(a:FishTopping)) a:ClosedPizza restriction(a:hasTopping someValuesFrom(a:MeatTopping))) Class(MeatAndFishPizza-Open partial a:OpenPizza restriction(a:hasTopping someValuesFrom(a:FishTopping)) restriction(a:hasTopping someValuesFrom(a:MeatTopping))) Class(MeatFishAndVegetarianPizza-Closed partial restriction(a:hasTopping allValuesFrom(unionOf(a:FishTopping a:VegetarianTopping a:MeatTopping))) restriction(a:hasTopping someValuesFrom(a:MeatTopping)) a:ClosedPizza restriction(a:hasTopping someValuesFrom(a:VegetarianTopping)) restriction(a:hasTopping someValuesFrom(a:FishTopping))) Class(MeatFishAndVegetarianPizza-Open partial restriction(a:hasTopping someValuesFrom(a:VegetarianTopping)) restriction(a:hasTopping someValuesFrom(a:FishTopping)) a:OpenPizza restriction(a:hasTopping someValuesFrom(a:MeatTopping))) Class(MeatPizza-Closed partial restriction(a:hasTopping allValuesFrom(a:MeatTopping)) a:ClosedPizza restriction(a:hasTopping someValuesFrom(a:MeatTopping))) Class(MeatPizza-Open partial a:OpenPizza restriction(a:hasTopping someValuesFrom(a:MeatTopping))) Class(a:MeatTopping partial a:PizzaTopping) Class(a:MeltedIceCream complete intersectionOf(a:IceCream restriction(a:hasMaterialState someValuesFrom(a:Liquid)))) Class(a:OneToppingPizza partial a:TestPizza restriction(a:hasTopping cardinality(1))) Class(a:OpenPizza partial a:TestPizza) Class(a:OpenPizza partial) Class(a:Pizza partial a:PizzaDomainConcept) Class(a:PizzaDomainConcept partial) Class(a:PizzaTopping partial a:PizzaDomainConcept) Class(a:Solid partial a:MaterialState) Class(a:TestPizza partial a:Pizza) Class(a:VegePizza01 complete intersectionOf( a:Pizza restriction(a:hasTopping someValuesFrom(a:VegetarianTopping)))) Class(a:VegePizza02 complete intersectionOf( restriction(a:hasTopping allValuesFrom(a:VegetarianTopping)) a:Pizza)) Class(a:VegePizza03 complete intersectionOf( a:Pizza restriction(a:hasTopping someValuesFrom(a:VegetarianTopping)) restriction(a:hasTopping allValuesFrom(a:VegetarianTopping)))) Class(a:VegePizza04 complete intersectionOf( a:Pizza complementOf(restriction(a:hasTopping someValuesFrom(a:FishTopping))) complementOf(restriction(a:hasTopping someValuesFrom(a:MeatTopping))))) Class(a:VegePizza05 complete intersectionOf( a:Pizza restriction(a:hasTopping allValuesFrom(complementOf(unionOf(a:FishTopping a:MeatTopping)))))) Class(a:VegePizza06 complete intersectionOf( a:Pizza restriction(a:hasTopping allValuesFrom(complementOf(intersectionOf(a:FishTopping a:MeatTopping)))))) Class(a:VegePizza07 complete intersectionOf( a:Pizza restriction(a:hasTopping someValuesFrom(complementOf(unionOf(a:FishTopping a:MeatTopping)))))) Class(a:VegePizza08 complete intersectionOf( a:Pizza restriction(a:hasTopping someValuesFrom(complementOf(intersectionOf(a:FishTopping a:MeatTopping)))))) Class(a:VegePizza09 complete intersectionOf( a:Pizza restriction(a:hasTopping allValuesFrom(complementOf(unionOf(a:FishTopping a:MeatTopping)))) restriction(a:hasTopping someValuesFrom(complementOf(unionOf(a:FishTopping a:MeatTopping)))))) Class(a:VegePizza10 complete intersectionOf( a:Pizza restriction(a:hasTopping allValuesFrom(complementOf(intersectionOf(a:FishTopping a:MeatTopping)))) restriction(a:hasTopping someValuesFrom(complementOf(intersectionOf(a:FishTopping a:MeatTopping)))))) Class(a:VegePizza11 complete intersectionOf( a:Pizza restriction(a:hasTopping someValuesFrom(owl:Thing)) restriction(a:hasTopping allValuesFrom(a:VegetarianTopping)))) Class(a:VegetarianTopping partial a:PizzaTopping) Class(VegetarianToppingsPizza-Closed partial restriction(a:hasTopping allValuesFrom(a:VegetarianTopping)) restriction(a:hasTopping someValuesFrom(a:VegetarianTopping)) a:ClosedPizza) Class(VegetarianToppingsPizza-Open partial restriction(a:hasTopping someValuesFrom(a:VegetarianTopping)) a:OpenPizza) Class(owl:Thing partial) DisjointClasses(a:FishTopping a:MeatTopping) DisjointClasses(a:VegetarianTopping a:MeatTopping) DisjointClasses(a:VegetarianTopping a:MeatTopping) DisjointClasses(a:FishTopping a:VegetarianTopping) DisjointClasses(a:FishTopping a:MeatTopping) DisjointClasses(a:FishTopping a:VegetarianTopping) DisjointClasses(a:Pizza a:PizzaTopping) DisjointClasses(a:Pizza a:PizzaTopping) )
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?
Class( VegePizza01 complete restriction( hasTopping someValuesFrom( VegetarianTopping ) ) Pizza )
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.
Class( VegePizza01 complete restriction( hasTopping allValuesFrom( VegetarianTopping ) ) Pizza )
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.
Class( VegePizza03 partial Pizza restriction( hasTopping someValuesFrom( VegetarianTopping ) ) restriction( hasTopping allValuesFrom( 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.
Class( VegePizza04 complete Pizza complementOf( restriction( hasTopping someValuesFrom( FishTopping ) ) ) complementOf( restriction( hasTopping someValuesFrom( 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.
Class( VegePizza05 complete Pizza restriction( hasTopping allValuesFrom( complementOf( unionOf( FishTopping 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).
Class( VegePizza06 complete Pizza restriction( hasTopping allValuesFrom( complementOf( intersection( FishTopping 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.
Class( VegePizza07 complete Pizza restriction( hasTopping someValuesFrom( complementOf( unionOf( FishTopping 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.
Class( VegePizza08 partial Pizza restriction( hasTopping someValuesFrom( complementOf( intersectionOf( FishTopping 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.
Class( VegePizza09 partial Pizza restriction( hasTopping allValuesFrom( complementOf( unionOf( FishTopping MeatTopping ) ) ) ) restriction( hasTopping someValuesFrom( complementOf( unionOf( FishTopping 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.
Class( VegePizza10 partial Pizza restriction( hasTopping allValuesFrom( complementOf( intersectionOf( FishTopping MeatTopping ) ) ) ) restriction( hasTopping someValuesFrom( complementOf( intersectionOf( FishTopping 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.
Class( VegePizza11 partial Pizza restriction( hasTopping someValuesFrom( owl:Thing ) ) restriction( hasTopping allValuesFrom( VegetarianTopping) ) )
This definition states that a VegePizza11 is a Pizza that has at least one topping, and only has Vegetarian toppings. This turns out top 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.
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).