protege构建本体教程课件.ppt

上传人:小飞机 文档编号:2139789 上传时间:2023-01-17 格式:PPT 页数:49 大小:415.50KB
返回 下载 相关 举报
protege构建本体教程课件.ppt_第1页
第1页 / 共49页
protege构建本体教程课件.ppt_第2页
第2页 / 共49页
protege构建本体教程课件.ppt_第3页
第3页 / 共49页
protege构建本体教程课件.ppt_第4页
第4页 / 共49页
protege构建本体教程课件.ppt_第5页
第5页 / 共49页
点击查看更多>>
资源描述

《protege构建本体教程课件.ppt》由会员分享,可在线阅读,更多相关《protege构建本体教程课件.ppt(49页珍藏版)》请在三一办公上搜索。

1、A,1,protege构建本体教程,A,2,1.什么是本体(Ontologie),Ontologies are used to capture knowledge about some domain of interest.本体是用来获得你所感兴趣的领域的知识;,A,3,2.OWL Ontologies,The most recent development in standard ontology languages is OWL from the World Wide Web Consortium(W3C)由w3c从斯坦福大学的本体语言发展而来的。,A,4,3.OWL Ontologies

2、的组成,OWL Ontologies与基于Protege frame的本体语言在组成上比较相似,但是从专业术语上来描述时他们又有着细微的不同。OWL Ontologies是由个体(Individuals),属性(Properties),类(Classes)组成,大致对应于Protege frame的Instances,Slots,Classes.,A,5,3.1 Individuals(个体)指的是在域(domain)中我们感兴趣的对象。类中的一个实例。Individuals必须明确的声明彼此之间是否相同。不同的名字可能指的是相同的Individuals。,A,6,3.2 Properties

3、(属性)指的是Individuals上二元关系,他连接着两个Individuals。如:小三的父亲叫大三。其中,“的父亲叫”就连接着小三和大三两个Individuals。Properties可以存在reverse,如上所示,“的父亲叫”的reverse就是“的儿子叫”。Properties可以被限定成单值,此时Properties是functional的。(后面介绍)Properties也可以是transitive(可传递的)或symmetric(对称的)(后面介绍),A,7,3.3 Classes可以看作是包含Individuals的集合。我们使用正式而精准的形式来描述Classes。Cla

4、sses通常被组织成supperclasssubclass形式的层状结构,比如,动物和狗。,A,8,4 创建本体myPizza,(PizzaBase是Pizza结构之一,中文叫“饼底”,主要由面粉做成,是Pizza的主体,和pizza toppings(比萨饼面)一起构成整个Pizza),A,9,4.1 命名一个Classes(采用单词首字母大写方式,类似于java中类的命名)一个初始化的本体包含一个名字叫做Thing的classes,他表示包含所有individuals的集合,所以,所有的其他classes都是他的subclasses。,A,10,4.2 Disjoint(解体)Classe

5、s如果任意一个Individuals(或Object)仅仅是众多Classes中某一个的实例(instance),那么这些Classes是Disjoint的。,A,11,4.3 Using The OWL Tools To Create Classes,【PizzaBase 子类 ThinAndCrispy 和 DeepPan】PizzaTopping子类如下CheeseMozzarellaParmezanMeatHamPepperoniSalamiSpicyBeefSeaFoodAnchovyPrawnTunaVegtableCaperMushroomOliveOnionPepperRedP

6、epperGreenPepperJalapenoPepperTomato,A,12,4.4 subclass到底是什么意思呢?,例如“狗”是“动物”的subclass。那么“狗”的instance也是“动物”的instance,一个东西是狗,那么他一定是动物。(这和java中的子类父类貌似是一样的),A,13,A,14,4.5.OWL Properties,(概述)OWL Properties represent relationships.There are two main types of properties,Object properties and Datatype propert

7、ies.Object properties are relationships between two individuals.(先介绍Object properties)如下是Object properties 和 Datatype properties,A,15,Object properties link an individual to an individual.【hasIngredien 子 hasBase hasTopping】我们可以创建Sub properties,它用来限定Supper properties的范围。For example,the property hasFa

8、ther might specialise(限定范围)the more general property of hasParent.小明有父亲大明,那么我们也可以说小明的双亲有大明。“有父亲”就是“有双亲”的subproperty。,A,16,4.6 Inverse Properties(逆属性)【isIngredientOf 子 isBaseOf isToppingOf】如该例中:hasBase 和 isBaseOf就是一对Inverse PropertiesFor example:if Matthew hasParent Jean,then the inverse property we

9、can infer that Jean hasChild Matthew.,A,17,4.7 OWL Object Property Characteristics(特征)OWL允许通过使用property characteristics来增强properties的含义(内涵)。,A,18,(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

10、property.也就是说,Properties是单值的。例如:hasBirthMother,这个就是functional的,因为一个人他只能有一个生母。,A,19,另外:If we say 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 s

11、ame individual.但是如果Lily和Mary明确的声明为两个不同的Individuals,那么就会出现矛盾(inconsistency)。,A,20,(2)Inverse Functional Properties,就是Functional Properties 的 inverse 如下:,A,21,(3)Transitive Properties,If a property is transitive,and the property relates individual a to individual b,and also individual b to individual

12、c,then we can infer that individual a is related to individual c via property P.如下:,注:a)If a property is transitive then its inverse property should also be transitive.(祖先那个例子)b)if a property is transitive then it cannot be functional.,A,22,(4)Symmetric(对称)Properties,If a property P is symmetric,and

13、 the property relates individual a to individual b then individual b is also related to individual a via property P.如下:,A,23,(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

14、property P.如下:,A,24,(6)Reexive(自反)properties,A property P is said to be reexive when the property must relate individual a to itself.如下:,A,25,(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

15、 individual b are not the same.也就是说,这种properties只能连接不同的individuals。如:小明的父亲是大明,那么我们不能说小明的父亲是小明,A,26,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

16、individuals 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

17、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,A,27,4.9描述和定义Classes,4.9.1 Property RestrictionsOwl的restriction有三种:Quantifier RestrictionsCard

18、inality RestrictionshasValue Restrictions.,A,28,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 that are members of a specied cl

19、ass.例子:我至少(at least one)买了一袋饼干从好又多超市。再比如:我做的蛋糕,上面至少覆盖了一层紫色奶酪,A,29,【Pizza 限制 hasBase some PizzaBase】,A,30,universal restrictions:,describe classes of individuals that for a given property only have relationships along this property to individuals that are members of a specified class.例子:我买的东西都是从好又多市(

20、或者我买东西只(only)从好又多超市)注:A restriction describes an anonymous class(an unnamed class).The anonymous class contains all of the individuals that satisfy the restriction。例如:Existential restrictions“上面至少覆盖了一层紫色奶酪。”这句话就描述了一个匿名类,任何上面覆盖至少一层紫色奶酪的individuals都属于该匿名类的,“我做的蛋糕”这个类也属于这个匿名类。所以当我们对一个类进行限制时,在supperclas

21、s里定义。,A,31,2 定义一些其他的类(一些使用技巧),【Pizza 子类 NamedPizza】【NamedPizza 子类MargheritaPizza has at least one toppings of MozzarellaTopping and TomatoTopping】【创建AmericanaPizza 通过克隆 MargheritaPizza 因为他扩展了一个限制 PepperoniTopping】【创建AmericanHotPizza 通过克隆 AmericanaPizza 增加限制JalapenoPepperTopping】【创建SohoPizza 克隆Marghe

22、ritaPizza 增加OliveTopping 和ParmezanTopping】,A,32,4.10 使用Reasoner(推理机),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 reasoner is called the i

23、nferred hierarchy.主要功能:1,判断一个类是否是另一个类的子类2,consistency checking(一致性检测)【为了使用推理机,我们先定义一个矛盾的类ProbeInconsistentTopping,让他既是CheeseTopping 又是 VegetableTopping的子类,前提是这两个类是disjoint的】:If a class has been found to be inconsistent its icon will be highlighted in red.【将CheeseTopping VegetableTopping 设为非disjoint的

24、之后,再Classify,观察结果】,A,33,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 conditions”.With

25、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】【将其转化为充分必要条件】【Classify 我们可以看出defined class 的不同】总结:if class A is no

26、w 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)individual satises these conditions then it must be a member of class A.,A,34,4.12 Automated Classification(自动分类),为什么要使

27、用Reasoner。当我们创建了成百上千的类时,使用Reasoner来自动计算子类父类之间的关系将是十分必要的。没有了Reasoner我们很难保证 大规模本体的健壮性和逻辑性。自动分类这项技术,使得本体可维护并且模块化,它不仅使得其他的本体和程序能够reuse 我们定义的本体,而且还最大限度的减少了使用者在建立多继承类时的错误。【使用OWLViz 显示类的继承层次结构】,A,35,4.13 Universal Restrictions(Quantifier Restrictions),【创建一个Pizza的子类VegetarianPizza】【增加限制 hasTopping only(Chee

28、seTopping 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 for it to only(universal quantier)have toppings that are kinds of CheeseTopping or kinds of VegetableTopping,也可以没有,比如,中国现在实行计划生育,如果夫妻有了

29、孩子那么只能有一个,但是这个夫妻也可以没有孩子。那么就不存在only这个限制。【将上面的必要条件转化为充分条件】,A,36,4.14 Automated Classification and Open World Reasoning,【使用推理机进行自动分类】我们发现MargheritaPizza 和SohoPizza 并没有被归类为 VegetarianPizza的子类,但是按照我们的定义,MargheritaPizza 和 SohoPizza 都至少有个蔬菜的顶部和奶酪的顶部,再看VegetarianPizza 的充要条件,only have 蔬菜的顶部和奶酪的顶部的pizza都是Vege

30、tarianPizza。但是Reasoning in OWL(Description Logics)is based on what is known as the open world assumption(OWA),意思是,除非我们明确的说明某个事物的存在,否则我们就不能说他是存在的。分析上面的:因为我们没有明确的指定他们只有奶酪和蔬菜顶,那么他们就可以有其他的顶部。这样的话,他们就不符合VegetarianPizza 的充要条件了。为了使这两种pizza只有蔬菜和奶酪顶部,我们就得在hasTopping上使用closure axiom(封闭公理),A,37,4.14.1 Closure

31、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(MozzarellaTopping or TomatoTopping)】【为其他几个pizza使用更方便的方法添加封闭公理】现

32、在我们可以说,MargheritaPizza 至少有一个MozzarellaTopping和TomatoTopping,并且the toppings must only be kinds of MozzarellaTopping or TomatoTopping。【Classify之后我们看结果】,A,38,4.15 Value Partitions,Value Partitionsare他并不属于任何一种本体语言的一部分,而是一种设计模式,类似于面向对象程序设计中的设计模式。它可以改善我们对类的描述。【创建thing的子类ValuePartition】【ValuePartition的子类Sp

33、icinessValuePartition(Hot Medium Mild)】【创建Object Property hasSpiciness 并使其functional】【为SpicinessValuePartition 增加covering axiom 在equivalent里面输入Hot or Medium or Mild】,A,39,这种设计模式的效果我们可以看个对比图:disjoint(关键词),A,40,4.16 Adding Spiciness to Pizza Toppings,【对PepperTopping的所有子类设置必要条件 hasSpiciness some Hot】【定

34、义Pizza的子类SpicyPizza 设置必要条件:hasTopping some(PizzaTopping and hasSpiciness some Hot)】【将必要条件化为充要条件】Fillter描述了一个匿名类,这个顶是Pizzatopping,并且特别辣。【Classifiy之后我们发现AmericanHotPizza 成为了SpicyPizza的子类】,A,41,4.17 Cardinality Restrictions(Owl的restriction中的第二种),describe the class of individuals that have at least(min)

35、,at most(max)or exactly a specified number(exactly)of relationships with other individuals or datatype values.【创建Pizza的子类InterestingPizza 定义必要条件hasTopping min 3】注意:我们这里3后面并没有指定fillter是什么,代表可以是任意的individuals,等价于:hasTopping min 3 Thing【转化为充要条件】【Classify之后观察。】,A,42,4.18 Qualified(受限的)Cardinality Restri

36、ctions,他比上面的more specify【定义NamedPizza的子类FourCheesePizza 定义必要条件hasTopping exactly 4 CheeseTopping】,A,43,5.Datatype Properties,describe relationships between an individual and data values.【现在来描述pizza所含的热量】【增加Datatype Properties hasCalorificContentValue】【增加individual ExampleMargherita其 type是MargheritaP

37、izza】【为该对象增加Data Property assertion 其中type选择integer 值填写250】【增加individual ExampleSoho其 type是SohoPizza】【为该对象增加Data Property assertion 其中type选择integer 值填写800】,A,44,我们声明所有的pizza都有热量值【选定Pizza类,增加Supperclass 选择Data restriction creator】我们对pizza的热量值进行分类,产生不同的pizza【创建HighCaloriePizza 和LowCaloriePizza 作为Pizza

38、的子类】【创建SupperClass 选择Class expression editor】【键入Pizza that hasCalorificContentValue some integer=400】【同理LowCaloriePizza应当是 400】【分别将他们设为充要条件】【Classify之后我们看他们的members】某一确定的Pizza他所含的热量是固定的,也就是说是单值的,我们可以使用functional来限定Data Property。【选定hasCalorificContentValue 选中functional】,A,45,6.More On Open World Reas

39、oning,这部分主要展示了Open World Reasoning中的细微差别【创建NonVegetarianPizza 类,作为VegetarianPizza类的complement】【使他们disjoint】【双击Supperclass中的pizza,添加Pizza and not VegetarianPizza】【转换为充分必要条件】【Classify.之后观察】我们创建一个类,does not have a closure axiom(封闭公理)on the hasTopping property【创建NamedPizza的子类UnclosedPizza】【必要条件:hasToppi

40、ng some MozzarellaTopping】【Classify.之后观察UnclosedPizza 既不是VegetarianPizza也不是NonVegetarianPizza.】前面封闭公理部分已经讲过了原因。,A,46,我们创建一个类,does not have a closure axiom(封闭公理)on the hasTopping property【创建NamedPizza的子类UnclosedPizza】【必要条件:hasTopping some MozzarellaTopping】【Classify.之后观察UnclosedPizza 既不是VegetarianPiz

41、za也不是NonVegetarianPizza.】前面封闭公理部分已经讲过了原因。,A,47,7.Creating Other OWL Constructs,7.1 Creating Individuals我们现在来描述pizza饼起源的国家;【创建Thing 的子类Country】【创建 individual:Italy England America France】因为相同的individual可以有不同的名称。【是他们Different from each other】,A,48,7.2 hasValue Restrictions(Owl的restriction中的第三种)描述的是两个individual之间至少有的关系P,【创建Object property:hasCountryOfOrigin】【选定MozzarellaTopping 增加必要条件hasCountryOfOrigin value Italy】,A,49,7.3 Enumerated Classes【选定Country类,在Equivalent class处增加America,England,France,Italy】意思是如果一个individual他属于Country,那么他一定属于这几个国家中的一个。,

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号