際際滷

際際滷Share a Scribd company logo
BuildingOWLOntologieswithProtege
CS431April9,2008
CarlLagozeCornellUniversity
Parts extracted with permission from:
Parts extracted with permission from:
Resources
≒ Prot辿g辿hJp://protege.stanford.edu/
 GeneralopensourceontologymodelingsystemwithOWLplugin
 Usethe3.4beta
 MulSplepluginsareavailable,downloadfull
≒ PellethJp://pellet.owldl.com/
 OpensourceOWLDLreasoner
 Serverbased(DIGprotocolport8081)
 Integrateswith永姻看岳辿乙辿O安晦油
Resources(2)
≒ COODEResourceshJp://www.coode.org/
Prot辿g辿OWLTutorialhJp://www.coode.org/
resources/tutorials/protegeowltutorial.php
Tutorial:APracScalIntroducSontoOntologies&
OWLhJp://www.coode.org/resources/
tutorials/intro/
WhatisanOntology?
≒ Aformalspeci鍖caSonofconceptualizaSon
sharedinacommunity
≒ Vocabularyforde鍖ningasetofthingsthat
existinaworldview
≒ FormalizaSonallowscommunicaSonacross
applicaSonsystemsandextension
≒ Globalvs.Domainspeci鍖c
ComponentsofanOntology
≒ Vocabulary(concepts)
≒ Structure(aJributesofconceptsandhierarchy)
≒ RelaSonshipsbetweenconcepts
≒ LogicalcharacterisScsofrelaSonships
DomainandrangerestricSons
ProperSesofrelaSons(symmetry,transiSvity)
CardinalityofrelaSons
etc.
Someguidingrulesofontologydesign
≒ Inmostcasestherearemanywaystomodeladomain
≒ Ontologydevelopment,likeprogramdevelopment,is
bynatureiteraSve
≒ Theontologyshouldcloselycorrespondtotheobjects
(nouns)andrelaSonships(verbs)inthesentences
describingyourdomainofinterest
≒ WhenbuildinganontologyweneedanapplicaSonin
mindontologiesshouldnotbebuiltforthesakeofit
≒ KeeptheapplicaSoninmindwhencreaSngconcepts
thisshouldhelpyouscopetheproject
OurApplicaSon
www.co-ode.org/downloads/pizzafinder/
OntologyDesignisnontrivial
≒ di鍖erentviewpoints
 TomatoVegetableorFruit?
 culinaryvsbiological
≒ Ambiguity
 wordsnotconcepts
≒ MissingKnowledge
 Whatispeperonata?
≒ mulSpleclassi鍖caSons(2+parents)
≒ lotsofmissingcategories(superclasses?)
≒ competencyquesSons
 Whatarewelikelytowanttoaskourontology?
 beartheapplicaSoninmind
OWLConstructs:
Classes
EgMammal,Tree,Person,Building,Fluid,Company
≒ ClassesaresetsofIndividuals
≒ akaType,Concept,Category
≒ MembershipofaClassisdependentonitslogicaldescripSon,notitsname
≒ Classesdonothavetobenamedtheycanbelogicalexpressionseg
thingsthathavecolorBlue
≒ AClassshouldbedescribedsuchthatitispossibleforittocontain
Individuals(unlesstheintenSonistorepresenttheemptyclass)
≒ ClassesthatcannotpossiblycontainanyIndividualsaresaidtobe
inconsistent
OWLConstructs:ProperSes
EghasPart,isInhabitedBy,isNextTo,occursBefore
≒ ProperSesareusedtorelateIndividuals
≒ WeohensaythatIndividualsarerelatedalongagiven
property
≒ RelaSonshipsinOWLarebinary:
 SubjectpredicateObject
 IndividualahasPropertyIndividualb
 nick_drummondgivesTutorialManchester_ProtegeOWL_tutorial_29_June_2005
OWLConstructs:Individuals
Egme,you,thislecture,thisroom
≒ Individualsaretheobjectsinthedomain
≒ akaInstance,Object
≒ Individualsmaybe(andarelikelytobe)a
memberofmulSpleClasses
ComponentsofOWLOntologies:
Individuals
Unique name assumption: Two individuals are not equivalent
(even if ids are different) unless explicitly stated so (open world)
ComponentsofOWLOntologies:
ProperSesamongIndividuals
ComponentsofOWLOntologies:Classes,
ProperSes,andIndividuals
≒All individuals must be in a class
≒Define sets of individuals
永姻看岳辿乙辿O安晦油
ClassHierarchySubsumption hierarchy
Structure as asserted by the ontology engineer
owl:Thing is the root class
SubsumpSon
≒ Superclass/subclassrelaSonship,isa
≒ Allmembersofasubclasscanbeinferredtobemembersofits
superclasses
owl:Thing: superclass of all OWL Classes
B
A
≒A subsumes B
≒A is a superclass of B
≒B is a subclass of A
≒All members of B are also
members of A
Defined explicitly or inferred by
a reasoner
Disjointness
≒ OWLassumesthatclassesoverlap
MeatTopping VegetableTopping
= individual
財This means an individual could be both a MeatTopping and a
VegetableTopping at the same time
財We want to state this is not the case
Disjointness
≒ Ifwestatethatclassesaredisjoint
MeatTopping VegetableTopping
= individual
財This means an individual cannot be both a MeatTopping and
a VegetableTopping at the same time
財We must do this explicitly in the interface
ClassesTab:DisjointsWidget
Add siblings as disjoint
Add new disjoint Remove disjoint siblings
List of disjoint classes
RestricSons
≒ WehavecreatedarestricSon:hasBasePizzaBase
onClassPizzaasanecessarycondiSon
財If an individual is a member of this class, it is necessary that it
has at least one hasBase relationship with an individual from the
class PizzaBase
Pizza PizzaBase
財Every individual of the Pizza class must have at least one base
from the class PizzaBase
Whatdoesthismean?
≒ WehavecreatedarestricSon:hasBasePizzaBase
onClassPizzaasanecessarycondiSon
Pizza PizzaBase
財There can be no individual, that is a member of this class, that
does not have at least one hasBase relationship with an
individual from the class PizzaBase
 hasBase
PizzaBase
Why?
≒ WehavecreatedarestricSon:hasBasePizzaBase
onClassPizzaasanecessarycondiSon
PizzaBase
財 Each Restriction or Class Expression describes the set of all
individuals that satisfy the condition
Pizza
Why?NecessarycondiSons
≒ WehavecreatedarestricSon:hasBasePizzaBase
onClassPizzaasanecessarycondiSon
財Each necessary condition on a class is a superclass of that class
PizzaBase
 hasBase
PizzaBase
財ie The restriction  hasBase PizzaBase is a superclass of Pizza
財As Pizza is a subclass of the restriction, all Pizzas must satisfy
the restriction that they have at least one base from PizzaBase
ConsistencyChecking
≒ Createaclassthatdoesntreallymakesense
 WhatisaMeatyVegetableTopping?
≒ Wedliketobeabletocheckthelogicalconsistencyof
ourmodel
≒ ThisisoneofthetasksthatcanbedoneautomaScally
bysohwareknownasaReasoner
≒ Beingabletouseareasonerisoneofthemain
advantagesofusingalogicbasedformalismsuchas
OWL(andwhyweareusingOWLDL)
Reasoners
≒ ReasonersareusedtoinferinformaSonthatis
notexplicitlycontainedwithintheontology
≒ Youmayalsohearthembeingreferredtoas
Classi鍖ers
≒ Standardreasonerservicesare:
ConsistencyChecking
SubsumpSonChecking
EquivalenceChecking
InstanSaSonChecking
ReasonersandProt辿g辿
≒ 永姻看岳辿乙辿O安晦油supportstheuseofreasonersimplemenSngthe
DIGinterface
≒ Thismeansthatthereasoneryouchooseisindependentof
theontologyeditor,soyoucanchoosetheimplementaSon
youwantdependingonyourneeds(egsomemaybemore
opSmisedforspeed/memory,othersmayhavemorefeatures)
≒ Thesereasonerstypicallysetupaservicerunninglocallyoron
aremoteserver永姻看岳辿乙辿O安晦油canonlyconnecttoreasoners
overanhJp://connecSon
≒ WewillusePellet
AccessingtheReasoner
Classify taxonomy
(and check consistency)
Just check consistency
(for efficiency)
Compute inferred types
(for individuals)
ReasoningaboutourPizzas
≒ WhenweclassifyanontologywecouldjustusetheCheckConsistency
bu;onbutwellgetintothehabitofdoingafullclassi鍖ca>onaswellbe
doingthislater
≒ Thereasonerdialogwillpopupwhilethe
reasonerworks
≒ Whenthereasonerhas鍖nished,youwillseeaninferredhierarchy
appear,whichwillshowanymovementofclassesinthehierarchy
≒ Ifthereasonerhasinferredanythingaboutourmodel,thisisreportedin
thereasonerdialogandinaseparateresultswindow
≒ inconsistentclassesturnred
≒ movedclassesturnblue
PrimiSveClasses
≒ PrimiSveClass=onlyNecessaryCondiSons
≒ CannotyetjudgeanindividualbasedonprimiSve
classeswhy?
Start with
building a
disjoint tree of
primitive
classes
Polyhierarchies
≒ WewanttocreateaVegetarianPizza
≒ SomeofourexisSngPizzasshouldbetypesof
VegetarianPizza
≒ However,theycouldalsobetypesofSpicyPizzaor
CheeseyPizza
≒ WeneedtobeabletogivethemmulSpleparentsina
principledway
≒ WecouldjustassertmulSpleparentslikewedidwith
MeatyVegetableTopping(withoutdisjoints)
BUT
AssertedPolyhierarchies
InmostcasesasserSngpolyhierarchiesisbad
let the reasoner do it!
財We lose some encapsulation of knowledge
財Why is this class a subclass of that one?
財Difficult to maintain
財Adding new classes becomes difficult because all subclasses may
need to be updated
財Extracting from a graph is harder than from a tree
CheeseyPizza
≒ ACheeseyPizzaisanypizzathathassome
cheeseonit
≒ Wewouldexpectthen,thatsomepizzas
mightbenamedpizzasandcheeseypizzas
(amongotherthingslateron)
≒ Wecanusethereasonertohelpus
producethispolyhierarchywithouthaving
toassertmulSpleparents
CreaSngaCheeseyPizza
≒ WenormallycreateprimiSveclassesandthenmigratethemtode鍖ned
classes
≒ Allofourde鍖nedpizzaswillbedirectsubclassesofPizza
≒ So,wecreateaCheesyPizzaClass(donotmakeitdisjoint)andadda
restricSon:
EveryCheeseyPizzamusthaveatleastoneCheeseTopping
≒ ClassifyingshowsthatwecurrentlydonthaveenoughinformaSontodoany
classi鍖caSon
財 We then move the conditions
from the Necessary block to
the Necessary & Sufficient
block which changes the
meaning
財 And classify again
ReasonerClassi鍖caSon
≒ ThereasonerhasbeenabletoinferthatanythingthatisaPizzathat
hasatleastonetoppingfromCheeseToppingisaCheeseyPizza
財The inferred hierarchy is
updated to reflect this and
moved classes are highlighted
in blue
Why?
Necessary&Su鍖cientCondiSons
財 Eachsetofnecessary&su鍖cientcondiSonsisanEquivalentClass
財 CheeseyPizza is equivalent to the intersection of Pizza and  hasTopping
CheeseTopping
財 Classes, all of whose individuals fit this definition are found to be subclasses of
CheeseyPizza, or are subsumed by CheeseyPizza
Pizza
 hasTopping
CheeseTopping
CheeseyPizza
Untangling
≒ WecanseethatcertainPizzasarenow
classi鍖edundermulSpleparents
≒ MargheritaPizzacanbefoundunderboth
NamedPizzaandCheeseyPizzainthe
inferredhierarchy
Mission Successful!
Untangling
≒ However,ourunclassi鍖edversionofthe
ontologyisasimpletree,whichismucheasier
tomaintain
≒ Wevenowgotapolyhierarchywithout
asserSngmulSplesuperclassrelaSonships
≒ Plus,wealsoknowwhycertainpizzashave
beenclassi鍖edasCheeseyPizzas
Untangling
≒ Wedontcurrentlyhavemanykindsof
primiSvepizzabutitseasytoseethatifwe
had,itwouldhavebeenasubstanSaltaskto
assertCheeseyPizzaasaparentoflots,ifnot
all,ofthem
≒ Andthendoitalloveragainforotherde鍖ned
classeslikeMeatyPizzaorwhatever
Viewingpolyhierarchies
≒ Aswenowhave
mulSple
inheritance,the
treeviewisless
thanhelpfulin
viewingour
hierarchy
閣庄艶敬庄稼乙油看顎姻油堰庄艶姻温姻界鞄霞油赫姻温沿鞄庄界温鉛鉛霞油
OWLVizTab
Polyhierarchy
tangle
View Inferred ModelView Asserted Model
Show All Classes
UsingOWLViztountangle
≒ Theassertedhierarchyshould,ideally,bea
SdytreeofdisjointprimiSves
≒ Theinferredhierarchywillbetangled
≒ Byswitchingfromtheassertedtotheinferred
hierarchy,itiseasytoseethechangesmade
bythereasoner
≒ OWLVizcanbeusedtospottanglesinthe
primiSvetreeandalsodisjoints(including
inheritedones)aremarked(witha測)
De鍖nedClasses
≒ WevecreatedaDe鍖nedClass,CheeseyPizza
 Ithasade鍖niSon.ThatisatleastoneNecessaryandSu鍖cientcondiSon
 Classes,allofwhoseindividualssaSsfythisde鍖niSon,canbeinferredtobe
subclasses
 Therefore,wecanuseitlikeaquerytocollectsubclassesthatsaSsfyitscondiSons
 Reasonerscanbeusedtoorganisethecomplexityofourhierarchy
≒ Itsmarkedwithanequivalencesymbolintheinterface
≒ De鍖nedclassesarerarelydisjoint
De鍖neaVegetarianPizza
≒ Notaseasyasitlooksβ
≒ De鍖neinwords?
apizzawithonlyvegetariantoppings?
apizzawithnomeat(or鍖sh)toppings?
apizzathatisnotaMeatyPizza?
≒ Morethanonewaytomodelthis
Well start with the first example
De鍖neaVegetarianPizza
Tobeabletode鍖neavegetarianpizzaas
aPizzawithonlyVegetarianToppings
weneed:
1. Tobeabletocreateavegetariantopping
ThisrequiresaUnionClass
2. Tobeabletosayonly
ThisrequiresaUniversalRestricSon
≒ akadisjuncSon
≒ ThisORThatORTheOther
≒ ThisThatTheOther
UnionClasses
財Commonly used for:
財 Covering axioms
財 Closure
A
B
A B includes all
individuals of class A and
all individuals from class B
and all individuals in the
overlap (if A and B are not
disjoint)
CoveringAxioms
≒ Coveringaxiomaunionexpressioncontainingseveralcovering
classes
≒ AcoveringaxiomintheNecessary&Su鍖cientCondiSonsofaclass
means:
theclasscannotcontainanyinstancesotherthanthosefromthe
coveringclasses
≒ NB.Ifthecoveringclassesaresubclassesofthecoveredclass,the
coveringaxiomonlyneedstobeaNecessarycondiSonitdoesnt
harmtomakeitNecessary&Su鍖cientthoughitsjustredundant
CoveringPizzaBase
≒ Inthisexample,theclassPizzaBaseis
coveredbyThinAndCrispyor
DeepPan
≒ AllPizzaBasesmustbe
ThinAndCrispyorDeepPan
≒ Therearenoothertypesof
PizzaBase
PizzaBase
DeepPan
ThinAndCrispy
PizzaBase  ThinAndCrispy DeepPan
UniversalRestricSons
≒ WeneedtosayourVegetarianPizzacanonly
havetoppingsthatarevegetariantoppings
≒ WecandothisbycreaSngaUniversalor
AllValuesFromrestricSon
≒ 安艶l鉛油鍖r壊岳油鉛看看一油温岳油温稼油艶恰温馨沿鉛艶β
RealItalianPizzas
≒ RealItalianPizzasonlyhavebasesthatare
ThinAndCrispy
≒ AUniversalRestricSonis
addedjustlikean
ExistenSalone,butthe
restricSontypeisdi鍖erent
≒ Fornow,thiscanbeprimiSveyoucanmakeit
de鍖nedifyoulike
Whatdoesthismean?
財If an individual is a member of this class, it is necessary that it
must only have a hasBase relationship with an individual from
the class ThinAndCrispy
RealItalianPizza ThinAndCrispy
財We have created a restriction:  hasBase ThinAndCrispy on
Class RealItalianPizza as a necessary condition
Whatdoesthismean?
DeepPan RealItalianPizza ThinAndCrispy
財No individual of the RealItalianPizza class can have a base
from a class other than ThinAndCrispy
財NB. DeepPan and ThinAndCrispy are disjoint
財We have created a restriction:  hasBase ThinAndCrispy on
Class RealItalianPizza as a necessary condition
Warning:TrivialSaSsfacSon
RealItalianPizza ThinAndCrispy
財If an individual is a member of this class, it is necessary that it
must only have a hasBase relationship with an individual from
the class ThinAndCrispy, or no hasBase relationship at all
Trivially
satisfied
by this
individual
財Universal Restrictions by themselves do not state at least one
財If we had not already inherited:  hasBase PizzaBase
from Class Pizza the following could hold
VegetarianPizzaClassi鍖caSon
≒ Nothingclassi鍖esunderVegetarianPizza
≒ Actually,thereisnothingwrongwithourde鍖niSonofVegetarianPizza
≒ ItisactuallythedescripSonsofourPizzasthatareincomplete
≒ ThereasonerhasnotgotenoughinformaSontoinferthatanyPizzais
subsumedbyVegetarianPizza
≒ ThisisbecauseOWLmakestheOpenWorldAssumpSon
OpenWorldAssumpSon
≒ Inaclosedworld(likeDBs),theinformaSonwehaveiseverything
≒ Inanopenworld,weassumethereisalwaysmoreinformaSonthanis
stated
≒ Whereadatabase,forexample,returnsanegaSveifitcannot鍖ndsome
data,thereasonermakesnoassumpSonaboutthecompletenessofthe
informaSonitisgiven
≒ Thereasonercannotdeterminesomethingdoesnotholdunlessitis
explicitlystatedinthemodel
OpenWorldAssumpSon
≒ TypicallywehaveapaJernofseveralExistenSal
restricSonsonasinglepropertywithdi鍖erent
鍖llerslikeprimiSvepizzasonhasTopping
≒ ExistenSalrestricSonsshouldbeparaphrasedby
amongstotherthings
≒ MuststatethatadescripSoniscomplete
≒ Weneedclosureforthegivenproperty
Closure
≒ ThisisintheformofaUniversalRestricSon
witha鍖llerthatistheUnionoftheother
鍖llersforthatproperty
≒ Closureworksalongasingleproperty
Closureexample:MargheritaPizza
 AllMargheritaPizzasmusthave:
  atleast1toppingfromMozzarellaToppingand
  atleast1toppingfromTomatoToppingand
  onlytoppingsfromMozzarellaToppingorTomatoTopping
≒ Thelastpartisparaphrasedintonoothertoppings
≒ TheunionclosesthehasToppingpropertyonMargheritaPizza

More Related Content

Lecture 4-09-08