protege構建本體教程課件_第1頁
protege構建本體教程課件_第2頁
protege構建本體教程課件_第3頁
protege構建本體教程課件_第4頁
protege構建本體教程課件_第5頁
已閱讀5頁,還剩93頁未讀, 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

protege構建本體教程1Aprotege構建本體教程1A1.什么是本體(Ontologie)Ontologiesareusedtocaptureknowledgeaboutsomedomainofinterest.

本體是用來獲得你所感興趣的領域的知識;2A1.什么是本體(Ontologie)Ontologiesa2.OWLOntologiesThemostrecentdevelopmentinstandardontologylanguagesisOWLfromtheWorldWideWebConsortium(W3C)由w3c從斯坦福大學的本體語言發展而來的。3A2.OWLOntologiesThemostrecen

3.OWLOntologies的組成 OWLOntologies與基于Protegeframe的本體語言在組成上比較相似,但是從專業術語上來描述時他們又有著細微的不同。OWLOntologies是由個體(Individuals),屬性(Properties),類(Classes)組成,大致對應于Protegeframe的Instances,Slots,Classes.4A3.OWLOntologies的組成 OWLOntol3.1Individuals(個體)

指的是在域(domain)中我們感興趣的對象。類中的一個實例。 Individuals必須明確的聲明彼此之間是否相同。不同的名字可能指的是相同的Individuals。5A3.1Individuals(個體)5A3.2Properties(屬性)

指的是Individuals上二元關系,他連接著兩個Individuals。如:小三的父親叫大三。其中,“的父親叫”就連接著小三和大三兩個Individuals。 Properties可以存在reverse,如上所示,“的父親叫”的reverse就是“的兒子叫”。 Properties可以被限定成單值,此時Properties是functional的。(后面介紹) Properties也可以是transitive(可傳遞的)或symmetric(對稱的)(后面介紹)6A3.2Properties(屬性)6A3.3Classes

可以看作是包含Individuals的集合。

我們使用正式而精準的形式來描述Classes。Classes通常被組織成supperclass—subclass形式的層狀結構,比如,動物和狗。7A3.3Classes7A4創建本體myPizza(PizzaBase是Pizza結構之一,中文叫“餅底”,主要由面粉做成,是Pizza的主體,和pizzatoppings(比薩餅面)一起構成整個Pizza)8A4創建本體myPizza(PizzaBase是Pizza結4.1命名一個Classes(采用單詞首字母大寫方式,類似于java中類的命名)一個初始化的本體包含一個名字叫做Thing的classes,他表示包含所有individuals的集合,所以,所有的其他classes都是他的subclasses。9A4.1命名一個Classes(采用單詞首字母大寫方式,類似

4.2Disjoint(解體)Classes如果任意一個Individuals(或Object)僅僅是眾多Classes中某一個的實例(instance),那么這些Classes是Disjoint的。10A 4.2Disjoint(解體)Classes10A4.3UsingTheOWLToolsToCreateClasses

【PizzaBase子類ThinAndCrispy和DeepPan】PizzaTopping子類如下Cheese Mozzarella ParmezanMeat Ham Pepperoni Salami SpicyBeefSeaFood Anchovy Prawn TunaVegtable Caper Mushroom Olive Onion Pepper RedPepper GreenPepper JalapenoPepper Tomato11A4.3UsingTheOWLToolsToC4.4subclass到底是什么意思呢?例如“狗”是“動物”的subclass。那么“狗”的instance也是“動物”的instance,一個東西是狗,那么他一定是動物。(這和java中的子類父類貌似是一樣的)

12A4.4subclass到底是什么意思呢?例如“狗”是“動13A13A4.5.OWLProperties

(概述)OWLPropertiesrepresentrelationships.Therearetwomaintypesofproperties,ObjectpropertiesandDatatypeproperties.Objectpropertiesarerelationshipsbetweentwoindividuals.(先介紹Objectproperties)如下是Objectproperties和Datatypeproperties14A4.5.OWLProperties (概述)OWLPObjectpropertieslinkanindividualtoanindividual.【hasIngredien子hasBasehasTopping】

我們可以創建Subproperties,它用來限定Supperproperties的范圍。Forexample,thepropertyhasFathermightspecialise(限定范圍)themoregeneralpropertyofhasParent.小明有父親大明,那么我們也可以說小明的雙親有大明?!坝懈赣H”就是“有雙親”的subproperty。15AObjectpropertieslinkanindi4.6InverseProperties(逆屬性)【isIngredientOf子isBaseOfisToppingOf】如該例中::hasBase和isBaseOf就是一對InverseProperties

Forexample:ifMatthewhasParentJean,thentheinversepropertywecaninferthatJeanhasChildMatthew.16A4.6InverseProperties(逆屬性)164.7OWLObjectPropertyCharacteristics(特征)OWL允許通過使用propertycharacteristics來增強properties的含義(內涵)。17A4.7OWLObjectPropertyCha(1)FunctionalPropertiesIfapropertyisfunctional,foragivenindividual,therecanbeat mostoneindividualthatisrelatedtotheindividualviatheproperty.. 也就是說,Properties是單值的。例如::hasBirthMother

,這個就是functional的,因為一個人他只能有一個生母。18A(1)FunctionalPropertiesIfa另外::IfwesaythattheindividualJeanhasBirthMotherLilyandwealsosaythattheindividualJeanhasBirthMotherMary,thenbecausehasBirthMotherisafunctionalproperty,wecaninferthatLilyandMarymustbethesameindividual.但是如果Lily和Mary明確的聲明為兩個不同的Individuals,那么就會出現矛盾(inconsistency)。19A另外::19A

(2)InverseFunctionalProperties就是FunctionalProperties的inverse如下::20A (2)InverseFunctionalProper(3)TransitivePropertiesIfapropertyistransitive,andthepropertyrelatesindividualato individualb,andalsoindividualbtoindividualc,thenwecaninfer thatindividualaisrelatedtoindividualcviapropertyP.如下::注::

a)Ifapropertyistransitivethenitsinversepropertyshouldalsobetransitive.(祖先那個例子)b)

ifapropertyistransitivethenitcannotbefunctional.21A(3)TransitivePropertiesIfa(4)Symmetric(對稱)PropertiesIfapropertyPissymmetric,andthepropertyrelatesindividualatoindividualbthenindividualbisalsorelatedtoindividualaviapropertyP.如下::22A(4)Symmetric(對稱)PropertiesIf(5)Antisymmetric(反對稱)propertiesIfapropertyPisantisymmetric,andthepropertyrelatesindividualatoindividualbthenindividualbcannotberelatedtoindividualaviapropertyP.如下::23A(5)Antisymmetric(反對稱)propert(6)Re?exive(自反)propertiesApropertyPissaidtobere?exivewhenthepropertymustrelate individualatoitself.如下::24A(6)Re?exive(自反)propertiesAp(7)Irre?exive(非自反)propertiesIfapropertyPisirre?exive,itcanbedescribedasapropertythatrelatesanindividualatoindividualb,whereindividualaand individualbarenotthesame.也就是說,這種properties只能連接

不同的individuals。如::小明的父親是大明,那么我們不能說小明的父親是小明25A(7)Irre?exive(非自反)properties4.8PropertyDomainsandRanges【定義hasTopping的RangePizzaToppingdomainPizza】【定義isToppingOf的RangePizzadomainPizzaTopping】Propertiesmayhaveadomainandarangespeci?ed(指定的).Propertieslinkindividualsfromthedomaintoindividualsfromtherange.例如::inmyPizza本體,thepropertyhasToppingwouldprobablylinkindividualsbelongingthetheclassPizzatoindividualsbelongingtotheclassofPizzaTopping.InthiscasethedomainofthehasToppingpropertyisPizzaandtherangeisPizzaTopping。另外::如果有ahasToppingb

,并且a與b都是individuals,那么我們就可以說a屬于classPizza,b屬于classPizzaTopping。通常來說,domainforapropertyistherangeforitsinverse,andtherangeforapropertyisthedomainforitsinverse26A4.8PropertyDomainsandRange4.9描述和定義Classes4.9.1PropertyRestrictionsOwl的restriction有三種:QuantifierRestrictionsCardinalityRestrictionshasValueRestrictions.27A4.9描述和定義Classes4.9.1Property1.quantifierrestrictions(existentialrestrictions和universalrestrictions)

Existentialrestrictions

:describeclassesofindividualsthatparticipateinatleastonerelationshipalongaspeci?edpropertytoindividualsthataremembersofaspeci?edclass.例子::我至少(atleastone)買了一袋餅干從好又多超市。再比如::我做的蛋糕,上面至少覆蓋了一層紫色奶酪28A1.quantifierrestrictions(ex【Pizza限制hasBasesomePizzaBase】29A【Pizza限制hasBasesomePizzaBauniversalrestrictions

:describeclassesofindividualsthatforagivenpropertyonlyhaverelationshipsalongthispropertytoindividualsthataremembersofaspecifiedclass.例子::我買的東西都是從好又多市(或者我買東西只(only)從好又多超市)

注::Arestrictiondescribesananonymousclass(anunnamedclass).Theanonymousclasscontainsalloftheindividualsthatsatisfytherestriction。例如:Existentialrestrictions“上面至少覆蓋了一層紫色奶酪?!边@句話就描述了一個匿名類,任何上面覆蓋至少一層紫色奶酪的individuals都屬于該匿名類的,“我做的蛋糕”這個類也屬于這個匿名類。所以當我們對一個類進行限制時,在supperclass里定義。30Auniversalrestrictions:des2定義一些其他的類(一些使用技巧)

【Pizza

子類NamedPizza】【NamedPizza子類MargheritaPizzahasatleastonetoppingsofMozzarellaToppingandTomatoTopping】【創建AmericanaPizza

通過克隆MargheritaPizza因為他擴展了一個限制PepperoniTopping】【創建AmericanHotPizza

通過克隆AmericanaPizza

增加限制JalapenoPepperTopping】【創建SohoPizza克隆MargheritaPizza

增加OliveTopping和ParmezanTopping】31A2定義一些其他的類(一些使用技巧)

【Pizza子類4.10使用Reasoner(推理機)thereasonershippedwithProt′eg′eiscalledFact++.兩種hierarchy:InProt′eg′e4the‘manuallyconstructed’classhierarchyiscalledtheassertedhierarchy.Theclasshierarchythatisautomaticallycomputedbythereasoneriscalledtheinferredhierarchy.主要功能:1,判斷一個類是否是另一個類的子類2,consistencychecking(一致性檢測)【為了使用推理機,我們先定義一個矛盾的類ProbeInconsistentTopping,讓他既是CheeseTopping

又是VegetableTopping的子類,前提是這兩個類是disjoint的】:Ifaclasshasbeenfoundtobeinconsistentit’siconwillbehighlightedinred.【將CheeseToppingVegetableTopping設為非disjoint的之后,再Classify,觀察結果】32A4.10使用Reasoner(推理機)thereason4.11充分必要條件

(primitiveclass和definedclass)

Alloftheclassesthatwehavecreatedsofarhaveonlyusednecessaryconditionstodescribethem.Necessaryconditionscanbereadas,“Ifsomethingisamemberofthisclassthenitisnecessarytofulfilltheseconditions”.Withnecessaryconditionsalone,wecannotsaythat,“Ifsomethingfulfillstheseconditionsthenitmustbeamemberofthisclass”.只定義了必要條件的類叫做primitiveclass定義了充要條件的類叫做definedclass【定義Pizza的子類CheesyPizza定義限制hasToppingsomeCheeseTopping】【將其轉化為充分必要條件】【Classify我們可以看出definedclass的不同】總結::ifclassAisnowdefinedusingnecessaryandsufficientconditions,wecansaythatifanindividualisamemberoftheclassAitmustsatisfytheconditionsandwecannowsaythatifany(random)individualsatis?estheseconditionsthenitmustbeamemberofclassA.33A4.11充分必要條件

(primitiveclass和4.12AutomatedClassification(自動分類)

為什么要使用Reasoner。當我們創建了成百上千的類時,使用Reasoner來自動計算子類父類之間的關系將是十分必要的。沒有了Reasoner我們很難保證大規模本體的健壯性和邏輯性。自動分類這項技術,使得本體可維護并且模塊化,它不僅使得其他的本體和程序能夠reuse我們定義的本體,而且還最大限度的減少了使用者在建立多繼承類時的錯誤?!臼褂肙WLViz顯示類的繼承層次結構】34A4.12AutomatedClassification4.13UniversalRestrictions(QuantifierRestrictions)【創建一個Pizza的子類VegetarianPizza】【增加限制hasToppingonly(CheeseToppingorVegtableTopping)】ThismeansthatifsomethingisamemberoftheclassVegetarianPizzaitisnecessaryforittobeakindofPizzaanditisnecessaryforittoonly(universalquanti?er)havetoppingsthatarekindsofCheeseToppingorkindsofVegetableTopping,也可以沒有,比如,中國現在實行計劃生育,如果夫妻有了孩子那么只能有一個,但是這個夫妻也可以沒有孩子。那么就不存在only這個限制。【將上面的必要條件轉化為充分條件】35A4.13UniversalRestrictions(4.14AutomatedClassificationandOpenWorldReasoning

【使用推理機進行自動分類】我們發現MargheritaPizza

和SohoPizza

并沒有被歸類為VegetarianPizza的子類,但是按照我們的定義,MargheritaPizza和SohoPizza都至少有個蔬菜的頂部和奶酪的頂部,再看VegetarianPizza的充要條件,onlyhave蔬菜的頂部和奶酪的頂部的pizza都是VegetarianPizza。但是ReasoninginOWL(DescriptionLogics)isbasedonwhatisknownastheopenworldassumption(OWA),意思是,除非我們明確的說明某個事物的存在,否則我們就不能說他是存在的。分析上面的:因為我們沒有明確的指定他們只有奶酪和蔬菜頂,那么他們就可以有其他的頂部。這樣的話,他們就不符合VegetarianPizza的充要條件了。為了使這兩種pizza只有蔬菜和奶酪頂部,我們就得在hasTopping上使用closureaxiom(封閉公理)36A4.14AutomatedClassification4.14.1ClosureAxioms(封閉公理)

itcanonlybefilledbythespecifiedfillers.Therestrictionhasafillerthatistheunionofthefillersthatoccurintheexistentialrestrictionsfortheproperty。

【為MargheritaPizza的hasTopping添加封閉公理】 【hasToppingonly(MozzarellaToppingorTomatoTopping)】 【為其他幾個pizza使用更方便的方法添加封閉公理】

現在我們可以說,MargheritaPizza至少有一個MozzarellaTopping和TomatoTopping,并且thetoppingsmustonlybekindsofMozzarellaToppingorTomatoTopping。

【Classify之后我們看結果】37A4.14.1ClosureAxioms(封閉公理)

i4.15ValuePartitionsValuePartitionsare他并不屬于任何一種本體語言的一部分,而是一種設計模式,類似于面向對象程序設計中的設計模式。它可以改善我們對類的描述?!緞摻╰hing的子類ValuePartition

】【ValuePartition的子類SpicinessValuePartition(HotMediumMild)】【創建ObjectPropertyhasSpiciness并使其functional】【為SpicinessValuePartition增加coveringaxiom在equivalent里面輸入HotorMediumorMild】38A4.15ValuePartitionsValuePa這種設計模式的效果我們可以看個對比圖:disjoint(關鍵詞)39A這種設計模式的效果我們可以看個對比圖:disjoint(關鍵4.16AddingSpicinesstoPizzaToppings

【對PepperTopping的所有子類設置必要條件hasSpicinesssomeHot】 【定義Pizza的子類SpicyPizza設置必要條件:hasToppingsome(PizzaToppingandhasSpicinesssomeHot)】【將必要條件化為充要條件】 Fillter描述了一個匿名類,這個頂是Pizzatopping,并且特別辣。【Classifiy之后我們發現AmericanHotPizza成為了SpicyPizza的子類】40A4.16AddingSpicinesstoPizz4.17CardinalityRestrictions(Owl的restriction中的第二種)

describetheclassofindividualsthathaveatleast(min),atmost(max)orexactlyaspecifiednumber(exactly)ofrelationshipswithotherindividualsordatatypevalues.【創建Pizza的子類InterestingPizza定義必要條件hasToppingmin3】注意:我們這里3后面并沒有指定fillter是什么,代表可以是任意的individuals,等價于::hasToppingmin3Thing【轉化為充要條件】【Classify之后觀察。。?!?1A4.17CardinalityRestrictions4.18Qualified(受限的)CardinalityRestrictions

他比上面的morespecify【定義NamedPizza的子類FourCheesePizza定義必要條件hasToppingexactly4CheeseTopping】42A4.18Qualified(受限的)Cardinali5.DatatypeProperties

describerelationshipsbetweenanindividualanddatavalues.【現在來描述pizza所含的熱量】【增加DatatypePropertieshasCalorificContentValue】【增加individualExampleMargherita其type是MargheritaPizza】【為該對象增加DataPropertyassertion其中type選擇integer值填寫250】【增加individualExampleSoho其type是SohoPizza】【為該對象增加DataPropertyassertion其中type選擇integer值填寫800】43A5.DatatypeProperties

describ我們聲明所有的pizza都有熱量值【選定Pizza類,增加Supperclass選擇Datarestrictioncreator】

我們對pizza的熱量值進行分類,產生不同的pizza【創建HighCaloriePizza和LowCaloriePizza作為Pizza的子類】【創建SupperClass選擇Classexpressioneditor】【鍵入PizzathathasCalorificContentValuesomeinteger[>=400]】【同理LowCaloriePizza應當是<400】【分別將他們設為充要條件】【Classify之后我們看他們的members】

某一確定的Pizza他所含的熱量是固定的,也就是說是單值的,我們可以使用functional來限定DataProperty?!具x定hasCalorificContentValue選中functional】44A我們聲明所有的pizza都有熱量值44A6.MoreOnOpenWorldReasoning

這部分主要展示了OpenWorldReasoning中的細微差別【創建NonVegetarianPizza類,作為VegetarianPizza類的complement】【使他們disjoint】【雙擊Supperclass中的pizza,添加PizzaandnotVegetarianPizza】【轉換為充分必要條件】【Classify...之后觀察】

我們創建一個類,doesnothaveaclosureaxiom(封閉公理)onthehasToppingproperty【創建NamedPizza的子類UnclosedPizza】【必要條件:hasToppingsomeMozzarellaTopping】【Classify...之后觀察UnclosedPizza既不是VegetarianPizza也不是NonVegetarianPizza.】前面封閉公理部分已經講過了原因。45A6.MoreOnOpenWorldReasoni我們創建一個類,doesnothaveaclosureaxiom(封閉公理)onthehasToppingproperty【創建NamedPizza的子類UnclosedPizza】【必要條件:hasToppingsomeMozzarellaTopping】【Classify...之后觀察UnclosedPizza既不是VegetarianPizza也不是NonVegetarianPizza.】前面封閉公理部分已經講過了原因。46A我們創建一個類,doesnothaveaclosu7.CreatingOtherOWLConstructs

7.1CreatingIndividuals

我們現在來描述pizza餅起源的國家;【創建Thing的子類Country】【創建individual::ItalyEnglandAmericaFrance】因為相同的individual可以有不同的名稱?!臼撬麄僁ifferentfromeachother】47A7.CreatingOtherOWLConstruc7.2hasValueRestrictions(Owl的restriction中的第三種)

描述的是兩個individual之間至少有的關系P,【創建Objectproperty::hasCountryOfOrigin】【選定MozzarellaTopping增加必要條件hasCountryOfOriginvalueItaly】48A7.2hasValueRestrictions(Owl7.3EnumeratedClasses

【選定Country類,在Equivalentclass處增加{America,England,France,Italy}】意思是如果一個individual他屬于Country,那么他一定屬于這幾個國家中的一個。49A7.3EnumeratedClasses49Aprotege構建本體教程50Aprotege構建本體教程1A1.什么是本體(Ontologie)Ontologiesareusedtocaptureknowledgeaboutsomedomainofinterest.

本體是用來獲得你所感興趣的領域的知識;51A1.什么是本體(Ontologie)Ontologiesa2.OWLOntologiesThemostrecentdevelopmentinstandardontologylanguagesisOWLfromtheWorldWideWebConsortium(W3C)由w3c從斯坦福大學的本體語言發展而來的。52A2.OWLOntologiesThemostrecen

3.OWLOntologies的組成 OWLOntologies與基于Protegeframe的本體語言在組成上比較相似,但是從專業術語上來描述時他們又有著細微的不同。OWLOntologies是由個體(Individuals),屬性(Properties),類(Classes)組成,大致對應于Protegeframe的Instances,Slots,Classes.53A3.OWLOntologies的組成 OWLOntol3.1Individuals(個體)

指的是在域(domain)中我們感興趣的對象。類中的一個實例。 Individuals必須明確的聲明彼此之間是否相同。不同的名字可能指的是相同的Individuals。54A3.1Individuals(個體)5A3.2Properties(屬性)

指的是Individuals上二元關系,他連接著兩個Individuals。如:小三的父親叫大三。其中,“的父親叫”就連接著小三和大三兩個Individuals。 Properties可以存在reverse,如上所示,“的父親叫”的reverse就是“的兒子叫”。 Properties可以被限定成單值,此時Properties是functional的。(后面介紹) Properties也可以是transitive(可傳遞的)或symmetric(對稱的)(后面介紹)55A3.2Properties(屬性)6A3.3Classes

可以看作是包含Individuals的集合。

我們使用正式而精準的形式來描述Classes。Classes通常被組織成supperclass—subclass形式的層狀結構,比如,動物和狗。56A3.3Classes7A4創建本體myPizza(PizzaBase是Pizza結構之一,中文叫“餅底”,主要由面粉做成,是Pizza的主體,和pizzatoppings(比薩餅面)一起構成整個Pizza)57A4創建本體myPizza(PizzaBase是Pizza結4.1命名一個Classes(采用單詞首字母大寫方式,類似于java中類的命名)一個初始化的本體包含一個名字叫做Thing的classes,他表示包含所有individuals的集合,所以,所有的其他classes都是他的subclasses。58A4.1命名一個Classes(采用單詞首字母大寫方式,類似

4.2Disjoint(解體)Classes如果任意一個Individuals(或Object)僅僅是眾多Classes中某一個的實例(instance),那么這些Classes是Disjoint的。59A 4.2Disjoint(解體)Classes10A4.3UsingTheOWLToolsToCreateClasses

【PizzaBase子類ThinAndCrispy和DeepPan】PizzaTopping子類如下Cheese Mozzarella ParmezanMeat Ham Pepperoni Salami SpicyBeefSeaFood Anchovy Prawn TunaVegtable Caper Mushroom Olive Onion Pepper RedPepper GreenPepper JalapenoPepper Tomato60A4.3UsingTheOWLToolsToC4.4subclass到底是什么意思呢?例如“狗”是“動物”的subclass。那么“狗”的instance也是“動物”的instance,一個東西是狗,那么他一定是動物。(這和java中的子類父類貌似是一樣的)

61A4.4subclass到底是什么意思呢?例如“狗”是“動62A13A4.5.OWLProperties

(概述)OWLPropertiesrepresentrelationships.Therearetwomaintypesofproperties,ObjectpropertiesandDatatypeproperties.Objectpropertiesarerelationshipsbetweentwoindividuals.(先介紹Objectproperties)如下是Objectproperties和Datatypeproperties63A4.5.OWLProperties (概述)OWLPObjectpropertieslinkanindividualtoanindividual.【hasIngredien子hasBasehasTopping】

我們可以創建Subproperties,它用來限定Supperproperties的范圍。Forexample,thepropertyhasFathermightspecialise(限定范圍)themoregeneralpropertyofhasParent.小明有父親大明,那么我們也可以說小明的雙親有大明。“有父親”就是“有雙親”的subproperty。64AObjectpropertieslinkanindi4.6InverseProperties(逆屬性)【isIngredientOf子isBaseOfisToppingOf】如該例中::hasBase和isBaseOf就是一對InverseProperties

Forexample:ifMatthewhasParentJean,thentheinversepropertywecaninferthatJeanhasChildMatthew.65A4.6InverseProperties(逆屬性)164.7OWLObjectPropertyCharacteristics(特征)OWL允許通過使用propertycharacteristics來增強properties的含義(內涵)。66A4.7OWLObjectPropertyCha(1)FunctionalPropertiesIfapropertyisfunctional,foragivenindividual,therecanbeat mostoneindividualthatisrelatedtotheindividualviatheproperty.. 也就是說,Properties是單值的。例如::hasBirthMother

,這個就是functional的,因為一個人他只能有一個生母。67A(1)FunctionalPropertiesIfa另外::IfwesaythattheindividualJeanhasBirthMotherLilyandwealsosaythattheindividualJeanhasBirthMotherMary,thenbecausehasBirthMotherisafunctionalproperty,wecaninferthatLilyandMarymustbethesameindividual.但是如果Lily和Mary明確的聲明為兩個不同的Individuals,那么就會出現矛盾(inconsistency)。68A另外::19A

(2)InverseFunctionalProperties就是FunctionalProperties的inverse如下::69A (2)InverseFunctionalProper(3)TransitivePropertiesIfapropertyistransitive,andthepropertyrelatesindividualato individualb,andalsoindividualbtoindividualc,thenwecaninfer thatindividualaisrelatedtoindividualcviapropertyP.如下::注::

a)Ifapropertyistransitivethenitsinversepropertyshouldalsobetransitive.(祖先那個例子)b)

ifapropertyistransitivethenitcannotbefunctional.70A(3)TransitivePropertiesIfa(4)Symmetric(對稱)PropertiesIfapropertyPissymmetric,andthepropertyrelatesindividualatoindividualbthenindividualbisalsorelatedtoindividualaviapropertyP.如下::71A(4)Symmetric(對稱)PropertiesIf(5)Antisymmetric(反對稱)propertiesIfapropertyPisantisymmetric,andthepropertyrelatesindividualatoindividualbthenindividualbcannotberelatedtoindividualaviapropertyP.如下::72A(5)Antisymmetric(反對稱)propert(6)Re?exive(自反)propertiesApropertyPissaidtobere?exivewhenthepropertymustrelate individualatoitself.如下::73A(6)Re?exive(自反)propertiesAp(7)Irre?exive(非自反)propertiesIfapropertyPisirre?exive,itcanbedescribedasapropertythatrelatesanindividualatoindividualb,whereindividualaand individualbarenotthesame.也就是說,這種properties只能連接

不同的individuals。如::小明的父親是大明,那么我們不能說小明的父親是小明74A(7)Irre?exive(非自反)properties4.8PropertyDomainsandRanges【定義hasTopping的RangePizzaToppingdomainPizza】【定義isToppingOf的RangePizzadomainPizzaTopping】Propertiesmayhaveadomainandarangespeci?ed(指定的).Propertieslinkindividualsfromthedomaintoindividualsfromtherange.例如::inmyPizza本體,thepropertyhasToppingwouldprobablylinkindividualsbelongingthetheclassPizzatoindividualsbelongingtotheclassofPizzaTopping.InthiscasethedomainofthehasToppingpropertyisPizzaandtherangeisPizzaTopping。另外::如果有ahasToppingb

,并且a與b都是individuals,那么我們就可以說a屬于classPizza,b屬于classPizzaTopping。通常來說,domainforapropertyistherangeforitsinverse,andtherangeforapropertyisthedomainforitsinverse75A4.8PropertyDomainsandRange4.9描述和定義Classes4.9.1PropertyRestrictionsOwl的restriction有三種:QuantifierRestrictionsCardinalityRestrictionshasValueRestrictions.76A4.9描述和定義Classes4.9.1Property1.quantifierrestrictions(existentialrestrictions和universalrestrictions)

Existentialrestrictions

:describeclassesofindividualsthatparticipateinatleastonerelationshipalongaspeci?edpropertytoindividualsthataremembersofaspeci?edclass.例子::我至少(atleastone)買了一袋餅干從好又多超市。再比如::我做的蛋糕,上面至少覆蓋了一層紫色奶酪77A1.quantifierrestrictions(ex【Pizza限制hasBasesomePizzaBase】78A【Pizza限制hasBasesomePizzaBauniversalrestrictions

:describeclassesofindividualsthatforagivenpropertyonlyhaverelationshipsalongthispropertytoindividualsthataremembersofaspecifiedclass.例子::我買的東西都是從好又多市(或者我買東西只(only)從好又多超市)

注::Arestrictiondescribesananonymousclass(anunnamedclass).Theanonymousclasscontainsalloftheindividualsthatsatisfytherestriction。例如:Existentialrestrictions“上面至少覆蓋了一層紫色奶酪?!边@句話就描述了一個匿名類,任何上面覆蓋至少一層紫色奶酪的individuals都屬于該匿名類的,“我做的蛋糕”這個類也屬于這個匿名類。所以當我們對一個類進行限制時,在supperclass里定義。79Auniversalrestrictions:des2定義一些其他的類(一些使用技巧)

【Pizza

子類NamedPizza】【NamedPizza子類MargheritaPizzahasatleastonetoppingsofMozzarellaToppingandTomatoTopping】【創建AmericanaPizza

通過克隆MargheritaPizza因為他擴展了一個限制PepperoniTopping】【創建AmericanHotPizza

通過克隆AmericanaPizza

增加限制JalapenoPepperTopping】【創建SohoPizza克隆MargheritaPizza

增加OliveTopping和ParmezanTopping】80A2定義一些其他的類(一些使用技巧)

【Pizza子類4.10使用Reasoner(推理機)thereasonershippedwithProt′eg′eiscalledFact++.兩種hierarchy:InProt′eg′e4the‘manuallyconstructed’classhierarchyiscalledtheassertedhierarchy.Theclasshierarchythatisautomaticallycomputedbythereasoneriscalledtheinferredhierarchy.主要功能:1,判斷一個類是否是另一個類的子類2,consistencychecking(一致性檢測)【為了使用推理機,我們先定義一個矛盾的類ProbeInconsistentTopping,讓他既是CheeseTopping

又是VegetableTopping的子類,前提是這兩個類是disjoint的】:Ifaclasshasbeenfoundtobeinconsistentit’siconwillbehighlightedinred.【將CheeseToppingVegetableTopping設為非disjoint的之后,再Classify,觀察結果】81A4.10使用Reasoner(推理機)thereason4.11充分必要條件

(primitiveclass和definedclass)

Alloftheclassesthatwehavecreatedsofarhaveonlyusednecessaryconditionstodescribethem.Necessaryconditionscanbereadas,“Ifsomethingisamemberofthisclassthenitisnecessarytofulfilltheseconditions”.Withnecessaryconditionsalone,wecannotsaythat,“Ifsomethingfulfillstheseconditionsthenitmustbeamemberofthisclass”.只定義了必要條件的類叫做primitiveclass定義了充要條件的類叫做definedclass【定義Pizza的子類CheesyPizza定義限制hasToppingsomeCheeseTopping】【將其轉化為充分必要條件】【Classify我們可以看出definedclass的不同】總結::ifclassAisnowdefinedusingnecessaryandsufficientconditions,wecansaythatifanindividualisamemberoftheclassAitmustsatisfytheconditionsandwecannowsaythatifany(random)individualsatis?estheseconditionsthenitmustbeamemberofclassA.82A4.11充分必要條件

(primitiveclass和4.12AutomatedClassification(自動分類)

為什么要使用Reasoner。當我們創建了成百上千的類時,使用Reasoner來自動計算子類父類之間的關系將是十分必要的。沒有了Reasoner我們很難保證大規模本體的健壯性和邏輯性。自動分類這項技術,使得本體可維護并且模塊化,它不僅使得其他的本體和程序能夠reuse我們定義的本體,而且還最大限度的減少了使用者在建立多繼承類時的錯誤?!臼褂肙WLViz顯示類的繼承層次結構】83A4.12AutomatedClassification4.13UniversalRestrictions(QuantifierRestrictions)【創建一個Pizza的子類VegetarianPizza】【增加限制hasToppingonly(CheeseToppingorVegtableTopping)】ThismeansthatifsomethingisamemberoftheclassVegetarianPizzaitisnecessaryforittobeakindofPizzaanditisnecessaryforittoonly(universalquanti?er)havetoppingsthatarekindsofCheeseToppingorkindsofVegetableTopping,也可以沒有,比如,中國現在實行計劃生育,如果夫妻有了孩子那么只能有一個,但是這個夫妻也可以沒有孩子。那么就不存在only這個限制?!緦⑸厦娴谋匾獥l件轉化為充分條件】84A4.13UniversalRestrictions(4.14AutomatedClassificationandOpenWorldReasoning

【使用推理機進行自動分類】我們發現MargheritaPizza

和SohoPizza

并沒有被歸類為VegetarianPizza的子類,但是按照我們的定義,MargheritaPizza和SohoPizza都至少有個蔬菜的頂部和奶酪的頂部,再看VegetarianPizza的充要條件,onlyhave蔬菜的頂部和奶酪的頂部的pizza都是VegetarianPizza。但是ReasoninginOWL(DescriptionLogics)isbasedonwhatisknownastheopenworldassumption(OWA),意思是,除非我們明確的說明某個事物的存在,否則我們就不能說他是存在的。分析上面的:因為我們沒有明確的指定他們只有奶酪和蔬菜頂,那么他們就可以有其他的頂部。這樣的話,他們就不符合VegetarianPizza的充要條件了。為了使這兩種pizza只有蔬菜和奶酪頂部,我們就得在hasTopping上使用closureaxiom(封閉公理)85A4.14AutomatedClassification4.14.1ClosureAxioms(封閉公理)

itcanonlybefilledbythespecifiedfillers.Therestrictionhasafillerthatistheunionofthefillersthatoccurintheexistentialrestrictionsfortheproperty。

【為MargheritaPizza的hasTopping添加封閉公理】 【hasToppingonly(MozzarellaToppingorTomatoTopping)】 【為其他幾個pizza使用更方便的方法添加封閉公理】

現在我們可以說,MargheritaPizza至少有一個MozzarellaTopping和TomatoTopping,并且thetoppingsmustonlybekindsofMozzarellaToppingorTomatoTopping。

【Classify之后我們看結果】86A4.14.1ClosureAxioms(封閉公理)

i4.15ValuePartitionsValuePartitionsare他并不屬于任何一種本體語言的一部分,而是一種設計模式,類似于面向對象程序設計中的設計模式。它可以改善我們對類的描述?!緞摻╰hing的子類ValuePartition

】【ValuePartition的子類SpicinessValuePartition(HotMediumMild)】【創建ObjectPropertyhasSpiciness并使其functional】【為SpicinessVa

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論