Tutorial One Protégé

Go to the content!

Aim of the tutorial

The aim of this guide is to get familiar with the ontology editor Protégé. In particular, by following this tutorial you will be able to create an ontology and then automatically infer information on that ontology by exploiting OWL's language logical structure combined with the built in reasoners offered by Protégé. It is based on the 5.5 version of Protégé. Please verify the version in case you find some inconsistencies between your results and the ones provided here.

This tutorial is a slightly modified dhdk-esque version of the tutorial created by Fabio Papacchini available here.

The Ontology built using this tutorial will be a very simple conceptualization of University Exams.

Steps

Every step is accompanied by a reference image and additional information if needed.

Before starting, during this tutorial you will encounter these particular terms:

  • Class: classes in Protégé are considered as the concepts of your conceptualizations, they can be considered either as abstract terms that are defined by their values, or as abstract collections of terms that have some values. Classes are generally organized in hierarchies.
  • Object Property: an object property is a link between two or more classes. Be aware that ontologies are directed graphs, so the source node (domain) from which the object property starts is different than the target node (range). (Example: in this triple "ex:Bruno isTutorOf ex:DHDK" Let's say that Bruno is from class "Person" and "DHDK" belongs to the class "MasterDegree". In this case, the property "isTutorOf" has Person as a domain and MasterDegree as a range. You are not supposed to write "ex:DHDK isTutorOf ex:Bruno", otherwise you are saying that Bruno is a Master Degree and DHDK is a Person)
  • Data Property: A data property is a link between a Class and a data value. For example ex:Bruno hasFullName "Bruno Sartini". In this case, the domain of this relationship is a class, but the range is a datatype (which can be strings, integers, dates, uris...)
  • Axioms and Restrictions: axioms are considered as logical rules applied to your ontology. They can be used to create restriction as to what can belong to a certain class or not. Examples: let's imagine that the class Person has the restriction: "ex:hasBirthDate exactly 1 ex:Birthdate". This means that one individual can be considered as a Person, in your conceptualization, only if it has exactly one birth date.
Moreover, you fill find some references to Manchester Syntax, please refer to this document for more information about that.

By going to the Entities and then Classes sections your screen should look like this:

Responsive image

Let's create our first class: Exam. Select owl:Thing from the classes and follow the steps highlighted in the image.

Responsive image

To change the prefix of your ontology, go to the tab Active Ontology, then click on Ontology Prefixes and follow the indications in the image. As for what to put in the field, I suggest you to write ":" as it should leave it blank.

Responsive image Responsive image

To delete a class from your ontology. Simply select it and click the highlighted button in the image

Responsive image

An easier way to create class, if you already have a class hierarchy, is to use the function create a class hierarchy in Protégé. Follow the images to create your class hierarchy of the Exams. You can take the text from the block below


Exam
	NamedExam
		KnowledgeOCH		
		KnowledgeRaE
		ScolarlyEditing
		Usability
		MachineLearning
Faculty
	FICLIT
	ComputerScience

EvaluationType
		Written
		Oral
		Project
Structure
		Modular
		Single
    
Responsive image Responsive image

This step serves as a validation check for the things done so far. Expand the class hierarchy by clicking on the arrows that you can see highlighted in the images below. Then, click a class and click on the usage tab on the right to check its axioms. Everything should look like the images provided

Responsive image Responsive image

In this step you will create the object properties that will represent the possible relationships between the classes you have created before. The three object property that will be created are:

  • hasStructure
  • belongsToFaculty
  • hasEvaluationType

Go to the object tab and can create them by following the steps shown in the images below.

Responsive image Responsive image

In this step you will add a Range and a Domain to the properties just created. Follow the examples in the images below, these are the domain and range for each property (in the image there is only one domaina and range added, add them all):

  • hasStructure: Exam (domain), structure (range)
  • hasEvaluationType: Exam (domain), EvaluationType (range)
  • hasFaculty: Exam (domain), Faculty (range)

Responsive image Responsive image

In this step you will add the restrictions to some of the generated classes in forms of Axioms. These axioms will be useful for the automatic inference based classification of the NamedExams. For each name exams add the axioms written below following the instructions in the images:

  • KnowledgeOCH:
    • subClassOf :belongsToFaculty some :FICLIT
    • subClassOf :hasEvaluationType some :Project
    • subClassOf :hasStructure some :Modular
  • KnowledgeRaE:
    • subClassOf :belongsToFaculty some :FICLIT
    • subClassOf :hasEvaluationType some:Oral
    • subClassOf :hasEvaluationType some:Written
    • subClassOf :hasEvaluationType some:Project
    • subClassOf :hasStructrue some :Modular
  • MachineLearning:
    • subClassOf :belongsToFaculty some :ComputerScience
    • subClassOf :hasEvaluationType some:Project
    • subClassOf :hasStructure some :Single
  • ScholarlyEditing:
    • subClassOf :belongsToFaculty some :FICLIT
    • subClassOf :hasEvaluationType some:Oral
    • subClassOf :hasEvaluationType some:Written
    • subClassOf :hasEvaluationType some:Project
    • subClassOf :hasStructure some:Single
  • Usability:
    • subClassOf :belongsToFaculty some :FICLIT
    • subClassOf :belongsToFaculty some :ComputerScience
    • subClassOf :hasEvaluationType some :Oral
    • subClassOf :hasEvaluationType some :Written
    • subClassOf :hasEvaluationType some :Project
    • subClassOf :hasStructure some:Single

Responsive image Responsive image

In this step you will add one Equivalent to axiom to the class Structure. It will be equivalent to :Single or :Modular. Follow the images for the instructions, then check if the property :hasStructure looks like the one in the second image

Responsive image Responsive image

In this step you will create the first class that will be used as a defined class. It will be useful for the reasoner-based classification. Follow the images to create a new class and make it defined. You have to create a normal class like always, then add the restriction action and then use the Protégé command to make it a defined class.

Responsive image Responsive image Responsive image

First of all, check whether your class looks like the one in the first image. Then proceed to create the other classes, which are all subclasses of :Exam, following these instructions:

  • Name: ComputerScienceExam, axioms:
    • :subClassOf :belongsToFaculty some :ComputerScience
  • Name: ModularExam, axioms:
    • :subClassOf :hasStructure some :Modular
  • Name: MultiEvaluationExam, axioms:
    • :subClassOf :hasEvaluationType some :Project
    • :subClassOf :hasEvaluationType some :Written
    • :subClassOf :hasEvaluationType some :Oral
  • Name: OralEvaluationExam, axioms:
    • :subClassOf :hasEvaluationType some :Oral
  • Name: ProjectEvaluationExam, axioms:
    • :subClassOf :hasEvaluationType some :Project
  • Name: WrittenExaminationExam, axioms:
    • :subClassOf :hasEvaluationType some :Written
  • Name: SharedExam, axioms:
    • :subClassOf :belongsToFaculty some :FICLIT
    • :subClassOf :belongsToFaculty some :ComputerScience
  • Name: SingleExam, axioms:
    • :subClassOf :hasStructure some :Single

Make all of them defined classes and they should look like the second image.

Responsive image Responsive image

In this step you will add a Data Property, go on the data properties tab and create it as shown in the images.

Responsive image

In this step you just have to add a domain and a range to the data property previously created like shown in the images

Responsive image Responsive image

In this step you will add an axiom to the class NamedExam. Look at the images to see how to add an axiom related to the data property previously created. Be careful to follow every step

Responsive image

In this step you will start the Reasoner, a tool that will help you to check whether your ontology is consistent (if your axioms make sense all together) and also it will generate some infereces based on the axioms that you have created before. Follow the images to start the reasoner and change the view from asserted to inferred to see the inferences. As you will see, all the named exams will be reclassified under the defined classes.

Responsive image Responsive image

In this step you will save your ontology. In the first image it is shown how to save it as a normal version. In the second image instead, it is shown how to save also the inferences made by the reasoner.

Responsive image Responsive image

At the end of the tutorial, your 2 saved ontologies should be the same as the files you can find here.

Tutorials

Suggested Tutorials and Guides