收藏 分销(赏)

protege构建本体教程PPT.ppt

上传人:w****g 文档编号:10236138 上传时间:2025-04-28 格式:PPT 页数:49 大小:443.43KB
下载 相关 举报
protege构建本体教程PPT.ppt_第1页
第1页 / 共49页
protege构建本体教程PPT.ppt_第2页
第2页 / 共49页
点击查看更多>>
资源描述
单击此处编辑母版标题样式,单击此处编辑母版文本样式,第二级,第三级,第四级,第五级,2,#,protege,构建本体教程,1,2,1.,什么是本体(,Ontologie,),Ontologies are used to capture knowledge about some domain of interest.,本体是用来获得你所感兴趣的领域的知识;,2,2025/4/28 周一,2.OWL Ontologies,The most recent development in standard ontology languages is OWL from the World Wide Web Consortium(W3C),由,w3c,从斯坦福大学的本体语言发展而来的。,3,2025/4/28 周一,3.OWL Ontologies,的组成,OWL Ontologies,与基于,Protege frame,的本体语言在组成上比较相似,但是从专业术语上来描述时他们又有着细微的不同。,OWL Ontologies,是由个体(,Individuals,),属性(,Properties,),类(,Classes,)组成,大致对应于,Protege frame,的,Instances,,,Slots,,,Classes.,4,2025/4/28 周一,3.1 Individuals,(个体),指的是在域(,domain,)中我们感兴趣的对象。类中的一个实例。,Individuals,必须明确的声明彼此之间是否相同。不同的名字可能指的是相同的,Individuals,。,5,2025/4/28 周一,3.2 Properties,(属性),指的是,Individuals,上二元关系,他连接着两个,Individuals,。如:小三的父亲叫大三。其中,“的父亲叫”就连接着小三和大三两个,Individuals,。,Properties,可以存在,reverse,,如上所示,“的父亲叫”的,reverse,就是“的儿子叫”。,Properties,可以被限定成单值,此时,Properties,是,functional,的。(后面介绍),Properties,也可以是,transitive,(可传递的)或,symmetric,(对称的)(后面介绍),6,2025/4/28 周一,3.3 Classes,可以看作是包含,Individuals,的集合。,我们使用正式而精准的形式来描述,Classes,。,Classes,通常被组织成,supperclasssubclass,形式的层状结构,比如,动物和狗。,7,2025/4/28 周一,4,创建本体,myPizza,(PizzaBase,是,Pizza,结构之一,中文叫“饼底”,主要由面粉做成,是,Pizza,的主体,和,pizza toppings,(比萨饼面)一起构成整个,Pizza),8,2025/4/28 周一,4.1,命名一个,Classes,(采用单词首字母大写方式,类似于,java,中类的命名),一个初始化的本体包含一个名字叫做,Thing,的,classes,,他表示包含所有,individuals,的集合,所以,所有的其他,classes,都是他的,subclasses,。,9,2025/4/28 周一,4.2 Disjoint,(解体),Classes,如果任意一个,Individuals,(或,Object,)仅仅是众多,Classes,中某一个的实例(,instance,),那么这些,Classes,是,Disjoint,的。,10,2025/4/28 周一,4.3 Using The OWL Tools To Create Classes,【,PizzaBase,子类,ThinAndCrispy,和,DeepPan,】,PizzaTopping,子类如下,Cheese,Mozzarella,Parmezan,Meat,Ham,Pepperoni,Salami,SpicyBeef,SeaFood,Anchovy,Prawn,Tuna,Vegtable,Caper,Mushroom,Olive,Onion,Pepper,RedPepper,GreenPepper,JalapenoPepper,Tomato,11,2025/4/28 周一,4.4 subclass,到底是什么意思呢,?,例如“狗”是“动物”的,subclass,。那么“狗”的,instance,也是“动物”的,instance,,一个东西是狗,那么他一定是动物。(这和,java,中的子类父类貌似是一样的),12,2025/4/28 周一,13,2025/4/28 周一,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,2025/4/28 周一,Object properties link an individual to an individual.,【,hasIngredien,子,hasBase hasTopping,】,我们可以创建,Sub properties,,它用来限定,Supper properties,的范围。,For example,the property,hasFather,might specialise,(限定范围),the more general property of,hasParent,.,小明有父亲大明,那么我们也可以说小明的双亲有大明。“有父亲”就是“有双亲”的,subproperty,。,15,2025/4/28 周一,4.6,Inverse 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,2025/4/28 周一,4.7 OWL Object Property Characteristics,(特征),OWL,允许通过使用,property characteristics,来增强,properties,的含义(内涵)。,17,2025/4/28 周一,(,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,,这个就是,functional,的,因为一个人他只能有一个生母。,18,2025/4/28 周一,另外:,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,same,individual.,但是如果,Lily,和,Mary,明确的声明为两个不同的,Individuals,,那么就会出现矛盾(,inconsistency,)。,19,2025/4/28 周一,(,2,),Inverse Functional Properties,就是,Functional Properties,的,inverse,如下:,20,2025/4/28 周一,(,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 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.,21,2025/4/28 周一,(,4,),Symmetric,(对称),Properties,If a property,P,is symmetric,and the property relates individual,a,to individual,b,then individual,b,is also related to individual a via property,P,.,如下:,22,2025/4/28 周一,(,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,2025/4/28 周一,(,6,),Reexive,(自反),properties,A property,P,is said to be reexive when the property must relate individual,a,to itself.,如下:,24,2025/4/28 周一,(,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 not the same.,也就是说,这种,properties,只能连接,不同的,individuals,。,如:,小明的父亲是大明,那么我们不能说小明的父亲是小明,25,2025/4/28 周一,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 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,PizzaTopping,。,另外:,如果有,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,2025/4/28 周一,4.9,描述和定义,Classes,4.9.1 Property Restrictions,Owl,的,restriction,有三种:,Quantifier Restrictions,Cardinality Restrictions,hasValue Restrictions.,27,2025/4/28 周一,1.quantifier restrictions,(,existential restrictions,和,universal restrictions,),Existential restrictions,:,describe classes of individuals that participate in,at least one,relationship along a speci,ed property to individuals that are members of a speci,ed class.,例子:我至少(,at least one,)买了一袋饼干从好又多超市。再比如:我做的蛋糕,上面至少覆盖了一层紫色奶酪,28,2025/4/28 周一,【,Pizza,限制,hasBase some PizzaBase】,29,2025/4/28 周一,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.,例子:我买的东西都是从好又多市(或者我买东西只(,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,都属于该匿名类的,“我做的蛋糕”这个类也属于这个匿名类。所以当我们对一个类进行限制时,在,supperclass,里定义。,30,2025/4/28 周一,2,定义一些其他的类(一些使用技巧),【,Pizza,子类,NamedPizza,】,【,NamedPizza,子类,MargheritaPizza,has at least one toppings of,MozzarellaTopping,and,TomatoTopping,】,【,创建,AmericanaPizza,通过克隆,MargheritaPizza,因为他扩展了一个限制,PepperoniTopping,】,【,创建,AmericanHotPizza,通过克隆,AmericanaPizza,增加限制,JalapenoPepperTopping,】,【,创建,SohoPizza,克隆,MargheritaPizza,增加,OliveTopping,和,ParmezanTopping,】,31,2025/4/28 周一,4.10,使用,Reasoner,(推理机),the reasoner shipped with Prot,eg,e is called Fact+.,两种,hierarchy,:,In Prot,eg,e 4 the,manually constructed,class hierarchy is called the,asserted hierarchy,.The class hierarchy that is automatically computed by the reasoner is called the,inferred 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,的之后,再,Classify,,观察结果,】,32,2025/4/28 周一,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 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 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)individual satis,es these conditions then it must be a member of class A.,33,2025/4/28 周一,4.12 Automated Classification,(自动分类),为什么要使用,Reasoner,。当我们创建了成百上千的类时,使用,Reasoner,来自动计算子类父类之间的关系将是十分必要的。没有了,Reasoner,我们很难保证 大规模本体的健壮性和逻辑性。自动分类这项技术,使得本体可维护并且模块化,它不仅使得其他的本体和程序能够,reuse,我们定义的本体,而且还最大限度的减少了使用者在建立多继承类时的错误。,【,使用,OWLViz,显示类的继承层次结构,】,34,2025/4/28 周一,4.13 Universal Restrictions,(,Quantifier Restrictions,),【,创建一个,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 for it to only(universal quantier)have toppings that are kinds of,CheeseTopping,or kinds of,VegetableTopping,,,也可以没有,比如,中国现在实行计划生育,如果夫妻有了孩子那么只能有一个,但是这个夫妻也可以没有孩子。那么就不存在,only,这个限制。,【,将上面的必要条件转化为充分条件,】,35,2025/4/28 周一,4.14 Automated Classification and Open World Reasoning,【,使用推理机进行自动分类,】,我们发现,MargheritaPizza,和,SohoPizza,并没有被归类为,VegetarianPizza,的子类,但是按照我们的定义,,MargheritaPizza,和,SohoPizza,都至少有个蔬菜的顶部和奶酪的顶部,再看,VegetarianPizza,的充要条件,,only have,蔬菜的顶部和奶酪的顶部的,pizza,都是,VegetarianPizza,。,但是,Reasoning in OWL,(Description Logics)is based on what is known as the,open world assumption,(OWA),,意思是,除非我们明确的说明某个事物的存在,否则我们就不能说他是存在的。分析上面的:因为我们没有明确的指定他们只有奶酪和蔬菜顶,那么他们就可以有其他的顶部。这样的话,他们就不符合,VegetarianPizza,的充要条件了。,为了使这两种,pizza,只有蔬菜和奶酪顶部,我们就得在,hasTopping,上使用,closure axiom,(封闭公理),36,2025/4/28 周一,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(MozzarellaTopping or TomatoTopping),】,【,为其他几个,pizza,使用更方便的方法添加封闭公理,】,现在我们可以说,,MargheritaPizza,至少有一个,MozzarellaTopping,和,TomatoTopping,,并且,the toppings must only be kinds of MozzarellaTopping or TomatoTopping,。,【,Classify,之后我们看结果,】,37,2025/4/28 周一,4.15 Value Partitions,Value Partitionsare,他并不属于任何一种本体语言的一部分,而是一种设计模式,类似于面向对象程序设计中的设计模式。它可以改善我们对类的描述。,【,创建,thing,的子类,ValuePartition,】,【,ValuePartition,的子类,SpicinessValuePartition,(,Hot Medium Mild,),】,【,创建,Object Property,hasSpiciness,并使其,functional,】,【,为,SpicinessValuePartition,增加,covering axiom,在,equivalent,里面输入,Hot or Medium or Mild,】,38,2025/4/28 周一,这种设计模式的效果我们可以看个对比图:,disjoint(,关键词,),39,2025/4/28 周一,4.16 Adding Spiciness to Pizza Toppings,【,对,PepperTopping,的所有子类设置必要条件,hasSpiciness some Hot,】,【,定义,Pizza,的子类,SpicyPizza,设置必要条件:,hasTopping some(PizzaTopping and hasSpiciness some Hot),】,【,将必要条件化为充要条件,】,Fillter,描述了一个匿名类,这个顶是,Pizzatopping,,并且特别辣。,【,Classifiy,之后我们发现,AmericanHotPizza,成为了,SpicyPizza,的子类,】,40,2025/4/28 周一,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 individuals or datatype values.,【,创建,Pizza,的子类,InterestingPizza,定义必要条件,hasTopping min 3,】,注意:我们这里,3,后面并没有指定,fillter,是什么,代表可以是任意的,individuals,,等价于:,hasTopping min 3 Thing,【,转化为充要条件,】,【,Classify,之后观察。,】,41,2025/4/28 周一,4.18 Qualified,(受限的),Cardinality Restrictions,他比上面的,more specify,【,定义,NamedPizza,的子类,FourCheesePizza,定义必要条件,hasTopping exactly 4 CheeseTopping,】,42,2025/4/28 周一,5.Datatype Properties,describe relationships between an individual and data values.,【,现在来描述,pizza,所含的热量,】,【,增加,Datatype Properties hasCalorificContentValue,】,【,增加,individual ExampleMargherita,其,type,是,MargheritaPizza,】,【,为该对象增加,Data Property assertion,其中,type,选择,integer,值填写,250,】,【,增加,individual ExampleSoho,其,type,是,SohoPizza,】,【,为该对象增加,Data Property assertion,其中,type,选择,integer,值填写,800,】,43,2025/4/28 周一,我们声明所有的,pizza,都有热量值,【,选定,Pizza,类,增加,Supperclass,选择,Data restriction creator,】,我们对,pizza,的热量值进行分类,产生不同的,pizza,【,创建,HighCaloriePizza,和,LowCaloriePizza,作为,Pizza,的子类,】,【,创建,SupperClass,选择,Class expression editor,】,【,键入,Pizza that hasCalorificContentValue some integer=400,】,【,同理,LowCaloriePizza,应当是,400,】,【,分别将他们设为充要条件,】,【,Classify,之后我们看他们的,members,】,某一确定的,Pizza,他所含的热量是固定的,也就是说是单值的,我们可以使用,functional,来限定,Data Property,。,【,选定,hasCalorificContentValue,选中,functional,】,44,2025/4/28 周一,6.More On Open World Reasoning,这部分主要展示了,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,】,【,必要条件:,hasTopping some MozzarellaTopping,】,【,Classify.,之后观察,UnclosedPizza,既不是,VegetarianPizza,也不是,NonVegetarianPizza.,】,前面封闭公理部分已经讲过了原因。,45,2025/4/28 周一,我们创建一个类,,does not have a closure axiom,(封闭公理),on the hasTopping property,【,创建,NamedPizza,的子类,UnclosedPizza,】,【,必要条件:,hasTopping some MozzarellaTopping,】,【,Classify.,之后观察,UnclosedPizza,既不是,VegetarianPizza,也不是,NonVegetarianPizza.,】,前面封闭公理部分已经讲过了原因。,46,2025/4/28 周一,7.Creating Other OWL Constructs,7.1 Creating Individuals,我们现在来描述,pizza,饼起源的国家;,【,创建,Thing,的子类,Country,】,【,创建,individual,:,Italy England America France,】,因为相同的,individual,可以有不同的名称。,【,是他们,Different from each other,】,47,2025/4/28 周一,7.2 hasValue Restrictions,(,Owl,的,restriction,中的第三种,),描述的是两个,individual,之间至少有的关系,P,,,【,创建,Object property,:,hasCountryOfOrigin,】,【,选定,MozzarellaTopping,增加必要条件,hasCountryOfOrigin value Italy,】,48,2025/4/28 周一,7.3 Enumerated Classes,【,选定,Country,类,在,Equivalent class,处增加,America,England,France,Italy,】,意思是如果一个,individual,他属于,Country,,那么他一定属于这几个国家中的一个。,49,2025/4/28 周一,
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传
相似文档                                   自信AI助手自信AI助手

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:4009-655-100  投诉/维权电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服