




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、protege構(gòu)建本體教程,1,2,1.什么是本體(Ontologie),Ontologies are used to capture knowledge about some domain of interest. 本體是用來獲得你所感興趣的領(lǐng)域的知識;,2,2020/10/19,2.OWL Ontologies,The most recent development in standard ontology languages is OWL from the World Wide Web Consortium (W3C) 由w3c從斯坦福大學(xué)的本體語言發(fā)展而來的。,3,2020/10/19
2、,3.OWL Ontologies的組成,OWL Ontologies與基于Protege frame的本體語言在組成上比較相似,但是從專業(yè)術(shù)語上來描述時(shí)他們又有著細(xì)微的不同。OWL Ontologies是由個(gè)體(Individuals),屬性(Properties),類(Classes)組成,大致對應(yīng)于Protege frame的Instances,Slots ,Classes.,4,2020/10/19,3.1 Individuals(個(gè)體) 指的是在域(domain)中我們感興趣的對象。類中的一個(gè)實(shí)例。 Individuals必須明確的聲明彼此之間是否相同。不同的名字可能指的是相同的In
3、dividuals。,5,2020/10/19,3.2 Properties(屬性) 指的是Individuals上二元關(guān)系,他連接著兩個(gè)Individuals。如:小三的父親叫大三。其中,“的父親叫”就連接著小三和大三兩個(gè)Individuals。 Properties可以存在reverse,如上所示,“的父親叫”的reverse就是“的兒子叫”。 Properties可以被限定成單值,此時(shí)Properties是functional的。(后面介紹) Properties也可以是transitive (可傳遞的)或symmetric(對稱的)(后面介紹),6,2020/10/19,3.3 Cla
4、sses 可以看作是包含Individuals的集合。 我們使用正式而精準(zhǔn)的形式來描述Classes。Classes通常被組織成supperclasssubclass形式的層狀結(jié)構(gòu),比如,動物和狗。,7,2020/10/19,4 創(chuàng)建本體myPizza,(PizzaBase是Pizza結(jié)構(gòu)之一,中文叫“餅底”,主要由面粉做成,是Pizza的主體,和pizza toppings(比薩餅面)一起構(gòu)成整個(gè)Pizza),8,2020/10/19,4.1 命名一個(gè)Classes(采用單詞首字母大寫方式,類似于java中類的命名) 一個(gè)初始化的本體包含一個(gè)名字叫做Thing的classes,他表示包含所有
5、individuals的集合,所以,所有的其他classes都是他的subclasses。,9,2020/10/19,4.2 Disjoint(解體) Classes 如果任意一個(gè)Individuals(或Object)僅僅是眾多Classes中某一個(gè)的實(shí)例(instance),那么這些Classes是Disjoint的。,10,2020/10/19,4. 3 Using The OWL Tools To Create Classes,【PizzaBase 子類 ThinAndCrispy 和 DeepPan】 PizzaTopping子類如下 Cheese Mozzarella Parmez
6、an Meat Ham Pepperoni Salami SpicyBeef SeaFood Anchovy Prawn Tuna Vegtable Caper Mushroom Olive Onion Pepper RedPepper GreenPepper JalapenoPepper Tomato,11,2020/10/19,4.4 subclass到底是什么意思呢?,例如“狗”是“動物”的subclass。那么“狗”的instance也是“動物”的instance,一個(gè)東西是狗,那么他一定是動物。(這和java中的子類父類貌似是一樣的),12,2020/10/19,13,2020/10
7、/19,4.5. OWL Properties,(概述)OWL Properties represent relationships. There are two main types of properties, Object properties and Datatype properties. Object properties are relationships between two individuals. (先介紹Object properties)如下是Object properties 和 Datatype properties,14,2020/10/19,Object pr
8、operties link an individual to an individual. 【hasIngredien 子 hasBase hasTopping】 我們可以創(chuàng)建Sub properties,它用來限定Supper properties的范圍。For example, the property hasFather might specialise(限定范圍)the more general property of hasParent. 小明有父親大明,那么我們也可以說小明的雙親有大明?!坝懈赣H”就是“有雙親”的subproperty。,15,2020/10/19,4.6 Inve
9、rse Properties(逆屬性) 【isIngredientOf 子 isBaseOf isToppingOf】 如該例中: hasBase 和 isBaseOf就是一對Inverse Properties For example:if Matthew hasParent Jean, then the inverse property we can infer that Jean hasChild Matthew.,16,2020/10/19,4.7 OWL Object Property Characteristics(特征) OWL允許通過使用property characteris
10、tics來增強(qiáng)properties的含義(內(nèi)涵)。,17,2020/10/19,(1)Functional Properties,If a property is functional, for a given individual, there can be at most one individual that is related to the individual via the property.也就是說,Properties是單值的。例如:hasBirthMother ,這個(gè)就是functional的,因?yàn)橐粋€(gè)人他只能有一個(gè)生母。,18,2020/10/19,另外: If we s
11、ay that the individual Jean hasBirthMother Lily and we also say that the individual Jean hasBirthMother Mary, then because hasBirthMother is a functional property, we can infer that Lily and Mary must be the same individual.但是如果Lily和Mary明確的聲明為兩個(gè)不同的Individuals,那么就會出現(xiàn)矛盾(inconsistency)。,19,2020/10/19,(
12、2) Inverse Functional Properties,就是Functional Properties 的 inverse 如下:,20,2020/10/19,(3) Transitive Properties,If a property is transitive, and the property relates 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
13、 property P.如下:,注: a)If a property is transitive then its inverse property should also be transitive.(祖先那個(gè)例子) b) if a property is transitive then it cannot be functional.,21,2020/10/19,(4) Symmetric(對稱) Properties,If a property P is symmetric, and the property relates individual a to individual b th
14、en individual b is also related to individual a via property P.如下:,22,2020/10/19,(5) Antisymmetric(反對稱) properties,If a property P is antisymmetric, and the property relates individual a to individual b then individual b cannot be related to individual a via property P.如下:,23,2020/10/19,(6) Reexive(
15、自反) properties,A property P is said to be reexive when the property must relate individual a to itself.如下:,24,2020/10/19,(7) Irreexive(非自反) properties,If a property P is irreexive, it can be described as a property that relates an individual a to individual b, where individual a and individual b are
16、 not the same.也就是說,這種properties只能連接不同的individuals。如: 小明的父親是大明,那么我們不能說小明的父親是小明,25,2020/10/19,4.8 Property Domains and Ranges,【定義 hasTopping 的 Range PizzaTopping domain Pizza】 【定義 isToppingOf 的 Range Pizza domain PizzaTopping 】 Properties may have a domain and a range specied(指定的). Properties link ind
17、ividuals from the domain to individuals from the range. 例如:in myPizza 本體, the property hasTopping would probably link individuals belonging the the class Pizza to individuals belonging to the class of PizzaTopping. In this case the domain of the hasTopping property is Pizza and the range is PizzaTop
18、ping。 另外: 如果有 a hasTopping b ,并且a與b都是individuals,那么我們就可以說a屬于class Pizza,b屬于class PizzaTopping。通常來說,domain for a property is the range for its inverse, and the range for a property is the domain for its inverse,26,2020/10/19,4.9描述和定義Classes,4.9.1 Property Restrictions Owl的restriction有三種: Quantifier R
19、estrictions Cardinality Restrictions hasValue Restrictions.,27,2020/10/19,1. quantifier restrictions(existential restrictions 和 universal restrictions),Existential restrictions : describe classes of individuals that participate in at least one relationship along a specied property to individuals tha
20、t are members of a specied class. 例子:我至少(at least one)買了一袋餅干從好又多超市。再比如:我做的蛋糕,上面至少覆蓋了一層紫色奶酪,28,2020/10/19,【Pizza 限制 hasBase some PizzaBase 】,29,2020/10/19,universal restrictions :,describe classes of individuals that for a given property only have relationships along this property to individuals that
21、 are members of a specified class. 例子:我買的東西都是從好又多市(或者我買東西只(only)從好又多超市) 注:A restriction describes an anonymous class (an unnamed class). The anonymous class contains all of the individuals that satisfy the restriction 。例如: Existential restrictions“上面至少覆蓋了一層紫色奶酪?!边@句話就描述了一個(gè)匿名類,任何上面覆蓋至少一層紫色奶酪的individua
22、ls都屬于該匿名類的,“我做的蛋糕”這個(gè)類也屬于這個(gè)匿名類。所以當(dāng)我們對一個(gè)類進(jìn)行限制時(shí),在supperclass里定義。,30,2020/10/19,2 定義一些其他的類(一些使用技巧),【 Pizza 子類 NamedPizza】 【NamedPizza 子類MargheritaPizza has at least one toppings of MozzarellaTopping and TomatoTopping】 【創(chuàng)建AmericanaPizza 通過克隆 MargheritaPizza 因?yàn)樗麛U(kuò)展了一個(gè)限制 PepperoniTopping】 【創(chuàng)建AmericanHotPizz
23、a 通過克隆 AmericanaPizza 增加限制JalapenoPepperTopping】 【創(chuàng)建SohoPizza 克隆MargheritaPizza 增加OliveTopping 和ParmezanTopping】,31,2020/10/19,4.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. T
24、he class hierarchy that is automatically computed by the reasoner is called the inferred hierarchy. 主要功能: 1,判斷一個(gè)類是否是另一個(gè)類的子類 2,consistency checking(一致性檢測) 【為了使用推理機(jī),我們先定義一個(gè)矛盾的類ProbeInconsistentTopping,讓他既是CheeseTopping 又是 VegetableTopping的子類,前提是這兩個(gè)類是disjoint的】 :If a class has been found to be inconsis
25、tent its icon will be highlighted in red. 【將CheeseTopping VegetableTopping 設(shè)為非disjoint的之后,再Classify,觀察結(jié)果】,32,2020/10/19,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
26、, “If something is a member of this class then it is necessary to fulfill these conditions”. 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的子類CheesyPi
27、zza定義限制hasTopping some CheeseTopping】 【將其轉(zhuǎn)化為充分必要條件】 【Classify 我們可以看出defined class 的不同】 總結(jié): if class A is now defined using necessary and sufficient conditions, we can say that if an individual is a member of the class A it must satisfy the conditions and we can now say that if any (random) individua
28、l satises these conditions then it must be a member of class A.,33,2020/10/19,4.12 Automated Classification(自動分類),為什么要使用Reasoner。當(dāng)我們創(chuàng)建了成百上千的類時(shí),使用Reasoner來自動計(jì)算子類父類之間的關(guān)系將是十分必要的。沒有了Reasoner我們很難保證 大規(guī)模本體的健壯性和邏輯性。自動分類這項(xiàng)技術(shù),使得本體可維護(hù)并且模塊化,它不僅使得其他的本體和程序能夠reuse 我們定義的本體,而且還最大限度的減少了使用者在建立多繼承類時(shí)的錯(cuò)誤。 【使用OWLViz 顯示類的繼
29、承層次結(jié)構(gòu)】,34,2020/10/19,4.13 Universal Restrictions (Quantifier Restrictions),【創(chuàng)建一個(gè)Pizza的子類VegetarianPizza 】 【增加限制 hasTopping only (CheeseTopping or VegtableTopping)】 This means that if something is a member of the class VegetarianPizza it is necessary for it to be a kind of Pizza and it is necessary f
30、or it to only (universal quantier) have toppings that are kinds of CheeseTopping or kinds of VegetableTopping,也可以沒有,比如,中國現(xiàn)在實(shí)行計(jì)劃生育,如果夫妻有了孩子那么只能有一個(gè),但是這個(gè)夫妻也可以沒有孩子。那么就不存在only這個(gè)限制。 【將上面的必要條件轉(zhuǎn)化為充分條件】,35,2020/10/19,4.14 Automated Classification and Open World Reasoning,【使用推理機(jī)進(jìn)行自動分類】 我們發(fā)現(xiàn)MargheritaPizza 和So
31、hoPizza 并沒有被歸類為 VegetarianPizza的子類,但是按照我們的定義,MargheritaPizza 和 SohoPizza 都至少有個(gè)蔬菜的頂部和奶酪的頂部,再看VegetarianPizza 的充要條件, only have 蔬菜的頂部和奶酪的頂部的pizza都是VegetarianPizza。 但是Reasoning in OWL (Description Logics) is based on what is known as the open world assumption(OWA),意思是,除非我們明確的說明某個(gè)事物的存在,否則我們就不能說他是存在的。分析上面
32、的:因?yàn)槲覀儧]有明確的指定他們只有奶酪和蔬菜頂,那么他們就可以有其他的頂部。這樣的話,他們就不符合VegetarianPizza 的充要條件了。 為了使這兩種pizza只有蔬菜和奶酪頂部,我們就得在hasTopping上使用closure axiom(封閉公理),36,2020/10/19,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 th
33、e existential restrictions for the property。 【為MargheritaPizza 的 hasTopping 添加封閉公理 】 【hasTopping only (MozzarellaTopping or TomatoTopping)】 【為其他幾個(gè)pizza使用更方便的方法添加封閉公理】 現(xiàn)在我們可以說,MargheritaPizza 至少有一個(gè)MozzarellaTopping和TomatoTopping,并且the toppings must only be kinds of MozzarellaTopping or TomatoTopping。
34、 【Classify之后我們看結(jié)果】,37,2020/10/19,4.15 Value Partitions,Value Partitionsare他并不屬于任何一種本體語言的一部分,而是一種設(shè)計(jì)模式,類似于面向?qū)ο蟪绦蛟O(shè)計(jì)中的設(shè)計(jì)模式。它可以改善我們對類的描述。 【創(chuàng)建thing的子類ValuePartition 】 【ValuePartition的子類SpicinessValuePartition(Hot Medium Mild)】 【創(chuàng)建Object Property hasSpiciness 并使其functional】 【為SpicinessValuePartition 增加cove
35、ring axiom 在equivalent里面輸入Hot or Medium or Mild】,38,2020/10/19,這種設(shè)計(jì)模式的效果我們可以看個(gè)對比圖:disjoint(關(guān)鍵詞),39,2020/10/19,4.16 Adding Spiciness to Pizza Toppings,【對PepperTopping的所有子類設(shè)置必要條件 hasSpiciness some Hot】 【定義Pizza的子類SpicyPizza 設(shè)置必要條件:hasTopping some (PizzaTopping and hasSpiciness some Hot)】 【將必要條件化為充要條件】
36、 Fillter描述了一個(gè)匿名類,這個(gè)頂是Pizzatopping,并且特別辣。 【Classifiy之后我們發(fā)現(xiàn)AmericanHotPizza 成為了SpicyPizza的子類】,40,2020/10/19,4.17 Cardinality Restrictions (Owl的restriction中的第二種),describe the class of individuals that have at least(min), at most(max)or exactly a specified number(exactly) of relationships with other ind
37、ividuals or datatype values. 【創(chuàng)建Pizza的子類InterestingPizza 定義必要條件hasTopping min 3】 注意:我們這里3后面并沒有指定fillter是什么,代表可以是任意的individuals,等價(jià)于:hasTopping min 3 Thing 【轉(zhuǎn)化為充要條件】 【Classify之后觀察?!?41,2020/10/19,4.18 Qualified(受限的) Cardinality Restrictions,他比上面的more specify 【定義NamedPizza的子類FourCheesePizza 定義必要條件hasTo
38、pping exactly 4 CheeseTopping】,42,2020/10/19,5. Datatype Properties,describe relationships between an individual and data values. 【現(xiàn)在來描述pizza所含的熱量】 【增加Datatype Properties hasCalorificContentValue】 【增加individual ExampleMargherita其 type是MargheritaPizza】 【為該對象增加Data Property assertion 其中type選擇integer 值
39、填寫250】 【增加individual ExampleSoho其 type是SohoPizza 】 【為該對象增加Data Property assertion 其中type選擇integer 值填寫800】,43,2020/10/19,我們聲明所有的pizza都有熱量值 【選定Pizza類 ,增加Supperclass 選擇Data restriction creator】 我們對pizza的熱量值進(jìn)行分類,產(chǎn)生不同的pizza 【創(chuàng)建HighCaloriePizza 和LowCaloriePizza 作為Pizza的子類】 【創(chuàng)建SupperClass 選擇Class expression editor 】 【鍵入Pizza that hasCalorificContentValue some integer= 400】 【同理LowCaloriePizza應(yīng)當(dāng)是 400】 【分別將他們設(shè)為充要條件】 【Classify之后我們看他們的members 】 某一確定的Pizza他所含的熱量是固定的,也就是說是單值的,我們可以使用functional來限定Data P
溫馨提示
- 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)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年中國鋁合金電腦箱市場調(diào)查研究報(bào)告
- 2025年銀行資金監(jiān)管與5G通信網(wǎng)絡(luò)建設(shè)合同
- 二零二五年度存款贈與與養(yǎng)老保障協(xié)議
- 碼頭合作經(jīng)營協(xié)議書(2025年度)-船舶靠泊效率優(yōu)化合同
- 二零二五年度新能源產(chǎn)業(yè)廣告宣傳合作協(xié)議
- 二零二五年度房屋拆除安全風(fēng)險(xiǎn)評估與管理合同
- 2025年度知識產(chǎn)權(quán)訴訟法律服務(wù)合同范本
- 二零二五年度農(nóng)村墓地使用權(quán)租賃及買賣合同
- 2025年度未婚母親自愿放棄撫養(yǎng)權(quán)及子女監(jiān)護(hù)權(quán)協(xié)議
- 二零二五年度房屋征收與搬遷補(bǔ)償安置合同范本
- 1.2 歌曲 《春天來了》 課件(11張)
- 【人教版】pep六年級英語下全冊教案(表格版)
- 護(hù)理培訓(xùn)師競聘
- 北師大版小學(xué)數(shù)學(xué)五年級下冊同步課時(shí)練習(xí)試題含答案(全冊)
- 4《我們的公共生活》第一課時(shí) 教學(xué)設(shè)計(jì)-2023-2024學(xué)年道德與法治五年級下冊統(tǒng)編版
- 2024年放射工作人員放射防護(hù)培訓(xùn)考試題及答案
- SH∕T 3097-2017 石油化工靜電接地設(shè)計(jì)規(guī)范
- 高中英語真題-高考英語語法填空專練(6)及答案
- 倉儲物流中心物業(yè)管理服務(wù)費(fèi)報(bào)價(jià)單
- 室內(nèi)給水管道安裝安全技術(shù)交底
- 全身望診課件
評論
0/150
提交評論