Creating an Ontology Using Protege

Lasith Jayalath
5 min readAug 2, 2019

1. Introduction

This ontology is created based on the pens produced by Atlas Sri Lanka to the market. The designed ontology contains information regarding the pen body type, pen grip, pen ink type, pen ink color and pen tip. Our main intention with this ontology is to help customers to find the most suitable Atlas pen for their requirements. With this intention we have developed a desktop application where the pen details can be queried with respect to pen body type, pen grip, type of ink, color of ink and pen tip.

2. Class Hierarchy

2.1. Classes and Subclases

2.1.1. Classes

This ontology contains five classes in total.

1. Pen

2. Pen Body

3. Pen Grip

4. Pen Ink

5. Pen Tip

Classes

2.1.2. Subclasses

Under the 5 classes listed above there are 45 subclasses.

Subclasses of Pen — A pen has a Pen Type and Pen Type is further divided in to Gel Pen and Ball Point Pen. Then Gel Pens are again divided in to 2 as Chooty Gel and Stylus Gel. And Ball Point Pen is divided in to 5 as Butter Gel, Chooty, Chooty T, Cool and Nano.

Subclasses of Pen

Subclasses of Pen Body — Pen Body is divided in to two subclasses as Circular Pen Body and Triangular Pen Body.

Subclasses of Pen Body

Subclasses of Pen Grip — Pen Grip is divided in to two subclasses as Rubber Grip and Textured Grip.

Subclasses of Pen Grip

Subclasses of Pen Ink — Pen Ink is divided in to two subclasses as Pen Ink Color and Pen Ink Type. Pen Ink Color is further divided in to ten colors and Pen ink Type is divided in to two as Viscous Ink and Water Based Ink. Viscous Ink is again divided in to two as German Ink and Ultra Low Viscosity Ink. And Water Based Ink is again divided in to two as Pigment Based Japanese Ink and Supper Fluid Ink.

Subclasses of Pen Ink

Subclasses of Pen Tip — Pen Tip has Pen Tip Material and it is divided in to two as Alloy Tip and Metallic Tip. Alloy Tip is divided in to 5 as German Silver Tip, Osmium Tip, Ruthenium Tip, Stainless Steel Tip and Tungsten Tip. And Metallic Tip is also divided in to 7 as Brass Tip, Copper Tip, Gold Tip, Iron Tip, Nickel Tip, Platinum Tip and Silver Tip.

Subclasses of Pen Tip

2.2. Primitive and Defined Classes

2.2.1. Primitive Classes

This type of classes contains only the necessary conditions. These primitive classes have at least one feature which will clearly separate the subclasses under each primitive class.

In our ontology Pen Body, Pen Grip, Pen Ink, Pen Type and Pen Tip can be categorized as primitive classes.

Primitive Classes

2.2.2. Defined Classes

These type of classes have set of necessary and sufficient conditions. In the ontology these classes are restricted under the under the equivalent conditions.

The class pen has three defined classes

1. Bold Tip Pen

2. Medium Tip Pen

3. Micro Tip pen

Defined Classes

3. Properties

3.1. Object Properties

This pen ontology has 5 object properties and each of them have inverse object properties too.

Object Properties

3.1.1. Domain and Range

3.1.2. Functional Properties

These properties can be connected to an instance only once. Following are the functional properties available in our pen ontology.

1. hasPenBody

2. hasPenGrip

3. hasPenInkColor

4. hasPenInkType

5. hasPenTip

Functional Properties

3.2. Data Properties

This Pen Ontology has used one data property. Here it will connect class/instance to specific data value.

Data Properties

4. Individuals

Individual axiom is used to define individuals. In this pen ontology we have defined 26 individuals for the pen types.

As an example for the pen type Atlas Chooty there are three pens depending on the color as Chooty blue, Chooty black and Chooty. Therefore we have created three individuals for Pen Type Chooty.

Individuals

5. Interfaces

Created a desktop interface to retrieve and to represent data. This interface allows a user to enter his requirements with regard to pen body, pen grip, ink type, color and pen tip material. And it will sort the pen which matches the requirements from the ontology and will display that output.

Initial Interface
When Pen Tip Material is Selected
When a Pen is Available for the Selected Requirements
When a Pen is not Available for the Given Requirements

6. Querying

Desktop application works by querying the pen ontology with SPARQL queries. We have used two SPARQL queries to retrieve data from the ontology to the application.

6.1. Query 1

This query will retrieve the relevant Atlas pen with regard to the specified pen body, pen grip, ink type, color and pen tip material.

If there is no pen type available for the specified fields it will output “Not Available”.

Query 1

6.2. Query 2

When we consider the Pen Tip material, it is divided in to two as Alloy and Metallic. There are several Alloys and metals listed under Alloy and Metallic respectively but they are not listed under pen tip material. In order to display all kinds of alloys and metals we use a SPRKQL query to sort them from the ontology.

Query 2

--

--

Lasith Jayalath

Software Engineer | WSO2 | Faculty of Information Technology | University of Moratuwa| Richmondite