48 
 
Chapter 5 Datatype Properties 
 
So far we have been describing object properties. These are properties that have a range that is some 
class. As with most other object-oriented languages OWL also has the capability to define properties with 
the range of a simple datatype such as a string or integer. Object purists will argue that everything should 
be an object. However, to borrow a quote from The Amazing Spiderman: “with great power comes great 
overhead”. I.e., the extra capabilities that one has with a class and an instance also means that instances 
take up more space and can be slower to process than simple datatypes. For that reason, OWL comes with 
a large library of pre-existing datatypes that are mostly imported from XML. That is why many of the 
predefined datatypes in Protégé have a prefix of xsd for example xsd:string and xsd:integer. It is 
also possible to create new basic datatypes.  However, for the majority of use cases, if one needs a 
datatype that doesn’t map to one of the predefined types the best solution is to usually just define a class.  
A property with a range that is a simple datatype is known as a datatype property. This is analogous to the 
distinction between an association and an attribute in the Unified Modeling Language (UML) OOP 
modeling language. A UML association is similar to an OWL object property and a UML attribute is 
similar to an OWL datatype property. It is also analogous to the distinction between relations and 
attributes in entity-relation modeling. A relation in an E/R model is similar to an object property in OWL 
and an attribute is similar to a datatype property. Because datatypes don’t have all the power of OWL 
objects, many of the capabilities for object properties described in section 4.8 such as having an inverse or 
being transitive aren’t available for datatype properties.  
5.1 Defining a Data Property 
As with other OWL entities, datatype properties can be defined either via the Data properties tab in the 
Entities tab or in the Data properties tab available via the Window>Tabs>Data properties option.   
We will use datatype properties to describe the calorie content of pizzas. We will then use some numeric 
ranges to broadly classify particular pizzas as high or low calorie. In order to do this we need to complete 
the following steps: 
1. Create a datatype property hasCaloricContent, which will be used to state the calorie content 
of particular pizzas. 
2. Create several example Pizza individuals with specific calorie contents. 
3. Create two classes broadly categorizing pizzas as low or high calorie. 
 
Exercise 27: Create a Datatype Property called hasCaloricContent  
_____________________________________________________________________________________ 
1. Open a Data properties tab.  Select owl:topDataProperty.  
2.  Click on the Add sub property icon in the upper left corner. This works just the same as the UI for 
adding object properties.  
3. Name the new data property hasCaloricContent and select OK.  
4. Click on the (+) icon next to Domains in the Description view for hasCaloricContent. Use the Class 
hierarchy tab to select the Pizza class as the domain.