Wednesday, 3 June 2015

Protege Publish and SPARQL

Part V : Protege Tutorial (cont)

F. Publish and SPARQL.

As we do not have the specified host for our Ontology so, we decided just to watch the video for the publishing and run a simple SPARQL. So here are the following videos from Dr. Noureddin Sadawi






G. What we learn from Protege.

We learn ways to add the classes, subclasses, properties, individual and many more and create the connection between the classes, subclasses, properties, individual and so on. Then using the hosted site you can see the XML viewed after publishing the Ontology in the web. Also how to download the Jena Fuseki Server and run a simple SPARQL. 




Part IV : Protege Tutorial (cont)

E. Adding Individuals.
1.  Create new individual for the classes.


Figure 1 Add new individual

2 . Key in as many individual that fit your ontology then key in the possible description for each individuals



Figure 2 Add description according to the individuals

3. Key in the object property assertions and data property assertions that fits that individuals 


Figure 3: Add data property assertions


Figure 4: Add object property assertions

Monday, 1 June 2015

Part III : Protege Tutorial (cont)

C. Adding Object Properties.

 1. Save the previous file. We named our file as Ontology IRI.

Figure 1 : Saving file

2. Open the object properties.

Figure 2. Object Properties pop up

3. Create a sub-properties, named as teaches and studies as in Figure 3.

Figure 3 : teaches and studies sub-properties created

4. Then, set the domain for the studies is the student and the range is the module.
 
5. Meanwhile, the domain teaches is teacher and the range is module.


D. Adding Data Properties
 
1. Data properties is used to add details to the classes. Add data properties such as first name or anything.
 
Figure 4 : add data properties

2. Add data properties student_id, domain set is lecturer and the range is an integer.
 
3. Next,  data properties staff_id, domain set is student and the range is an integer.

4. After that, last_name and first_name domain is a person class and the range is string.

Figure 5 : completed setting

5. Then, test it by starting the reasoner to see whether there is any error.

Figure 6 : Reasoner started


6. If the reasoner did not show any error, yo can stop the reasoner.

Figure 7 : Reasoner stopped


 
 
 





Part II : Using Protege


 Open the protege software to start using it. Figure 1 shows the interface of protege.


Figure 1 : Protege interface
 
 
 
Part III : Protege tutorial
 
This protege tutorial are based on a series of video by Dr. Noureddin Sadawi.
 
A. Introduction to Ontology 

1. Figure 2 shows an ontology of Person where its subclasses are Student and Lecturer.
   
   Student  studies  Module
   Lecturer  teaches  Module

Figure 2 : Person subclasses

Figure 3 : Module subclasses

2. Figure 3 shows other example of ontology where both CSModule and MathModule are subclasses of Module.

B. Creating Ontology Class
 
 1. Click on classes tab to create class.

Figure 4 : Classes tab selected

2. Add a new class. We add a new class named Person.

Figure 5 : Person class added

3. Next, add another two classes named Student and Lecturer under Person class.

Figure 6 : Student class added

Figure 7 : Lecturer class added

4. Repeat the process of adding class with a new Module class. Then, add two new class under Module named CSModule and MathModule.

Figure 8 :  Created Person and Module class with their subclasses

5. Click on any of the module and click Disjoint with at the description

Figure 9 : Disjoint with option

6. Click ctrl and click on MathModule, Lecturer, and Student to be Disjoint with.

Figure 10 :Disjoint of MathModule, Lecturer and Student

Reason for the Disjoint:
-To avoid overlapping between classes, ie subclass, or an instances or an individual can only be an instances of one class so we can avoid multiple inheritances.








Protege Installation

Part I : Installing Protege

1. Download Protege software in this link
http://protege.stanford.edu/download/protege/4.3/installanywhere/Web_Installers/

You will be directed to a page as shown in figure 1 below.


Figure 1 : Download page


2. Next, open folder containing the installer. Double click on the installer and click Run on the popup windows.

Figure 2 : Protege installer 


3. An installation wizard will appear with a complete step by step installation process.

   (a) Click Next in the Introduction.

 Figure 3 : Introduction step

   (b) Choose the installation folder. Its best to choose the default folder which is "C:\\Program\Program Files\Protege_4.3". Click Next.

Figure 4 : Choose installation folder

   (c) Choose where to place shortcut folder. We choose to place it on the desktop and click Next.

Figure 5 : Choose shortcut folder location

   (d) Next, choose Java Virtual Machine that is suitable and click Next.

Figure 6: Choose Java Virtual Machine

   (e) A pre-installation summary will be shown, click Install so it can start installing.

Figure 7 : Pre-installation summary

   (f) Installing protege.

Figure 8 :  Installation start

   (g) Installation complete.

Figure 9 : Installation completed

4. Now, you can start using protege to make and edit an ontology.