Protégé-OWL TutorialThis sessionLoading OWL files from scratchPrimitive ClassesDescribing Primitive Pizza ClassesPolyhierarchiesVegetarian Pizza attempt 1Reasoning about our PizzasAttempting againAsserted PolyhierarchiesDefined ClassesDescribing a MeatyPizzaDefining a MeatyPizzaReasoner ClassificationViewing our Hierarchy GraphicallyOWLViz TabHow do we Define a Vegetarian Pizza?Defining a Vegetarian ToppingClass Constructors: UnionCovering AxiomsVegetarian Pizza attempt 2Open World AssumptionClosureClosing Pizza DescriptionsOther Definitions of Veggie PizzasSlide 26Slide 27Properties: Domain and RangeSlide 29Properties: Functional PropertiesOther Exercises: Create an InterestingPizzaOther Exercises: Define RealItalianPizzaOther ExercisesSummaryYour Pizza FinderThe Software2nd Feb 2005Protege-OWL tutorial, © 2005 Univ. of Manchester1Protégé-OWL TutorialSession 2: Defined ClassesNick Drummond2nd Feb 2005Protege-OWL tutorial, © 2005 Univ. of Manchester2This session►Issue: Primitive Classes & Polyhierarchies►Advanced: Creating Defined Classes►Reasoner: Classifying►Union Classes: Covering Axioms►Example: Creating a Vegetarian Pizza►Issue: Open World Assumption►Union Classes: Closure2nd Feb 2005Protege-OWL tutorial, © 2005 Univ. of Manchester3Loading OWL files from scratch1. If you’ve only got anOWL file:Select “OWL Files” as theProject Format, then “Build”to select the .owl file2. If you’ve got a valid project file*:Select “OWL Files” as the Project Format, and then “Open Other” to find the .pprj file (if you’ve already opened it, it will be in “Open Recent”)3. Open C:\Protégé_3.0_beta\examples\pizzas\pizzas2_0.owl* Ie one created on this version of Protégé - the s/w gets updated once every few days, so don’t count on it unless you’ve created it recently– safest to build from the .owl file if in doubtRun Protégé.exe2nd Feb 2005Protege-OWL tutorial, © 2005 Univ. of Manchester4Primitive Classes►All classes in our ontology so far are Primitive ►We describe primitive pizzas►Primitive Class = only Necessary Conditions►They are marked as yellow in the class hierarchyWe condone building a disjoint tree of primitive classes2nd Feb 2005Protege-OWL tutorial, © 2005 Univ. of Manchester5Describing Primitive Pizza Classes1. Create a new pizza under NamedPizzaeither choose from the menu or make it up2. Create a new Existential (SomeValuesFrom) Restriction with the hasTopping property and a filler from PizzaTopping (eg HamTopping)3. Add more Restrictions in the same way to complete the descriptioneach restriction is added to an intersection –so a Pizza must have toppingA and must have toppingB etcsee MargheritaPizza for an example4. Create another pizza that has at least one meat ingredientremember disjointsStart with pizzas2_0.owl2nd Feb 2005Protege-OWL tutorial, © 2005 Univ. of Manchester6Polyhierarchies►By the end of this tutorial we intent to create a VegetarianPizza►Some of our existing Pizzas should be types of VegetarianPizza►However, they could also be types of SpicyPizza or CheeseLoversPizza►We need to be able to give them multiple parents2nd Feb 2005Protege-OWL tutorial, © 2005 Univ. of Manchester7Vegetarian Pizza attempt 11. Create a new pizza called “VegetarianPizza” under Pizzamake this disjoint from its siblings as we have been doing2. Select MargheritaPizzayou will notice that it only has a single parent, NamedPizza3. Add VegetarianPizza as a new parent using the conditions widget “Add Named Class” buttonwe have asserted that MargheritaPizza has 2 parentsStart with pizzas2_1.owl2nd Feb 2005Protege-OWL tutorial, © 2005 Univ. of Manchester8Reasoning about our Pizzas1. Start RACER2. Classify your ontologyYou will see an inferred hierarchy appear, whichwill show any movement of classes in thehierarchyYou will also see a results window appear at thebottom of the screen which describes the resultsof the reasonerStart with your existing ontologyMargheritaPizza turns out to be inconsistent – why?Remember MeatyVegetableTopping?2nd Feb 2005Protege-OWL tutorial, © 2005 Univ. of Manchester9Attempting again1. Remove the disjointbetween VegetarianPizza and its siblingsWhen prompted, choose to remove only between this class and its siblings2. Re-Classify your ontologyThis should now be accepted by the reasoner with no inconsistenciesClose the inferred hierarchy and results2nd Feb 2005Protege-OWL tutorial, © 2005 Univ. of Manchester10Asserted Polyhierarchies►We believe asserting polyhierarchies is badlet the reasoner do it!►We lose some encapsulation of knowledge►Difficult to maintain2nd Feb 2005Protege-OWL tutorial, © 2005 Univ. of Manchester11Defined Classes►Have a definition. That is at least one Necessary and Sufficient condition►Are marked in orange in the interface►Classes, all of whose individuals satisfy this definition, can be inferred to be subclasses►Reasoners can perform this inference2nd Feb 2005Protege-OWL tutorial, © 2005 Univ. of Manchester12Describing a MeatyPizza1. Create a subclass of Pizza called MeatyPizzaDon’t put in the disjoints or you’ll get the same problems as beforeIn general, defined classes are not disjoint from siblings2. Add a restriction to say:“Every MeatyPizza must have at least one meat topping”3. Classify your ontologyWhat happens?Start with your existing ontology, close the reasoner panes2nd Feb 2005Protege-OWL tutorial, © 2005 Univ. of Manchester13Defining a MeatyPizza1. Click and drag your hasTopping MeatTopping restriction from “Necessary” to “Necessary & Sufficient”The MeatyPizza class now turns orange, denoting that it is now a defined class2. Click and drag the Pizza Superclass from “Necessary” to “Necessary & Sufficient” Make sure when you release you are on top of the existing restriction otherwise you will get 2 sets of conditions.You should have a single orange icon on the right stretching across both conditions like this…3. Classify your ontologyWhat happens?Start with your existing ontology, close the reasoner panes2nd Feb 2005Protege-OWL tutorial, © 2005 Univ. of Manchester14Reasoner Classification►The reasoner has been able to infer that anything that is a Pizza that has at least one topping from MeatTopping is a MeatyPizza►Therefore, classes fitting this definition are found to be subclasses of MeatyPizza, or are subsumed by MeatyPizza►The inferred hierarchy is updated to reflect this and moved
View Full Document