杜剑锋 Protege教程.ppt
《杜剑锋 Protege教程.ppt》由会员分享,可在线阅读,更多相关《杜剑锋 Protege教程.ppt(76页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、Protg Tutorial主讲:杜剑峰Protg Tutorial:OverviewnSession 1:Interface basicsnSession 2:Defining a vegetarian pizza2nReview:OWL BasicsnIntro:Protg-OWLnInterface:Creating ClassesnConcept:DisjointnessnInterface:Creating PropertiesnConcept:Describing ClassesnInterface:Creating RestrictionsSession 1:Interface
2、Basics3Review of OWLOWLnis a W3C standard Web Ontology Languagencomes in 3 flavours(Lite,DL and Full)qwe are using OWL DL(Description Logic)qDL=decidable fragment of First Order Logic(FOL)nis generally found in RDF/XML syntaxnis therefore not much fun to write by handSo,we have tools to help us4OWL
3、ConstructsPersonCountry=class(concept)Animal=individual(instance)BelgiumParaguayChinaLatviaElvisHaiHolgerKylieS.ClausRudolphFlipper=property(relationship)lives_inlives_inlives_inhas_pethas_pet5Get Protg-OWL1.Go to:http:/protege.stanford.edu/download/registered.html2.Download full Protg 3.3.1(a relea
4、sed version)3.Install the software Logon to Windows6Starting Protg-OWL1.Select“New Project”2.Select“OWL/RDF Files”Run Protg.exe7Protg OWL pluginProtg tabs8Protg OWL plugin:TabsUsed in this tutorialChanging the GUITop-level functionalityPopulating the modelExtensions(visualisation)9Classes Tab10Class
5、esTab:Asserted Class HierarchySubsumption hierarchy(superclass/subclass)Structure as asserted by the ontology engineerCreate and Delete classes(actually subclasses!)Everything is a subclass of owl:ThingSearch for class11ClassesTab:Class Editor12ClassesTab:Class EditorClass annotations(for class meta
6、data)Class name and documentationSwitch view to show Properties“available”to ClassDisjoints widgetConditions WidgetClass-specific tools(find usage etc)1314Create Classes1.Click the“Create subclass”button(this is above the class hierarchy)A new class will be created as a subclass of owl:Thing2.Type i
7、n a new name“DomainConcept”over the default(press“enter”updates the hierarchy)3.Req.for later labs:document your class using the rdfs:comment field4.Create another class called“Pizza”by clicking the“Create subclass”You will notice that Pizza has been created as a subclass of DomainConcept as this wa
8、s the class selected when the button was pressed.You can also right-click any class and select“Create Class”5.Create two more subclasses of DomainConcept called“PizzaTopping”and“PizzaBase”.Any mistakes,use the“Delete Class”button next to“Create Class”Start with your empty ontology15DisjointnessnOWL
9、assumes that classes overlapPizzaPizzaTopping=individualThis means an individual could be both a Pizza and a PizzaTopping at the same timeWe want to state this is not the case16DisjointnessnIf we state that classes are disjointThis means an individual cannot be both a Pizza and a PizzaTopping at the
10、 same timeWe must do this explicitly in the interfacePizzaPizzaTopping=individual17ClassesTab:Disjoints WidgetAdd siblings as disjoint Add new disjoint Remove disjoint siblingsList of disjoint classes18Make Classes Disjoint1.Select the Pizza class You will notice that the disjoints widget is empty2.
11、Click the“Add all siblings”buttonThe“Add siblings to disjoints dialog pops up3.Select the“Mutually between all siblings”option and OKPizzaTopping and PizzaBase appear in the disjoints widget4.Select the PizzaTopping classPizza and PizzaBase are already in the disjoints widget5.Note that the same app
12、lies for PizzaBaseStart with your existing ontology19Save Your Work1.Select File Save A dialog(as shown)will pop up2.Select a file using a file selector by clicking the button on the top rightYou will notice that there are 2 files created.pprj the project filethis just stores information about the G
13、UIand the workspace.owl the OWL filethis is where your ontology is stored inRDF/OWL format 3.Select OKOWL=easy to make mistakes save regularly20Create PizzaToppings1.Create subclasses of PizzaTopping:CheeseToppingVegetableToppingMeatTopping2.Make these subclasses all disjoint from one another(rememb
14、er to chose“Mutually between all siblings”when prompted)3.Create subclasses of CheeseTopping:MozzarellaTopping,ParmesanTopping4.Make these subclasses all disjoint from one another5.Create subclasses of VegetableTopping and make them disjoint:TomatoTopping,MushroomTopping6.Save the new file using Fil
15、e SaveStart with your existing ontology21What have we got?nWeve created a tree of disjoint classesnDisjoints are inherited down the treee.g.something that is a TomatoTopping cannot be a Pizza because its superclass,PizzaTopping,is disjoint from PizzanYou should now be able to select every class(exce
16、pt DomainConcept)and see its siblings in the disjoints widget22What are we missing?nThis is not a semantically rich modelnApart from“is kind of”and“is not kind of”,we currently dont have any other information of interestnWe want to say more about Pizza individuals,such as their relationship with oth
17、er individualsnWe can do this with propertiesPizzaPizzaTopping=individual23Properties Tab24Properties Tab:Property BrowserProperties can be in a hierarchySearch for propertySuperProperties of the current selected25Properties Tab:Property Browsernot used today:-New Datatype Property(String,int etc)Ne
18、w Object Property:Associates an individual to another individualDelete Property-New Annotation Properties for metadata-New SubProperty ie create“under”the current selection26Create a Property1.Switch to the Properties tab There are currently no properties,so the list is blank2.Create a new Object pr
19、operty using the button in the property browser3.Call the new Property“hasTopping”4.Create another Object Property called“hasBase”5.SaveStart with your existing ontology27Associating Properties with ClassesnWe now have two properties we want to use to describe Pizza individuals.nTo do this,we must g
20、o back to the Pizza class and add some further informationnThis comes in the form of Restrictions(which are a type of Condition)28ClassesTab:Conditions WidgetConditions asserted by the ontology engineerDefinition of the class(later)Description of the classConditions inherited from superclassesAdd di
21、fferent types of condition29Create a Restriction1.Switch to the OWL Classes tab2.Select PizzaNotice that the conditions widget only contains one item,DomainConcept with a Class icon.Superclasses show up in the conditions widget in this way3.Click the“Create Restriction”buttonA dialog pops up that we
22、 will investigate in a minute4.Select“hasBase”from the Restricted Property pane5.Leave the Restriction type as“someValuesFrom”6.Type“PizzaBase”in the Filler expression editor,then Click OKA restriction has been added to the Conditions widgetStart with your existing ontology30What does this mean?nWe
23、have created a restriction:hasBase.PizzaBaseon Class Pizza as a necessary condition“If an individual is a member of this class,it is necessary that it has at least one hasBase relationship with an individual from the class PizzaBase”PizzaPizzaBasehasBasehasBasehasBasehasBase“Every individual of the
24、Pizza class must have at least one base from the class PizzaBase”31What does this mean?nWe have created a restriction:hasBase PizzaBaseon Class Pizza as a necessary conditionPizzaPizzaBasehasBasehasBasehasBasehasBase“There can be no individual,that is a member of this class,that does not have at lea
25、st one hasBase relationship with an individual from the class PizzaBase”32Restrictions PopupRestriction TypeRestricted PropertyFiller ExpressionSyntax checkExpressionConstructPalette33Restriction Types Existential,someValuesFrom“Some”,“At least one”Universal,allValuesFrom“Only”hasValue“equals x”Card
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 杜剑锋 Protege教程 剑锋 Protege 教程
限制150内