33 
 
We have described the class Pizza to be to be a subclass of Thing and a subclass of the things that have 
a base which is some kind of PizzaBase. Notice that these are necessary conditions — if something is a 
Pizza it is necessary for it to be a member of the class Thing (in OWL, everything is a member of the 
class Thing) and necessary for it to have a kind of PizzaBase. More formally, for something to be a 
Pizza it is necessary for it to be in a relationship with an individual that is a member of the class 
PizzaBase via the property hasBase.  
4.10.3 Creating Subclasses of Pizza 
It’s now time to add some different kinds of pizzas to our ontology. We will start off by adding a 
MargheritaPizza, which is a pizza that has toppings of mozzarella and tomato. In order to keep our 
ontology tidy, we will group our different pizzas under the class NamedPizza. 
Exercise 14: Create Subclasses of Pizza: NamedPizza and MargheritaPizza 
_____________________________________________________________________________________ 
1. Select Pizza from the class hierarchy on the Classes tab.    
2. Click on the Add subclass icon at the top left of the Classes tab (look back at figure 4.4 if you aren’t 
certain). You can also move your mouse over the icons and you will see a little pop-up hint for each icon.  
3. Protégé will prompt you for the name of the new subclass. Call it NamedPizza.  
4. Repeat steps 1-3 this time starting with NamedPizza to create a subclass of NamedPizza. Call it 
MargheritaPizza.  
5. Add a comment to the class MargheritaPizza using the Annotations view. This is above the 
Description view. Add the comment: A pizza that only has Mozzarella and Tomato toppings. Remember 
that annotation properties are meta-data that can be asserted about any entity whereas object and data 
properties can only be asserted about individuals. There are a few predefined annotation properties that 
are included in all Protégé ontologies such as the comment property.  
_____________________________________________________________________________________ 
Having created the class MargheritaPizza we now need to specify the toppings that it has. To do this we 
will add two restrictions to say that a MargheritaPizza has the toppings MozzarellaTopping and 
TomatoTopping. 
Exercise 15: Create Restrictions that define a MargheritaPizza  
_____________________________________________________________________________________ 
1. Select MargheritaPizza from the class hierarchy on the Classes tab.    
2. Click on the Add icon (+) next to the SubClass Of field in the Description view for Pizza. 
3. This again brings up the restriction dialogue. This time rather than use the Object restriction creator we 
will use the Class expression editor tab. Select that tab.    
4. Type hasTopping some Mo into the field.  Rather than type the rest of the name of the topping now hit 
<control><space> (hold down the control key and hit the space bar). Protégé should auto-complete the 
name for you and the field should now contain: hasTopping some MozzarellaTopping. This is a useful 
technique for any part of the Protégé UI. Whenever you enter the name of some entity you can do