Protege Tutorial Based on Protege OWLTutorial at protege
Protege Tutorial Based on Protege. OWLTutorial at protege website
What is protege? l l l Protege is a free, open-source platform to construct domain models and knowledge-based applications with ontologies. Ontologies range from taxonomies, classifications, database schemas to fully axiomatized theories. Ontologies are now central to many applications such as scientific knowledge portals, information management and integration systems, electronic commerce and web services
Install Protege l l l Go to http: //protege. stanford. edu/doc/owl/gettingstarted. html to download protege (version 3. x) Protege OWL editor is built with the full installation of protege platform. During the install process, choose the “Basic+OWL” option. For more details: http: //protege. stanford. edu/doc/owl/gettingstarted. html
Protege l There are two main ways of modelling ontologies: l l l Frame-based OWL Each has its own user interface l Protege Frames editor: enables users to build and populate ontologies that are frame-based, in accordance with OKBC (Open Knowledge Base Connectivity Protocol). l l Classes Slots for properties and relationships Instances for class Protege OWL editor: enables users to build ontology for the Semantic Web, in particular to OWL l l Classes Properties Instances reasoning
Building an OWL Ontology l E 2: Create a new OWL project l l Start protege File – New Project – OWL/RDF files – Ontology URI (http: //www. pizza. com/ontologies/pizza. owl) – OWL DL – Properties View A new empty Protege-OWL project has been created. Save it in your local file as pizza. owl
Named Classes l l Go to OWL Classes tab The empty class tree contains one class called owl: Thing, which is superclass of everything. E 3: Create subclasses Pizza, Pizza. Topping and Pizza. Base. They are subclasses of owl: Thing. Naming convention l l no special naming convention consistency
Disjoint classes l E 4: How to say that Pizza, Pizza. Topping and Pizza. Base classes are disjoint. 1. Select the class Pizza 2. Press “add siblings” button on the disjoint classes widget 3. Add Pizza. Base and Pizza. Topping 4. Select the class Pizza. Topping, 5. Add Pizza and Pizza. Base to the disjoint class
E 5: Create group of classes l l Create Thin. And. Crisy. Base and Deep. Pan. Base as the subclasses of Pizza. Base, and each of them are disjointed. Select Pizza. Base, right click the mouse, select “create subclasses” Follow the wizard to create these two disjoint classes. It will save lots of time when there is need to create lots of disjoint classes.
E 6: Create some subclasses of Pizza. Topping l Select Pizza. Topping, l l Select the class Meat. Topping, l l Create subclaesses as Meat. Topping, Vegetable. Topping, Cheese. Topping and Seafood. Topping. Make sure that these classes are disjoint to each other. Add disjoint subclasses: Spicy. Beef. Topping, Pepperoni. Topping, Salami. Topping and Ham. Topping Select Vegetable. Topping: l Add disjoint subclasses: Tomato. Topping, Olive. Topping, Mushroom. Topping, Pepper. Topping, Onion. Topping, Caper. Topping
E 6: Creating disjoint subclasses l Select Pepper. Topping l l Select Cheese. Topping l l Add disjoint subclasses: Red. Pepper. Topping, Green. Pepper. Topping, Jalapeno. Pepper. Topping Add disjoint subclasses: Mozzarella. Topping, Parmezan. Topping Select Seafood. Topping l Add disjoint subclasses: Tuna. Topping, Anchovy. Topping and Prawn. Topping
OWL Properties l l OWL Properties represent relationships between two objects. There are two main properties: l l l Object properties: link object to object datatype properties: link object to XML Schema datatype or rdf: literal OWL has another property – Annotation properties, to be used to add annotation information to classes, individuals, and properties
E 7: Create an object property l l l Switch to the “Properties” tab, Use “Create Object Property” button to create a new object property. Rename it to has. Ingredient
E 8: Creating sub-properties l Select has. Ingredient property l Add has. Topping and has. Base as the subproperties
Inverse Properties l l Each object property may have a corresponding inverse property. If some property links individual a to individual b, then its inverse property will link individual b to individual a.
E 9: Create inverse properties l Create a new object property called is. Ingredient. Of l l Select has. Base l l l Press “Set inverse property” button, Select “has. Ingredient” Then the inverse relation has been set up. Create the is. Base. Of as the inverse property of has. Base is. Base. Of is the subproperty of is. Ingredient. Of, why? Select has. Topping l l create is. Topping. Of as the inverse property. is. Topping. Of is the subproperty of is. Ingredient. Of, why?
Functional Properties l If a property is functional, for a given individual, there can only be at most one individual to be related via this property. l l For a given domain, range must be unique Functional properties are also known as single valued properties.
Inverse Functional Properties l If a property is inverse functional, then its inverse property is functional. l For a given range, domain must be unique.
Functional vs. inverse functional properties l Functional. Property vs Inverse. Functional. Property domain range example Functional Property For a given domain Range is unique has. Father: A has. Father B, A has. Father C B=C Inverse. Functional Property Domain is unique For a given range has. ID: A has. ID B, C has. ID B A=C
Transitive Properties l If a property is transitive, and the property related individual a to individual b, and also individual b to individual c, then we can infer that individual a is related to individual c via property P.
Symmetric Properties l If a property P is symmetric, and the property relates individual a to individual b, then individual b is also related to individual a via property P.
E 10: Make the has. Ingredient property transitive l l l Select the has. Ingredient property Tick the transitive tick box Select the is. Ingredient. Of property, make sure that the transitive tick box is ticked.
E 11: Make the has. Base property functional l Select the has. Base property Tick the “functional” tick box OWL-DL does not allow datatype properties to be transitive, symmetric or have inverse properties.
Property domains and ranges l l Properties link individuals from the domain to individuals from the range. OWL uses domain and range as axioms in reasoning.
E 12: Specify the range of has. Topping l Select has. Topping l l l Press range button Select Pizza. Topping Press OK button Pizza. Topping should be displayed in the range list. When multiple classes are added to the range, they represent the union of all classes.
E 13: Specify Pizza as the domain of the has. Topping property l Select has. Topping property l l l Press add domain button Select Pizza Press OK Pizza is displayed in the domain list. When multiple classes are added as domain, they represent as the union of these classes.
E 14: Specify the domain and range for the is. Topping. Of property l l l Select the is. Topping. Of property Set the domain of the is. Topping. Of property to Pizza. Topping Set the range of the is. Topping. Of property to Pizza.
E 15: Specify the domain and range for the has. Base property and its inverse property is. Base. Of l Select the has. Base property l l l Specify the domain as Pizza Specify the range as Pizza. Base Select the is. Base. Of property l l Specify the domain as Pizza. Base Specify the range as Pizza
Property restrictions l l l In OWL, properties are used to create restrictions. Restrictions are used to restrict the individuals that belong to a class Three restrictions: l l l Quantifier restrictions l Existential quantifier ( l Universal quantifier ( Cardinality restrictions has. Value restrictions ) )
E 16: Add a restriction to Pizza l Add a restriction to Pizza that specifies a Pizza must have a Pizza. Base l l l Select Pizza Select Necessary header to create a necessary condition Select create a restriction wizard l l l Select has. Base as restricted property Select some. Value. From as restriction Put Pizza. Base into the filler
Add a restriction to Pizza
E 18: Creating different kinds of Pizzas l l Create a subclass of Pizza called Named. Pizza, and a subclass of Named. Pizza called Margherita. Pizza. Add comment to Margherita. Pizza: A pizza that only has Mozarella and Tomato toppings
E 19: Adding restrictions to Margherita. Pizza l To specify that Margherita. Pizza has at least one Mozzarella. Topping. l l l Select Margherita. Pizza Go to “Asserted Conditions”, create new restriction. Select some. Value. From Select has. Topping as the property to be restricted. Enter Mozzarella. Topping as the filler Press OK button
E 20: Adding restrictions to Margherita. Pizza l To specify that Margherita. Pizza has at least one Tomato. Topping. l l l Select Margherita. Pizza Go to “Asserted Conditions”, create new restriction. Select some. Value. From Select has. Topping as the property to be restricted. Enter Tomato. Topping as the filler Press OK button
E 21: Create American. Pizza l l Create American. Pizza with toppings of pepperoni, mozzarella and tomato. Through cloning and modifying the description of Margherita. Pizza. l l l Select Margherita. Pizza Select create clone Add additional restriction to Americana. Pizza l l Adding Pepperoni. Topping Press OK.
E 22: Create an American. Hot. Pizza and a Soho. Pizza l l An American. Hot. Pizza is almost the same as an Americana. Pizza, but has Jalapeno. Pepper. Topping on it. A Soho. Pizza is almost the same as a Margherita. Pizza, but has additional Olive. Topping and Parmezan. Topping
E 23: Make subclasses of Named. Pizza disjoint from each other l l Select Margherita. Pizza Press “add all siblings” button on the “Disjoints widget” to make the pizzas disjoint from each other.
Using a reasoner l l l Ontology described in OWL-DL can be processed by a reasoner. l Go to owl—preference, to make sure that OWL-DL is selected. The main services offered by a reasoner is to test whether or not one class is a subclass of another class. By performing such tests on all of the classes, it is possible for a reasoner to compute the inferred ontology class hierarchy. Another reasoning service is consistency checking – to check whether or not it is possible for the class to have any instances. A class is deemed to be inconsistent if it cannot possibly have any instances.
Using Racer l l In order to reason over the ontology in Protege-OWL, a DIG compliant reasoner should be installed and started. In this tutorial, we use Racer, l l Download at: http: //www. racersystems. com/products/download/index. phtml Double click Racer. Pro to start Racer.
Invoking the reasoner l l l Having started Racer, the ontology can be sent to the reasoner to automatically compute the classification hierarchy, and also check the logical consistency of the ontology. In Protege, the manually constructed class hierarchy is called the asserted hierarchy. The automatically computed by the reasoner is called the inferred hierarchy. Go to OWL – classify taxonomy – to invoke the reasoner l If a class has been reclassified, then the class name will appear in a blue color in the inferred hierarchy. Go to OWL – Check consistency – to invoke the reasoner l If a class has been found to be inconsistent, it’s icon will be circled in red color. Computing the inferred class hierarchy is also known as classifying the ontology.
Invoke the reasoner
E 24: Inconsistent classes l In order to demonstrate the use of the reasoner to detect inconsistencies in the ontology, we will create a class Probe. Inconsistent. Topping, l l l Which is the subclass of Cheese. Topping Select Probe. Inconsistent. Topping, go to asserted condition to add named classes, select Vegetable. Topping and then press OK. Go to OWL – check consistency
E 25: Classify the ontology again l To see Probe. Inconsistent. Topping is inconsistent.
E 26: Remove the disjoint statement l Between Cheese. Topping and Vegetable. Topping to see what happens l l l Select Cheese. Topping Go to Disjoint part Select Vegetable. Topping, right click and “Delete the selected row”. Classify taxonomy The inconsistency no longer exists.
E 27: Fix the ontology l By making Cheese. Topping and Vegetable. Topping disjoint from each other.
Resources l Protege Ontology Libraries l l Protege tutorial l l http: //protegewiki. stanford. edu/index. php/Protege _Ontology_Library http: //www. co-ode. org/resources/tutorials/ Protege Website l l http: //protege. stanford. edu/doc/users. html http: //protege. stanford. edu/
- Slides: 46