Hide menu

Hands-On Session: Creating an ontology from given requirements

Overview and tools

The idea behind this hands-on is to use what you learned in the last two hands-on sessions, about the basics of OWL and about requirements, and now model a complete (although small) ontology based on a set of given requirements.

The tool to use is still up to you, and to remind you, there were the following options:

Protege can be downloaded from here.

Alternative tools to use: If you cannot or do not want to download any tool, you can use WebProtege, which is also online here, but that will not have all the functionality for all the hands-on sessions, so you will have to skip some parts. For more advanced users, and users who are very familiar with the Eclipse environment an alternative is to download the trial version of TopBraid Composer.

If you need to (or want to) look something up in the OWL specification, the best place to look is probably the OWL2 Primer.


In this hands-on, you get a set of CQs, and some associated restrictions and reasoning requirement. Your task is to formalise this into an OWL ontology. There are many ways to solve the problem, so even if your neighbour might be doing it completely differently that may be perfectly fine - you are simply making different design choices. Just remember to try to stick to these requirements, and not go too far outside of what is actually written in them - just because an ontology is larger, or has a deeper taxonomy does not mean it is better! Similar to in the last exercise, we first provide a context for the ontology and the exercise that you should try to imagine yourself in, then we provide the textual material the requirements were based on, and finally the set of requirements, which is what you should actually model.


The national association for promotion of theater in Italy wants to set up a web-based system for keeping track of details about theater productions and the actors at different theaters. In order to support reasoning about the productions, the system should be based on an ontology. Below are some typical situations that should be representable in the ontology, and requirements in the form of competency questions, restrictions and reasoning requirements.

Story: theater productions

During each year a number of theatre festivals are held in cities around Italy. In January 2007 a festival called ‚ÄúRoma Loves Shakespeare‚ÄĚ took place in Rome. Two different productions of ‚ÄúThe Merchant of Venice‚ÄĚ participated, one from a theatre in Pisa and the other from a theatre institute in Venice, featuring an ensemble of university art students. Other plays were Othello and a Midsummer Night‚Äôs Dream.

The Grand Theatre in Rome offers two theatre shows each evening during September and October 2009. The play set up in this period is the "Merchant of Venice",given through an ensemble of well-known Italian actors. The Merchant of Venice was written during 1596 to 1598 by William Shakespeare, and it has 5 distinct acts. The premier of this production at The Grand Theatre was on September 7. Il Gazzettino gave the production 5 stars in a recent review.

Fabio Bianchi is an Italian actor employed at the Grand Theatre since May 2004, he is a part of the ensemble setting up the Merchant of Venice and he plays the Duke of Venice but also a servant in one of the scenes. During the second and third week of September the role of Shylock is played by Arnold Schwarzenegger as a special guest actor.


Competency Questions

  1. When did a certain theatre festival take place?
  2. Where did a certain festival take place?
  3. What productions and of what plays could be seen during a certain theatre festival?
  4. In what city is a certain theatre located?
  5. In what country is a certain city located?
  6. What play is the basis of a certain production?
  7. Who are the members of a certain ensemble at a certain point in time?
  8. What ensemble is involved in a certain production?
  9. What plays did a certain author write?
  10. During what time period was a certain play written?
  11. How many acts does a particular play contain?
  12. When was the premier of a certain production?
  13. What is the ‚Äústar rating‚ÄĚ given by a certain newspaper for a certain production?
  14. At what time did a certain actor start working for a specific theatre?
  15. What roles does a certain actor have within a certain production during a certain time?

Additional restrictions

  1. A theatre festival has exactly one start time and one end time, and exactly one location (related to CQ 1 and 2)
  2. Nothing can ever be both a festival and a production. (related to CQ3)
  3. A theatre is located in exactly one city (related to CQ4) and a city is located in exactly one country (related to CQ5)
  4. A production is the setup of exactly one play, by exactly one ensemble. (related to CQs 3 and 6 and 8)
  5. A production has exactly one première. (related to CQ 12)
  6. An employment for a theatre has exactly one start and one end date (related to CQ14)

Reasoning requirements

  1. A large festival is a festival with more than 3 productions. (related to CQ 3)
  2. An author is a person who has written some play (related to CQ 9)
  3. An actor is a person who is a member of an ensemble which is involved in a production, or who has a role in a production (related to CQ15)

Extra exercise if you finish early

Now try to test your requirements! CQs can be tested by adding instances and formulating SPARQL queries to retrieve the relevant instances. Reasoning requirements can be tested by adding instances, then running a reasoner to see that the right outcomes are produced, and/or then running the SPARQL queries related to the relevant CQs on the inferred statements. Additional restrictions are the hardest to test. Some can be tested by "violating" them and checking that the ontology becomes inconsistent, but some may not be testable at all (remember: OWL uses the open world assumption).

Page responsible: Olaf Hartig
Last updated: 2018-03-13