/
Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,che Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,che

Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,che - PDF document

natalia-silvester
natalia-silvester . @natalia-silvester
Follow
388 views
Uploaded On 2015-09-18

Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,che - PPT Presentation

Outline 1 Introductionwhatswhatandwhatsanontology 2 Loadingmodifyingsavingcheckinganontology 3 Queries Inspectassertedaxioms Usingareasoner 4 OutsidethecoreOWLAPIextramodules Waitwhochangedmyo ID: 132656

Outline 1 Introduction:what'swhatandwhat'sanontology 2 Loading modifying saving checkinganontology 3 Queries Inspectassertedaxioms Usingareasoner 4 OutsidethecoreOWLAPI:extramodules Wait whochangedmyo

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "Introduction:what'swhatandwhat'sanontolo..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI Outline 1 Introduction:what'swhatandwhat'sanontology 2 Loading,modifying,saving,checkinganontology 3 Queries Inspectassertedaxioms Usingareasoner 4 OutsidethecoreOWLAPI:extramodules Wait,whochangedmyontology?Concurrentaccess Modularization 5 ApplicationsusingtheOWLAPI Protégé OPPL:OWLPreProcessingLanguage IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI WherewastheAPIborn?Whereisitnow? WonderWeb http://wonderweb.semanticweb.org/ rstincarnationoftheAPIinthisEUSTREPproject,dated2003 CO-ODE http://www.co-ode.org/ furthersupportanddevelopmentinthisUKJISCproject,until2009 currentlyhostedonSourceForgeathttp://owlapi.sourceforge.net availableunderLGPLand/orApachelicense afewdevelopers(19atlastcount)scatteredaround,highestconcentrationatUniversityofManchester IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI What'sOWL2? OWL2 TheOWL2WebOntologyLanguage,informallyOWL2,isanontologylanguagefortheSemanticWebwithformallyde-nedmeaning. from:http://www.w3.org/TR/owl2-overviewDescriptionLogicsaretheformallanguagesunderlyingOWL2 OWL2Proles NotallDLsarecreatedequal:OWL2EL,OWL2QL,OWL2RL,OWL1DL(slightlyenrichedinOWL2DL)from:http://www.w3.org/TR/owl2-proles/#Computational_Properties IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI What'sanontology?Taketwo ForthepurposesoftheOWLAPI: AnOWLontologyisaspecicationofaconceptualization(asdenedbyGruber) AnOWLontologyisstructuredasdescribedintheOWL2specs I'maJavadeveloper(getmeoutofhere) IntheOWLAPI,anOWLOntologyisaninterface,modellingasetoflogicalandnonlogicalOWLAxioms,withaname(anIRI),an(op-tional)physicallocationandconveniencemethodstoretrievesuchax-ioms. IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI OWLAxioms,Classes,Properties,IndividualsandEntities... OWLAxiom:thebasicunity TBoxaxiomsdescriberelationsbetweenclassesandclassexpressions(equivalence,subsumption,disjointness) ABoxaxioms(assertions)describerelationsbetweenindividualsandbetweenindividualsandclasses/classexpressions RBoxaxiomsdescriberelationsbetweenproperties IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI AVisitortovisitthemall Allimportantinterfacesaccepttwokindsofvisitor ClassNameVisitor:visitorstoresavalueorperformsanaction ClassNameVisitorEx:visitorreturnsavalue MostVisitorinterfaceshaveabaseimplementation VisitorAdapter allmethodsimplementedasemptyones Developersonlyneedtooverridemethodstheyneed IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI Alternativeloadingmethods... OntologyLoadingFromStringSource OWLOntologyManagerm=create();OWLOntologyo=m.loadOntologyFromOntologyDocument(pizza_iri);assertNotNull(o);StringDocumentTargettarget=newStringDocumentTarget();m.saveOntology(o,target);m.removeOntology(o);OWLOntologyo2=m.loadOntologyFromOntologyDocument(newStringDocumentSource(target.toString()));assertNotNull(o2); OWLOntologyDocumentSourceisaninterfacefordocumentsources,e.g.,readers OWLOntologyDocumentTargetisaninterfacefordocumentdestinations,e.g.,writers IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI Addingaxiomstoanontology AddAxioms OWLOntologyManagerm=create();OWLOntologyo=m.createOntology(pizza_iri);//classAandclassBOWLClassclsA=df.getOWLClass(IRI.create(pizza_iri+"#A"));OWLClassclsB=df.getOWLClass(IRI.create(pizza_iri+"#B"));//NowcreatetheaxiomOWLAxiomaxiom=df.getOWLSubClassOfAxiom(clsA,clsB);//addtheaxiomtotheontology.AddAxiomaddAxiom=newAddAxiom(o,axiom);//Wenowusethemanagertoapplythechangem.applyChange(addAxiom);//removetheaxiomfromtheontologyRemoveAxiomremoveAxiom=newRemoveAxiom(o,axiom);m.applyChange(removeAxiom); IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI Variouskindsofchanges...Assertions IndividualAssertions OWLOntologyManagerm=create();OWLOntologyo=m.createOntology(example_iri);//Wewanttostatethatmatthewhasafatherwhoispeter.OWLIndividualmatthew=df.getOWLNamedIndividual(IRI.create(example_iri+"#matthew"));OWLIndividualpeter=df.getOWLNamedIndividual(IRI.create(example_iri+"#peter"));//WeneedthehasFatherpropertyOWLObjectPropertyhasFather=df.getOWLObjectProperty(IRI.create(example_iri+"#hasFather"));//matthew�-hasFather�-peterOWLAxiomassertion=df.getOWLObjectPropertyAssertionAxiom(hasFather,matthew,peter);//Finally,addtheaxiomtoourontologyAddAxiomaddAxiomChange=newAddAxiom(o,assertion);m.applyChange(addAxiomChange); IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI Variouskindsofchanges...Existentialrestrictions AddSomeRestriction OWLOntologyManagerm=create();OWLOntologyo=m.createOntology(example_iri);//allHeadshavepartsthatarenoses(atleastone)//Wedothisbycreatinganexistential(some)restrictionOWLObjectPropertyhasPart=df.getOWLObjectProperty(IRI.create(example_iri+"#hasPart"));OWLClassnose=df.getOWLClass(IRI.create(example_iri+"#Nose"));//Nowlet'sdescribetheclassofindividualsthathaveat//leastonepartthatisakindofnoseOWLClassExpressionhasPartSomeNose=df.getOWLObjectSomeValuesFrom(hasPart,nose);OWLClasshead=df.getOWLClass(IRI.create(example_iri+"#Head"));//HeadsubclassofourrestrictionOWLSubClassOfAxiomax=df.getOWLSubClassOfAxiom(head,hasPartSomeNose);m.applyChange(newAddAxiom(o,ax)); IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI Variouskindsofchanges...Addacomment(oranyannotation) Comment OWLOntologyManagerm=create();OWLOntologyo=m.loadOntologyFromOntologyDocument(pizza_iri);//Wewanttoaddacommenttothepizzaclass.OWLClasspizzaCls=df.getOWLClass(IRI.create(pizza_iri+"#Pizza"));//thecontentofourcomment:astringandalanguagetagOWLAnnotationcommentAnno=df.getOWLAnnotation(df.getRDFSComment(),df.getOWLLiteral("Aclasswhichrepresentspizzas","en"));//SpecifythatthepizzaclasshasanannotationOWLAxiomax=df.getOWLAnnotationAssertionAxiom(pizzaCls.getIRI(),commentAnno);//Addtheaxiomtotheontologym.applyChange(newAddAxiom(o,ax)); IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI Savechangestoanontology SaveOntology OWLOntologyManagerm=create();OWLOntologyo=m.loadOntologyFromOntologyDocument(pizza_iri);assertNotNull(o);Fileoutput=File.createTempFile("saved_pizza","owl");IRIdocumentIRI2=IRI.create(output);//saveinOWL/XMLformatm.saveOntology(o,newOWLXMLOntologyFormat(),documentIRI2);//saveinRDF/XMLm.saveOntology(o,documentIRI2);//printouttheontologyonSystem.outm.saveOntology(o,newSystemOutDocumentTarget());//Removetheontologyfromthemanagerm.removeOntology(o); IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI InspectassertedaxiomsUsingareasoner Exploreclasses ShowClasses OWLOntologyManagerm=create();OWLOntologyo=m.loadOntologyFromOntologyDocument(pizza_iri);assertNotNull(o);//Namedclassesreferencedbyaxiomsintheontology.for(OWLClasscls:o.getClassesInSignature())System.out.println(cls); AssertedSuperclasses OWLClassclsA=df.getOWLClass(IRI.create(example_iri+"#A"));&#xOWLC;&#xlass;xpr;ssi;&#xon00;SetsuperClasses=clsA.getSuperClasses(o);//foreachsuperclasstherewillbeacorrespondingaxiom//theontologyindexesaxiomsinavarietyofways&#xOWLS;&#xubCl; ssO;úxi;&#xom00;SetsameSuperClasses=o.getSubClassAxiomsForSubClass(clsA);assertEquals(superClasses.size(),sameSuperClasses.size()); IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI InspectassertedaxiomsUsingareasoner Mergeontologies MergedOntology OWLOntologyManagerm=create();OWLOntologyo1=m.loadOntology(pizza_iri);OWLOntologyo2=m.loadOntology(example_iri);//CreateourontologymergerOWLOntologyMergermerger=newOWLOntologyMerger(m);//Mergealloftheloadedontologies,specifyinganIRIforthenewontologyIRImergedOntologyIRI=IRI.create("http://www.semanticweb.com/mymergedont");OWLOntologymerged=merger.createMergedOntology(m,mergedOntologyIRI);assertTrue(merged.getAxiomCount()�o1.getAxiomCount());assertTrue(merged.getAxiomCount()�o2.getAxiomCount()); IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI InspectassertedaxiomsUsingareasoner Searchforrestrictions... RestrictionVisitorextendsanadapterclass:privateclassRestrictionVisitorextendsOWLClassExpressionVisitorAdapter{//Afewinternalsomitted...public&#xOWLO; jec;&#xtPro;&#xpert;&#xyExp;&#xress;&#xion0;SetgetRestrictedProperties(){returnproperties;}publicvoidvisit(OWLClassdesc){if(!classes.contains(desc)){classes.add(desc);for(OWLOntologyont:onts)for(OWLSubClassOfAxiomax:ont.getSubClassAxiomsForSubClass(desc))ax.getSuperClass().accept(this);}}publicvoidvisit(OWLObjectSomeValuesFromdesc){properties.add(desc.getProperty());}} IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI InspectassertedaxiomsUsingareasoner Changedefaultrenderingformats... Rendering //ReadanontologyandthenrenderitOWLOntologyManagerm=create();OWLOntologyo=m.loadOntologyFromOntologyDocument(pizza_iri);//Registertheontologystorerwiththemanagerm.addOntologyStorer(newOWLTutorialSyntaxOntologyStorer());//Saveusingadifferentformatm.saveOntology(o,newOWLTutorialSyntaxOntologyFormat(),newSystemOutDocumentTarget()); IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI InspectassertedaxiomsUsingareasoner Visitinglabels classLabelExtractorextends&#xStri;&#xng00;OWLObjectVisitorExAdapterimplements&#xStri;&#xng00;OWLAnnotationObjectVisitorEx{@OverridepublicStringvisit(OWLAnnotationannotation){if(annotation.getProperty().isLabel()){OWLLiteralc=(OWLLiteral)annotation.getValue();returnc.getLiteral();}returnnull;}} IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI InspectassertedaxiomsUsingareasoner DLreasonersandtheOWLAPI OWLReasonerandOWLReasonerFactory AfewOWLDLreasonersavailable HermiT FaCT++ Pellet ReasonersavailablethroughOWLLink(e.g.,RacerPro) Newkidontheblock:JFact(aportofFaCT++toJava) IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI InspectassertedaxiomsUsingareasoner Hierarchyprinting... Hierarchy OWLOntologyManagerm=create();OWLOntologyo=m.loadOntologyFromOntologyDocument(pizza_iri);//GetThingOWLClassclazz=df.getOWLThing();System.out.println("Class:"+clazz);//PrintthehierarchybelowthingprintHierarchy(o,clazz,new&#xOWLC;&#xlass;HashSet()) IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI InspectassertedaxiomsUsingareasoner Listunsatisableclasses UnsatisableClasses OWLOntologyManagerm=create();OWLOntologyo=m.loadOntologyFromOntologyDocument(pizza_iri);//Createareasoner;itwillincludetheimportsclosureOWLReasonerreasoner=reasonerFactory.createReasoner(o);//Askthereasonertoprecomputesomeinferencesreasoner.precomputeInferences(InferenceType.CLASS_HIERARCHY);//WecandetermineiftheontologyisactuallyconsistentassertTrue(reasoner.isConsistent());//getalistofunsatisfiableclasses&#xOWLC;&#xlass;NodebottomNode=reasoner.getUnsatisfiableClasses();System.out.println("Unsatisfiableclasses:");//leaveowl:Nothingoutfor(OWLClasscls:bottomNode.getEntitiesMinusBottom())System.out.println(labelFor(cls,o)); IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI InspectassertedaxiomsUsingareasoner Lookingupinstancesandpropertyvalues PetInstances //reasonerfrompreviousexample...//foreachclass,lookuptheinstancesfor(OWLClassc:o.getClassesInSignature()){//thebooleanargumentspecifiesdirectsubclassesfor(OWLNamedIndividuali:r.getInstances(c,true).getFlattened()){System.out.println(labelFor(i,o)+":"+labelFor(c,o));//lookupallpropertyassertionsfor(OWLObjectPropertyop:o.getObjectPropertiesInSignature()){&#xOWLN; med;&#xIndi;&#xvidu; l00;NodeSetpetValuesNodeSet=r.getObjectPropertyValues(i,op);for(OWLNamedIndividualvalue:petValuesNodeSet.getFlattened())System.out.println(labelFor(i,o)+""+labelFor(op,o)+""+labelFor(value,o));}}} IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI InspectassertedaxiomsUsingareasoner Necessarypropertyassertions... Margherita //reasonerfrompreviousexample...//Forthisontology,weknowthatclasses,properties,...have//IRIsoftheform:ontologyIRI+#+localnameStringiri=pizza_iri+"#Margherita";//Nowwecanquerythereasoner//todeterminethepropertiesthat//instancesofMargheritaMUSThaveOWLClassmargherita=df.getOWLClass(IRI.create(iri));printProperties(m,o,r,margherita); IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI Wait,whochangedmyontology?ConcurrentaccessModularization Concurrentaccess:Defaultimplementations OWLOntologycontainsmaps OWLAxiomsindexedbyOWLEntityinthesignature OWLAxiomsindexedbyAxiomType ...andmore OWLOntologyManagercontainsmapsandsets OWLOntologiesindexedbyIRI OWLOntologiesindexedbyOWLOntologyFormat ...andmore OWLDataFactoryusescachestointernalizeOWLEntities 1 Alltheseareweakspots 2 Thelistisnotexhaustive 3 Transactions:aseriesofchangesinsteadofasinglechange?Rollbackifthelastonefails? IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI Wait,whochangedmyontology?ConcurrentaccessModularization Whichsolutionsareavailable? Synchronizeeverything?Slowww Locks?Explicitorimplicit?ReadWriteLocks? Cachesareavulnerability.Dropthem? Transactionsupport...hardtogureout IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI Wait,whochangedmyontology?ConcurrentaccessModularization HowdoIpickandmix? ThreadSafeBinding publicfinalclassThreadSafeBindingimplementsOWLImplementationBinding{publicOWLOntologyManagergetOWLOntologyManager(OWLDataFactoryd){returnnewLockingOWLOntologyManagerImpl(d);}publicOWLOntologygetOWLOntology(OWLOntologyManageroom,OWLOntologyIDid){returnnewLockingOWLOntologyImpl(oom,id);}publicOWLDataFactorygetOWLDataFactory(){returnDataFactoryCSR.getInstance();}} IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI Wait,whochangedmyontology?ConcurrentaccessModularization Modularization Ontologymodularizationisabroadtopic Localitybasedmodularization ManypeopleatManchesterworkingonit StartfromasignatureS(setofIRIs)fromO ComputeasetofaxiomsM AnyexpressionbuiltwithelementsfromShasthesameinterpretationinOandinM MissmallerthanO!reasoningisfaster(ish) Theonlychallengelefttotheuserishowtochoosethesignature... IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI Wait,whochangedmyontology?ConcurrentaccessModularization Modularizationexample Modularization OWLOntologyManagerm=create();OWLOntologyo=m.loadOntologyFromOntologyDocument(pizza_iri);//extractamoduleforalltoppings//startbycreatingasignature"PizzaTopping"OWLClasstopping=df.getOWLClass(IRI.create(pizza_iri+"#PizzaTopping"));//Wenowaddallsubclassesofthechosenclasses.&#xOWLE;&#xntit;&#xy000;SetseedSig=new&#xOWLE;&#xntit;&#xy000;HashSet()OWLReasonerreasoner=reasonerFactory.createReasoner(o);seedSig.add(topping);seedSig.addAll(reasoner.getSubClasses(ent.asOWLClass(),false).getFlattened());//Extractalocality-basedmoduleSyntacticLocalityModuleExtractorsme=newSyntacticLocalityModuleExtractor(m,o,ModuleType.STAR);&#xOWLA;&#xxiom;Setmod=sme.extract(seedSig);System.out.println("Modulesize"+mod.size()); IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI ProtégéOPPL:OWLPreProcessingLanguage Lookslikethis... IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI ProtégéOPPL:OWLPreProcessingLanguage OPPL:OWLPreProcessingLanguage(2) http://oppl2.sourceforge.net Add/removeaxiomsfromontologies Canbeusedwithorwithoutareasoner PlugsintoProtégé IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI ProtégéOPPL:OWLPreProcessingLanguage AfewOPPLscripts... Declarematchedclassesdisjoint ?x:CLASS,?y:CLASSSELECT?xsubClassOfgender,?ysubClassOfgenderWHERE?x!=?yBEGINADD?xdisjointWith?yEND; IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI ProtégéOPPL:OWLPreProcessingLanguage AfewOPPLscripts... Assertionscanbechangedtoo ?country:INDIVIDUAL[instanceOfCountry],?adiacentCountry:INDIVIDUAL[instanceOfCountry]SELECT?countryadjacentTo?adiacentCountryBEGINREMOVE?countryadjacentTo?adiacentCountry,ADD?countryinstanceOfhasLandBoundarysome(LandBoundaryFragmentandboundaryOfvalue?adiacentCountry)END; IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI Introduction:what'swhatandwhat'sanontologyLoading,modifying,saving,checkinganontologyQueriesOutsidethecoreOWLAPI:extramodulesApplicationsusingtheOWLAPI ProtégéOPPL:OWLPreProcessingLanguage Questiontime Questions?Contacts:Forpraises:owlapi-developer@lists.sourceforge.netForcomplaints,errors,etc:palmisai@cs.man.ac.ukForfeaturerequests&bugs:http://owlapi.sourceforge.nettrackers IgnazioPalmisano&theOWLAPIteam DON'TPANIC-TheRoughGuidetotheOWLAPI