Web Semantic Exercise : Ontology Data Integration (08.05.2016)

1. First exercise : How to integrate data ?

For example :  We have two different data set, X and Z.

We look at the first dataset X :

A simplified bookstore data (dataset “X”)



Next, change the Dataset X into a set of relations.  I have a sample for you.


Then, we have another bookstore data (Dataset “Z”)


Now, your turn to change the Dataset Z into a set of relations.


Now, your turn to change the Dataset Z into a set of relations.




2. Second exercise : 


Model the following ontologies into set of relations :

  • Herbivores, Carnivores, and Omnivores are animals
  • People are omnivores
  • People have names of type “string”
  • Vegetarians are people who are herbivores
  • “eats” is a property of animals and the values of the property must be of the type “food”
  • Meat and Veggies are types of food

ANSWERS : 

RDFS

: Herbivorerdfs:subClassOf:Animal.

: Carnivorerdfs:subClassOf:Animal.

: Omnivorerdfs:subClassOf:Animal.

: Personrdfs:subClassOf:Omnivore.

: hasNamerdfs:domain:Person.

: hasNamerdfs:domain:Person.

: Vegetarian rdfs:subClassOf:Person.

: Vegetarianrdfs:subClassOf:Herbivore.

: eats rdfs:domain: Animal.

: eats rdfs:range:Food.

: Meat df:type:Food.

: Meat rdf:type:Food.

: Veggies rdf:type:Food.
                              
OWL

Class(: Herbivore partial : Animal)

Class(:Carnivore partial : Animal)

Class(:Omnivorepartial : Animal)

Class(: Person partial : Omnivore)

Restriction (: hasNameallValuesFrom(xsd:string)))

DatatypeProperty(:hasName)



  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

WEB SEMANTIC ONTOLOGY (24.04.2016)

PROTEGE INSTALLATION

Part I: Installing Protege


1.      1. Download Protege software in this link.

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


Figure 1: Download Page

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


Figure 2: Protege Installer

1.      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. It’s 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.


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 studiesModule
             Lecturer teachesModule



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.

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 IV: Protege Tutorial


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



Part V: Protege Tutorial


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


  •     Simple Protege Tutorial 6- Publishing the Ontology 
          (make it available online)
         
         https://www.youtube.com/watch?v=QY9M_j2Ta14

  •     Simple Protege Tutorial 7- Downloading and Running Jena Fuseki Server

https://www.youtube.com/watchv=JZp70uFsZS0&list=PLea0WJq13cnAfCC0azrCyquCN_tPelJN1&index=7


  •     Simple Protege Tutorial 8- Running Simple SPARQL Queries

https://www.youtube.com/watchv=0zUos1zWB5k&list=PLea0WJq13cnAfCC0azrCyquCN_tPelJN1&index=8


  •     Simple Protege Tutorial 9- Creating and Publishing Another Ontology         

 https://www.youtube.com/watchv=Pn7oiDrtHmc&list=PLea0WJq13cnAfCC0azrCyquCN_tPelJN1&index=9


  •     Simple Protege Tutorial 10- Running SPARQL Queries on both Ontologies

https://www.youtube.com/watch?v=U_SfRJAXfs&list=PLea0WJq13cnAfCC0azrCyquCN_tPelJN1&index=10



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


  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

WEB SEMANTIC LAB 3 (27.03.2016)

Give an RDF description that states the following:

1. Resource  http://www.haneena.com/~haneena/homepage is a homepage and it is owned by Haneena.


2. Resource  http://www.haneena.com/haneena-ns/#T-999”> is a course named C-programming and is lectured by Adib Razi at room BT1.


3. By using container element rdf:Bag,  give an RDF description that states the following: Faizah and Din own the car ABZ-88


4. By using the ”collection” value of the rdf : parseType attribute, give an RDF description that states the following: Faizah and Din own the car ABZ-88.



  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

WEB SEMANTIC LAB 1 (09.03.2016)

Question 1

Haneena and Co. has a telephone directory that records the first and last name, telephone number and email address of everyone working in the company. Departments are the main organizing unit of the company so the telephone directory is typically displayed in department order and shows for each department the contact phone and fax number and email address.
Create an XML file containing some directory data.



Question 2

a.  Give an XML-document (by not using attributes), which includes the information that the first name of a person is Adi, his last name is Maulud, and his professions are doctor, therapist and surgeon.



b.  Give the tree diagram of the document given in 2a.


c.  Modify the document given in exercise 1 such that the “first” and “last” are the attributes of the name element



Question 3

a.  Give an XML-document (by not using attributes), which includes the following information: the social security number (123456789A), the first name of a person is Adha, and his last name is Hadif, his address is composed of postcode (86400), city (Batu Pahat) and street (Jalan Puding), and his telephone numbers are 12345 and 67890.



b.  Give the tree diagram of the document given in exercise 3a.


c.  Give a DTD (Document Type Definition) for the XML-document specified  in 3a.



d.  Give an XML Schema for the information specified  in exercise 3a.



  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS