protege构建本体教程.docx
- 文档编号:29258641
- 上传时间:2023-07-21
- 格式:DOCX
- 页数:17
- 大小:238.40KB
protege构建本体教程.docx
《protege构建本体教程.docx》由会员分享,可在线阅读,更多相关《protege构建本体教程.docx(17页珍藏版)》请在冰豆网上搜索。
protege构建本体教程
via
TheProtegeplatformsupportstwomainwaysofmodelingontologiestheProtege-FramesandProtege-OWLeditors(我们使用的是后者)
1.什么是本体(Ontologie)
Ontologiesareusedtocaptureknowledgeaboutsomedomainofinterest.
本体是用来获得你所感兴趣的领域的知识;
2.OWLOntologies
ThemostrecentdevelopmentinstandardontologyIanguagesisOWLfromtheWorldWideWebConsortium(W3C)
由w3c从斯坦福大学的本体语言发展而来的。
3.OWLOntologies的组成
OWLOntologies与基于Protegeframe的本体语言在组成上比较
相似,但是从专业术语上来描述时他们又有着细微的不同。
OWL
Ontologies是由个体(Individuals),属性(Properties),类(Classes组成,大致对应于Protegeframe的Instances,Slots,Classes.
3.1Individuals(个体)
指的是在域(domain)中我们感兴趣的对象。
类中的一个实例。
Individuals必须明确的声明彼此之间是否相同。
不同的名字可能指
的是相同的Individuals。
3.2Properties(属性)
指的是Individuals上二元关系,他连接着两个Individuals。
如:
小
三的父亲叫大三。
其中,“的父亲叫”就连接着小三和大三两个
Individuals。
Properties可以存在reverse,如上所示,“的父亲叫”的reverse就是“的儿子叫”。
Properties可以被限定成单值,此时Properties是functional的。
(后面介绍)
Properties也可以是transitive(可传递的)或symmetric(对称的)(后面介绍)
3.3Classes
可以看作是包含Individuals的集合。
我们使用正式而精准的形式来描述ClassesClasses®常被组织成
supperclass-subclass形式的层状结构,比如,动物和狗。
4仓【I建本体myPizza
(PizzaBase是Pizza结构之一,中文叫“饼底”,主要由面粉做成,是Pizza的主体,和pizzatoppings(比萨饼面)一起构成整个Pizza)
4.1命名一个Classes(采用单词首字母大写方式,类似于java中类的命名)
一个初始化的本体包含一个名字叫做Thing的classes他表示包含所有individuals的集合,所以,所有的其他classes都是他的subclasses
4.2Disjoint(解体)Classes
如果任意一个Individuals(或Object)仅仅是众多Classes中某一个的实例(instanee),那么这些Classes是Disjoint的。
4.3UsingTheOWLToolsToCreateClasses
【PizzaBase子类ThinAndCrispy和DeepPar】
PizzaTopping子类如下
Cheese
Mozzarella
Parmezan
Meat
Ham
Pepperoni
Salami
SpicyBeef
SeaFood
Anchovy
Prawn
Tuna
Vegtable
Caper
Mushroom
Olive
Onion
Pepper
RedPepper
GreenPepper
JalapenoPepper
Tomato
4.4subclass到底是什么意思呢?
例如“狗”是“动物”的subclass那么“狗”的instanee也是“动
物”的instanee,—个东西是狗,那
么他一定是动物。
(这和java中的子类父类貌似是一样的)
Pizz日Topping
VegetableTopping
TheMeaningOfSubclass——.4//individualsthatarememberscftheclassTcmatoTbppinreinembeisoftheVeQetab]eTopaingandMitiubersofthePZZaTopcinga*ha1*estaitd
LhatTcmatoTopp)且±tibMd^ufVAge:
aDleTopning昭hick詮astiLcl^ufPiz;aToppng
4.5.OWLProperties
(概述)OWLPropertiesrepresentrelationships.Therearetwomaintypesofproperties,ObjectpropertiesandDatatypeproperties.Objectpropertiesarerelationshipsbetweentwoindividuals.(先介绍Objectproperties)如下是Objectproperties禾口Datatypeproperties
Y^^sSister
MatthewGemma
Anabjectpropertylinkinqth「individualMarth^»wroTh^incdivicJual
MarrhewH2SWAAxsd:
int«*g*>r
Adatatypepropertyhrnkingtheindividual
Mrirthewtothed Objectpropertieslinkanindividualtoanindividual. 【hasIngredien子hasBasehasToppinj 我们可以创建Subproperties,它用来限定Supperproperties的围。 Forexample,thepropertyhasFathermightspecialise(限定围)themoregeneralpropertyofhasParent小明有父亲大明,那么我们也可以说小明的双亲有大明。 “有父亲”就是“有双亲”的subproperty。 4.6InverseProperties(逆属性) 【islngredientOf子isBaseOfisToppingO】 如该例中: : hasBase和isBaseOf就是一对InverseProperties Forexample: ifMatthewhasParentJean,thentheinversepropertywecaninferthatJeanhasChildMatthew. 4.7OWLObjectPropertyCharacteristics(特征) OWL允许通过使用propertycharacteristics来增强properties的含义(涵)。 (1)FunctionalProperties 也就是说,Properties是单值的。 例如: : hasBirthMother,这个就是functional的,因为一个人他只能有一个生母。 另外: : IfwesaythattheindividualJeanhasBirthMotherLilyandwealsosaythattheindividualJeanhasBirthMotherMary,thenbecausehasBirthMotherisafunctionalproperty,wecaninferthatLilyandMarymustbethesameindividual.但是如果Lily和Mary明确的声明为两个不同的Individuals,那么就会出现矛盾(inconsistency)。 Figure4.19: AnExampleOfAFimctionalProperty: hasBirthMother (2)InverseFunctionalProperties 就是FunctionalProperties的inverse如下: : ure4.20: A.iExanrpleOfAnInverseFunctionalProperty7: JSBirthMothGrOf (3)TransitiveProperties thatindividualaisrelatedtoindividualcviapropertyP.如下: : Figure4.21: AnExampleOfATransitiveProperty: hasAncestOf注: : a)Ifapropertyistransitivethenitsinversepropertyshouldalsobetransitive.(祖先那个例子) William b)ifapropertyistransitivethenitcannotbefunctional. (4)Symmetric(对称)Properties IfapropertyPissymmetric,andthepropertyrelatesindividualatoindividualbthenindividualbisalsorelatedtoindividualaviapropertyP.如下: : 斤曲ibling——&绅论 — Figure4.22: AnExampleOfASymmetricProperty: hasSibling (5)Antisymmetric(反对称)properties individualaviapropertyP.如下: : Figure4.24: AnexampleoftheantisymmetricpropertyhasCliildOf (6)Re? exive(自反)properties ApropertyPissaidtobere? exivewhenthepropertymustrelate individualatoitself.如下: : Figure4<25iAnexampleofaReflexivePropertv: knows (7)Irre? exive(非自反)properties IfapropertyPisirre? exive,itcanbedescribedasapropertythat relatesanindividualatoindividualb,whereindividualaand individualbarenotthesame.也就是说,这种properties只能连接 不同的individuals。 如: : 小明的父亲是大明,那么我们不能说小 明的父亲是小明 4.8PropertyDomainsandRanges 【定义hasTopping的RangePizzaToppingdomainPizza】 【定义isToppingOf的RangePizzadomainPizzaTopping] Propertiesmayhaveadomainandarangespeci? ed(指定的).Propertieslinkindividualsfromthedomaintoindividualsfromtherange. 例如: : inmyPizza本体,thepropertyhasToppingwouldprobablylinkindividualsbelongingthetheclassPizzatoindividualsbelongingtotheclassofPizzaToppingInthiscasethedomainofthehasToppingpropertyisPizzaandtherangeisPizzaTopping 另外: : 女口果有ahasToppingb,并且a与b都是individuals,那么我们就可以说a属于classPizza,b属于classPizzaTopping通常来说,domainforapropertyistherangeforitsinverse,andtherangeforapropertyisthedomainforitsinverse 4.9描述和定义Classes 4.9.1PropertyRestrictions Owl的restriction有三种: QuantifierRestrictions CardinalityRestrictions hasValueRestrictions. 1.quantifierrestrictons(existentialrestrictions和universalrestrictions) Existentialrestrictions: describeclassesofindividualsthatparticipateinatleastonerelationshipalongaspec? edpropertytoindividualsthataremembersofaspeci? edclass. 例子: : 我至少(atleastone)买了一袋饼干从好又多超市。 再比如: : 我做的蛋糕,上面至少覆盖了一层紫色奶酪 Thir>qsthathaveatleastoneMozzare-HaTcppingfhasToppingsorreMczza^e-ILaToppinq Figure4.29;Ihi"Restricti[inhaslbppingsomeMo77araNa«ThisrwtricticmdescribeethecIakofindividualsthat3ia\■&atleastcm冒tuppingtbatisMozzargla 【Pizza限制hasBasesomePizzaBaseuniversalrestrictions describeclassesofindividualsthatforagivenpropertyonlyhaverelationshipsalongthispropertytoindividualsthataremembersofaspecifiedclass. 例子: : 我买的东西都是从好又多市(或者我买东西只(only)从好 又多超市) 注: : Arestrictondescribesananonymousclass(anunnamedclass).Theanonymousclasscontainsalloftheindividualsthatsatisfytherestriction。 例如: Existentialrestrictions“上面至少覆盖了一层紫色奶酪。 ”这句话就描述了一个匿名类,任何上面覆盖至少一层紫色奶酪的individuals都属于该匿名类的,“我做的蛋糕”这个类也属于这个匿名类。 所以当我们对一个类进行限制时,在supperclass里定义。 2定义一些其他的类(一些使用技巧) 【Pizza子类NamedPizza 【NamedPizza子类MargheritaPizzahasatleastonetoppingsof MozzarellaToppingandTomatoTopping】 【创建AmericanaPizza通过克隆MargheritaPizza因为他扩展了 一个限制PepperoniTopping 【创建AmericanHotPizza通过克隆AmericanaPizza增加限制 JalapenoPepperToppind 【创建SohoPizza克隆MargheritaPizza增加OliveTopping和 ParmezanToppinQ 4.10使用Reasoner(推理机) : thereasonershippedwithProt'eg'eiscalledFact++. : 两不中hierarchy: InProt'eg'e4the‘manuallyconstructed'classhierarchyiscalledtheassertedhierarchy.Theclasshierarchythatisautomaticallycomputedbythereasoneriscalledtheinferredhierarchy. : 主要功能: 1,判断一个类是否是另一个类的子类 2,consistencychecking(—致性检测) : 【为了使用推理机,我们先定义一个矛盾的类ProbeInconsistentTopping,让他既是CheeseTopping又是VegetableTopping的子类,前提是这两个类是disjoint的】: Ifaclasshasbeenfoundtobeinconsistentit'icosnwillbehighlightedinred. 【将CheeseToppingVegetableTopping设为非disjoint的之后,再Classify观察结果】 4.11充分必要条件(primitiveclass和definedclass) Alloftheclassesthatwehavecreatedsofarhaveonlyusednecessaryconditionstodescribethem.Necessaryconditionscanbereadas,“Ifsomethingisamemberofthisclassthenitisnecessarytofulfilltheseconditions”.Withnecessaryconditionsalone,wecannotsaythat,“Ifsomethingfulfillstheseconditionsthenitmustbeamemberofthisclass”. 只定义了必要条件的类叫做primitiveclass定义了充要条件的类叫做definedclass 【定义Pizza的子类CheesyPizza定义限制hasToppingsomeCheeseTopping】 【将其转化为充分必要条件】 【Classify我们可以看出definedclass的不同】总结: : ifclassAisnowdefinedusingnecessaryandsufficientconditions,wecansaythatifanindividualisamemberoftheclassAitmustsatisfytheconditionsandwecannowsaythatifany(random)individualsatis? estheseconditionsthenitmustbeamemberofclassA. 4.12AutomatedClassification(自动分类) 为什么要使用Reasone。 当我们创建了成百上千的类时,使用 Reasoner来自动计算子类父类之间的关系将是十分必要的。 没有了Reasoner我们很难保证大规模本体的健壮性和逻辑性。 自动分类这项技术,使得本体可维护并且模块化,它不仅使得其他的本体和程序能够reuse我们定义的本体,而且还最大限度的减少了使用者在建立多继承类时的错误。 【使用OWLViz显示类的继承层次结构】 4.13UniversalRestrictions(QuantifierRestrictions) 【创建一个Pizza的子类VegetarianPizza] 【增加限制hasToppingonly(CheeseToppingprVegtableTopping] ThismeansthatifsomethingisamemberoftheclassVegetarianPizzaitisnecessaryforittobeakndofPizzaanditisnecessaryforittoonly(universalquanti? er)havetoppingsthatarekindsofCheeseToppingorkindsofVegetableTopping、也可以没有,比如,中国现在实行计戈『生育,如果夫妻有了孩子那么只能有一个,但是这个夫妻也可以没有孩 子。 那么就不存在only这个限制。 【将上面的必要条件转化为充分条件] 4.14AutomatedClassificationandOpenWorldReasoning 【使用推理机进行自动分类】 我们发现MargheritaPizza和SohoPizza并没有被归类为VegetarianPizza的子类,但是按照我们的定义,MargheritaPizza和SohoPizza都至少有个蔬菜的顶部和奶酪的顶部,再看Vegeta
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- protege 构建 本体 教程