protege構(gòu)建本體教程_第1頁
protege構(gòu)建本體教程_第2頁
protege構(gòu)建本體教程_第3頁
已閱讀5頁,還剩15頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、viaThe Prot eg e platform supports two main ways of modeling ontologies the Prot eg e-Framesand Prot eg e-OWL editors(我們使用的是后者)1.什么是本體(Ontologie)Ontologies are used to capture knowledge about some domain of in terest.本體是用來獲得你所感興趣的領(lǐng)域的知識;2.OWL On tologiesThe most rece nt developme nt in sta ndard on t

2、ology Ian guages is OWL from the World Wide Web Con sortium (W3C)由w3c從斯坦福大學(xué)的本體語言發(fā)展而來的。3.OWL On tologies 的組成OWL Ontologies與基于Prot eg e frame的本體語言在組成上比較相似,但是從專業(yè)術(shù)語上來描述時他們又有著細(xì)微的不同。OWLOntologies是由個體(Individuals),屬性(Properties),類(Classes 組成,大致對應(yīng)于 Protege frame 的 Instances, Slots , Classes.3.1 Individuals

3、(個體)指的是在域(domain)中我們感興趣的對象。類中的一個實例。In dividuals必須明確的聲明彼此之間是否相同。不同的名字可能指的是相同的Individuals。3.2 Properties (屬性)指的是Individuals上二元關(guān)系,他連接著兩個Individuals。如:小三的父親叫大三。其中,“的父親叫”就連接著小三和大三兩個In dividuals。Properties 可以存在 reverse,如上所示,“的父親叫”的 reverse 就是“的兒子叫”。Properties可以被限定成單值,此時Properties是functional的。(后 面介紹)Proper

4、ties也可以是transitive (可傳遞的)或symmetric (對稱的) (后面介紹)3.3 Classes可以看作是包含Individuals的集合。我們使用正式而精準(zhǔn)的形式來描述Classes Classes常被組織成supperclass-subclass形式的層狀結(jié)構(gòu),比如,動物和狗。4倉【I建本體myPizza(PizzaBase是 Pizza結(jié)構(gòu)之一,中文叫“餅底”,主要由面粉做成,是 Pizza的主體,和pizza toppings (比薩餅面)一起構(gòu)成整個 Pizza)4.1命名一個Classes(采用單詞首字母大寫方式,類似于java中 類的命名)一個初始化的本體包

5、含一個名字叫做 Thing的classes他 表示包含所有individuals的集合,所以,所有的其他 classes都是 他的 subclasses4.2 Disjoint (解體)Classes如果任意一個Individuals (或Object)僅僅是眾多 Classes中某 一個的實例(instanee),那么這些 Classes是 Disjoint 的。4.3 Using The OWL Tools To Create Classes【PizzaBase子類 ThinAndCrispy 和 DeepPar】PizzaTopp ing子類如下CheeseMozzarellaParme

6、zanMeatHamPepperoniSalamiSpicyBeefSeaFoodAnchovyPrawnTunaVegtableCaperMushroomOliveOnionPepperRedPepperGree nPepperJalape noPepperTomato4.4 subclass到底是什么意思呢?例如“狗”是“動物”的subclass那么“狗”的instanee也是“動物”的instanee, 個東西是狗,那么他一定是動物。(這和java中的子類父類貌似是一樣的)Pizz 日 ToppingTomatoToppingVegetableToppingThe Meaning Of

7、Subclass .4/ individuals that are members cf the class TcmatoTbppinre inembeis of theVeQetabeTopaing and Mitiubers of the P ZZaTopcing a* ha1*e staitdLhat TcmatoTopp )且 tibMd uf VAge:aDleTopning 昭 hick 詮 a stiLcl uf Piz;aTopp ng4.5. OWL Properties(概述)OWL Properties represe nt relati on ships. There

8、are two main types of properties, Object properties and Datatype properties. Object properties are relati on ships betwee n two in dividuals.(先介紹 Object properties) 如下是 Object properties 禾口 Datatype propertiesYsSisterMatt hewGemmaAn abject property linkinq thindividual Marth w ro Th incdivicJu alMar

9、rhewH2SWA Axsd:int*g*rA datatype property hrnking the individualMrirthew to the dita literaE 25 which has 曰 type cf 曰門 xdvinteger.Object properties link an in dividual to an in dividual.【has In gredie n 子 hasBase hasTopp inj我們可以創(chuàng)建 Sub properties,它用來限定 Supper properties 的圍。For example, the property h

10、asFather might specialise (限定圍) the more general property of hasParent 小明有父親大明,那么我們也 可以說小明的雙親有大明。“有父親”就是“有雙親”的subproperty。4.6 In verse Properties (逆屬性)【islngredientOf 子 isBaseOf isToppingO】如該例中: hasBase 和 isBaseOf就 是一對 In verse PropertiesFor example: if Matthew hasParent Jean, then the inverse prope

11、rty we can infer that Jea nhasChild Matthew.4.7 OWL Object Property Characteristics (特征)OWL 允許通過使用 property characteristics 來增強 properties 的含義(涵)。(1)Functional Properties也就是說,Properties是單值的。例如:hasBirthMother,這個 就是functional的,因為一個人 他只能有一個生母。另外:If we say that the in dividual Jea n hasBirthMother Lily

12、and we also say that the in dividual Jea n hasBirthMother Mary, the n because hasBirthMother is a functional property , we can infer that Lily and Mary must be the same in dividual.但是如果 Lily 和 Mary 明確的聲 明為兩個不同的Individuals,那么就會出現(xiàn)矛盾(inconsistency)。Figure 4.19: An Example Of A Fimctional Property: hasB

13、irthMother(2) Inv erse Fun cti onal Properties就是 Functional Properties 的 inverse如下:ure 4.20: A.i Exanrple Of An Inverse Functional Property7: JSBirthMothGrOf(3) Tran sitive Propertiesthat in dividual a is related to in dividual c via property P.如下:MatthewFigure 4.21: An Example Of A Transitive Prope

14、rty: hasAncestOf 注: : a)If a property is transitive then its inverse property should also be transitive.(祖先那個例子)Williamb) if a property is tran sitive the n it cannot be fun cti on al.(4) Symmetric (對稱)PropertiesIf a property P is symmetric, and the property relates in dividual a to in dividual b th

15、e n in dividual b is also related to in dividual a via property P.如下:斤曲ibling &紳論Figure 4.22: An Example Of A Symmetric Property: hasSibling(5) Antisymmetric (反對稱)propertiesin dividual a via property P.如下:isChildOfFigure 4.24: An example of the anti symmetric property hasCliildOf(6) Re?exive (自反) pr

16、opertiesA property P is said to be re?exive whe n the property must relatein dividual a to itself.如下:Figure 4qs that have at least one Mozzare-H aTc ppin g fhasTopping sorr e Mczzae-ILaToppinqFigure 4.29; I hi Restrictiin haslbpping some Mo77araNa This rwtricticm describee the cIak of individuals th

17、at 3ia& at least cm冒 tupping tbat is Mozzarg la【Pizza 限制 hasBase some PizzaBase uni versal restrictio nsdescribe classes of individuals that for a given property only have relati on ships along this property to in dividuals that are members of a specified class.例子:我買的東西都是從好又多市(或者 我買東西只(only)從好又多超市)注

18、:A restrict on describes an anonym ous class (an unn amed class). The anonymous class contains all of the individuals that satisfy the restriction。例如:Existential restrictions “上面至少覆蓋了一層紫色 奶酪。”這句話就描述了一個匿名類,任何上面覆蓋至少一層紫色奶 酪的individuals都屬于該匿名類的,“我做的蛋糕”這個類也屬于這 個匿名類。所以當(dāng)我們對一個類進(jìn)行限制時,在supperclass里定義。2定義一些其他的

19、類(一些使用技巧)【Pizza 子類 NamedPizza【NamedPizza 子類 MargheritaPizza has at least one toppings ofMozzarellaToppi ng and TomatoTopp ing】【創(chuàng)建 AmericanaPizza通過克隆 MargheritaPizza因為他擴(kuò)展了一個限制 PepperoniTopping【創(chuàng)建AmericanHotPizza通過克隆 AmericanaPizza增加限制Jalape noPepperTopp ind【創(chuàng)建 SohoPizza 克隆 MargheritaPizza 增加 OliveTop

20、ping 和Parmeza nTopp inQ4.10使用Reasoner (推理機(jī)):the reasoner shipped with Protege is called Fact+.:兩不中 hierarchy: In Protege 4 the manually constructed class hierarchy is called the asserted hierarchy. The class hierarchy that is automatically computed by the reas oner is called thei nferred hierarchy.:

21、主要功能:1,判斷一個類是否是另一個類的子類2, consistency checking (致性檢測):【 為 了 使 用 推 理 機(jī) , 我 們 先 定 義 一 個 矛 盾 的 類 ProbeInconsistentTopping , 讓 他 既 是 CheeseTopping 又 是 VegetableTopping的子類,前提是這兩個類是 disjoint的】 :If a class has been found to be inconsistent it icosn will be highlighted in red.【將 CheeseTopping VegetableToppin

22、g設(shè)為非 disjoint 的之后, 再Classify觀察結(jié)果】4.11 充分必要條件( primitive class 和 defined class)All of the classes that we have created so far have only used necessary conditions to describe them.Necessary conditions can be read as, “If something is a member of this class then it is necessary to fulfill these conditi

23、ons”. With necessary conditions alone, we cannot say that, “If something fulfills these conditions then it must be a member of this class”.只定義了必要條件的類叫做 primitive class 定義了充要條件的類叫做 defined class【定義 Pizza的子類 CheesyPizza定義限制 hasTopping some CheeseTopping】【將其轉(zhuǎn)化為充分必要條件】【Classify 我們可以看出 defined class 的不同】

24、 總結(jié): if class A is now defined using necessary and sufficient con diti ons, we can say that if an in dividual is a member of the class A it must satisfy the conditions and we can now say that if any (random) in dividual satis?es these con diti ons the n it must be a member of class A.4.12 Automated

25、Classification (自動分類)為什么要使用Reasone。當(dāng)我們創(chuàng)建了成百上千的類時,使用Reaso ner來自動計算子類父類之間的關(guān)系將是十分必要的。沒有了 Reasoner我們很難保證 大規(guī)模本體的健壯性和邏輯性。自動分類這 項技術(shù),使得本體可維護(hù)并且模塊化,它不僅使得其他的本體和程序 能夠reuse我們定義的本體,而且還最大限度的減少了使用者在建立 多繼承類時的錯誤。【使用OWLViz顯示類的繼承層次結(jié)構(gòu)】4.13 Universal Restrictions( Quantifier Restrictions)【創(chuàng)建一個 Pizza的子類 VegetarianPizza 【增

26、加限制 hasToppingonly (CheeseToppingpr VegtableToppingThis means that if someth ing is a member of the classVegetaria nPizzait is necessary for it to be a knd of Pizzaand it is necessary for it to only (universal quanti?er) have toppings that are kinds of CheeseToppingor kinds of VegetableTopping、也可以沒有

27、,比如,中國現(xiàn)在實行計戈生 育,如果夫妻有了孩子那么只能有一個,但是這個夫妻也可以沒有孩子。那么就不存在 only這個限制。【將上面的必要條件轉(zhuǎn)化為充分條件4.14 Automated Classification and Open World Reasoning【使用推理機(jī)進(jìn)行自動分類】我們 發(fā) 現(xiàn) MargheritaPizza 和 SohoPizza 并 沒有 被 歸 類 為 VegetarianPizza 的子類,但是按照我們的定義, MargheritaPizza 和 SohoPizza 都 至 少 有 個 蔬 菜 的 頂 部 和 奶 酪 的 頂 部 , 再 看 Vegetarian

28、Pizza 的充要條件, only have 蔬菜的頂部和奶酪的頂部的 pizza 都是 VegetarianPizza。但是 Reasoning in OWL (Description Logics) is based on what is known as the open world assumption (OWA),意思是,除非我們明確的 說明某個事物的存在,否則我們就不能說他是存在的。分析上面的: 因為我們沒有明確的指定他們只有奶酪和蔬菜頂, 那么他們就可以有 其他的頂部。這樣的話,他們就不符合 VegetarianPizza 的充要條件 了。為了使這兩種pizza只有蔬菜和奶酪頂部

29、,我們就得在hasTopping上使用closure axiom (圭寸閉公理)4.14.1 Closure Axioms (圭封閉公理)it can only be filled by the specified fillers. The restriction has a filler that is the union of the fillers that occur in the existential restrictions for the property 。【為 MargheritaPizza 的 hasTopping 添加圭閉公理 】【hasTopping only (Mo

30、zzarellaTopping or TomatoTopping】)【為其他幾個pizza使用更方便的方法添加封閉公理】現(xiàn)在我們可以說, MargheritaPizza 至少有一個 MozzarellaTopping禾口 TomatoTopping,并且 the toppings must only be kinds of MozzarellaToppi ng or TomatoTopp ingClassify之后我們看結(jié)果】4.15 Value PartitionsValue Partitio nsare他并不屬于任何一種本體語言的一部分,而是 一種設(shè)計模式,類似于面向?qū)ο蟪绦蛟O(shè)計中的設(shè)計模

31、式。它可以改善我們對類的描述。創(chuàng)建 thing 的子類 ValuePartition 【ValuePartition 的子類 SpicinessValuePartition ( Hot Medium Mild )倉 U建 Object Property hasSpic in ess 并使其 fun cti on al 為 Spic in essValuePartiti on 增力口 coveri ng axiom 在 equivale nt 里面 輸入 Hot or Medium or Mild 這種設(shè)計模式的效果我們可以看個對比圖:disjoi nt(關(guān)鍵詞)WithoLiti covering dxioniSpicinisVli Prti tir-nWilh = 400【同理 LowCaloriePizza應(yīng)當(dāng)是 400【分別將他們設(shè)為充要條件【Classify之后我們看他們的members 某一確定的Pizza他所含的熱量是固定的,也就是說是單值的,我們 可

溫馨提示

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

評論

0/150

提交評論