Programming To The OWL API: Overview Introduction

Transcription

Programming to the OWL API:IntroductionOverview Motivation– Why? Details– What? Where? Samples/Examples– How? Wrap Up– What next?Sean BechhoferUniversity of Manchestersean.bechhofer@manchester.ac.uk University of Manchester, 2007The Semantic WebVisionAssumptions“The least questioned assumptionsare often the most questionable”Paul Broca Familiarity with Java (Some) Familiarity with Semantic Web Technologies:– RDF– RDF Schema– OWL– Description Logics– TCP/IP for transporting bits down a wire– HTTP & HTML for transporting and rendering hyperlinkedtext Applications able to exploit this common infrastructure– Result is the WWW as we know it Evolution In the next generation web, resources should be moreaccessible to automated processes– To be achieved via semantic markup: metadata annotations thatdescribe content/function– Coincides with vision of a Semantic WebOWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 3Need to Add“Semantics” External agreement on meaning of annotations– E.g., Dublin Core for annotation of library/bibliographic information Agree on the meaning of a set of annotation tags– Problems with this approach InflexibleMachineProcessable Limited numberof thingscan be expressed Use Ontologies to specifynotmeaning of annotations– Ontologies provide a vocabulary of termsMachineUnderstandable– New termscan be formedby combining existing ones “Conceptual Lego”– Meaning (semantics) of such terms is formally specified– Can also specify relationships between terms in multipleontologies University of Manchester, 2007 The Web made possible through established standards– 1st generation web mostly handwritten HTML pages– 2nd generation (current) web often machine generated/active Being at least aware of the existence of: University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 2OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 5 University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 4Ontology in ComputerScience An ontology is an engineering artifact:– It is constituted by a specific vocabulary used to describe a certainreality, plus– a set of explicit assumptions regarding the intended meaning ofthe vocabulary. Almost always including how concepts should be classified Thus, an ontology describes a formal specification of acertain domain:– Shared understanding of a domain of interest– Formal and machine manipulable model of a domain of interest University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 61

Building a Semantic Web Work on Semantic Web has concentrated on thedefinition of a collection or “stack” of languages. Annotation– Associating metadata with resources– These languages are then used to support the representation anduse of metadata. Integration– Integrating information sources The languages provide basic machinery that we can use torepresent the extra semantic information needed for theSemantic Web InferenceOWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 7OWLRDF(S)RDF University of Manchester, 2007XMLOWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 8Why (Formal) Semantics? Increased formality makes languages more amenable tomachine processing (e.g. automated reasoning). The formal semantics provides an unambiguousinterpretation of the descriptions.– What does an expression in an ontology language mean?– The semantics of a language tell us precisely how to interpret acomplex expression.IntegrationIntegration Interoperation and Sharing are key goalsXMLRDFRDF(S)OWL Annotation–––––Inference– Reasoning over the information we have.– Could be light-weight (taxonomy)– Could be heavy-weight (logic-style) University of Manchester, 2007LanguagesOWL OWL is a language for representing Ontologies in a Webcontext– Web Ontology Language A W3C Recommendation– Since February 2004 Well defined semantics are vital if we are to supportmachine interpretability– They remove ambiguities in the interpretation of the descriptions.TelephoneBlack? University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 9 University of Manchester, 2007The OWL Family TreeOWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 10A Brief History of OWL OIL– Developed by group of (largely) European researchers (severalfrom EU OntoKnowledge project)– Based on frame-based language– Strong emphasis on formal rigour.– Semantics in terms of Description Logics– RDFS based syntaxDAMLRDF/RDF(S)DAML-ONTJoint EU/US CommitteeFramesDAML OILOILOWLW3CRDF/RDF(S)DAML-ONTOntoKnowledge OthersDescriptionLogics University of Manchester, 2007DAML OILFramesOWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 11 University of Manchester, 2007OWLOILDescriptionLogicsOWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 122

A Brief History of OWLA Brief History of OWL DAML OIL DAML-ONT– Merging of DAML-ONT and OIL– Basically a DL with an RDFS-based syntax.– Development was carried out by “Joint EU/US Committee onAgent Markup Languages”– Developed by DAML Programme. Largely US based researchers– Extended RDFS with constructors from OO and frame-basedlanguages– Rather weak semantic specification– Extends (“DL subset” of) RDF Problems with machine interpretation Problems with human interpretation DAML OIL submitted to W3C as basis forstandardisationRDF/RDF(S)– Web-Ontology (WebOnt)Working Group formedDAML-ONTDAML OILFrames University of Manchester, 2007DAML-ONTDAML OILFramesOILDescriptionLogicsOWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 13OWLOILDescriptionLogics University of Manchester, 2007A Brief History of OWLOWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 14Points from History OWL Influence of frame based modelling approaches– W3C Recommendation (February 2004)– Based largely on the DAML OIL specification from March 2001.– Well defined RDF/XML serializations– Classes, slots, fillers Influence of logical foundations– Well-formed semantics– Formal semantics– Inference First Order Relationship with RDF Influence of Web Languages– RDF, RDF(S)– Comprehensive test cases fortools/implementations– Growing industrial takeup.RDF/RDF(S)DAML-ONTDAML OILFrames University of Manchester, 2007RDF/RDF(S)OWLOWLOILDescriptionLogicsOWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 15 University of Manchester, 2007History OilEdOWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 16History/Provenance WonderWeb– One of the first ontology editors to employ description logicreasoning– Targeted at OIL (then DAML OIL)– 10,000 registrations for download– Used for teaching in both academiaand industry Data model independent of theunderlying concrete syntax– But without decent abstractions– http://wonderweb.semanticweb.org/– An EU STREP targeted at producing Ontology Infrastucture for theSemantic Web– Produced the initial implementations of the API CO-ODE– http://www.co-ode.org/– UK JISC funded project to provide support for communitiesdeveloping OWL Protégé tool development and OWL support– Supporting current development. University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 17 University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 183

OWLOWL allows us to describe a domain interms of: IndividualsOWLNote: This talk will notbe discussing whetherthis is the “right” wayto do things .– Particular objects in our domain OWL has a number of operators that allow us to describethe classes and the characteristics that they have Boolean operators– and, or, not Classes Quantification over properties/relationships– Collections of objects (usually sharing some commoncharacteristics)– universal, existential. A clear and unambiguous semantics for the operators andcomposite class expressions Properties– Binary relationships betweenindividuals. Plus a collection of axioms describing how these classes,individuals, properties etc. should be interpreted University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 19 University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 20OWL and RDFOWL and RDF The normative presentation for OWL is based on RDF XML-RDF is one of a number of possible syntacticpresentations of OWL. Working solely at the RDF triple level can introduce bothmechanical and conceptual difficulties.– Round tripping. The mapping rules between OWL abstract syntaxand triples are not 1:1.– Containment. Assertions that statements belong to a particularontology. Alternative syntaxes can be useful– OIL‘s original text format was popular with users – you can writeXML-RDF in emacs, but I wouldn‘t recommend it. University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 21 Sometimes an uneasy relationship between the two Syntactic Layering– Additional baggage/hoops to jump through Semantic Layering– ComplicatedOWL ! RDF One of our key motivators was to provide infrastructurethat helped insulate applications from these issues University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 22OWL Layering Three species of OWL– OWL Full is the union of OWL syntax and RDF– OWL DL restricted to FOL fragment (¼ DAML OIL) Corresponds to SHOIN(Dn) Description Logic– OWL Lite is “simpler” subset of OWL DL Syntactic & Semantic Layering– OWL DL semantics OWL Full semantics(within DL fragment)– OWL Lite semantics OWL DL semantics(within Lite fragment)OWL FullFullDLLite No restriction on use of OWL vocabulary(as long as legal RDF)Full– Classes as instances (and much more) RDF style model theory– Reasoning using FOL engines via axiomatisation– Semantics should correspond with OWL DLfor suitably restricted KBs DL semantics are definitive– In principle: correspondence proof– But: if Full disagrees with DL (in DL fragment), then Full is wrong University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 23 University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 244

OWL DLOWL Lite Use of OWL vocabulary restricted– Can’t be used to do “nasty things” (i.e., modify OWL)– No classes as instances– Defined by abstract syntax mapping to RDF Like DL, but fewer constructsDL Standard DL/FOL model theory (definitive)– Direct correspondence with (first order) logic Benefits from underlying logic research––––Well defined semanticsFormal properties well understood (complexity, decidability)Known reasoning algorithmsImplemented systems (highly optimised) University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 25OWL 1.1 Some limitations have already been identified in theoriginal OWL specifications– Qualified cardinality restrictions– Lack of support for richer property axioms (e.g. interactionbetween partonomies and locations)– Metamodelling– Annotations– No explicit negation or union– Restricted cardinality (zero or one)– No nominals (oneOf) Semantics as per DL– Reasoning via standard DL engines ( datatypes)Lite E.g., FaCT, RACER, Cerebra, Pellet In practice, not really used.– Alternative “tractable fragments” approach for OWL 1.1 University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 26Why build an OWL API? The use of a higher level data model can help to– insulate us from the vagaries of concrete syntax.– make it clear what is happening in terms of functionality.– increase the likelyhood of interoperating applications. “OWL 1.1” aims to extend the language in order toaddress these issues– The latest version of the OWL API has support for this additionalexpressivity– W3C Member Submission– http://webont.org/owl/1.1/ University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 27 University of Manchester, 2007How thick is yourinfrastructure?Experiences An early example application built using the API was aweb service that performed validation and translation toalternative syntaxes.– See OWL DL: Trees or Triples, WWW2004 Ontology level objects made it easy to write codespotting “internal errors”OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 28 A lightweight infrastructure (e.g. RDF) means thatclients/apps have to do more. And may do it differently. Metadata can end up being locked away within theapplications where others can’t get at it. Is that sharing?Are you exposing the semantics?Thick Apps University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 29 University of Manchester, 2007Thick AppsThinInfrastructureOWLAPI Tutorial, Semantic Technologies, San Jose CA, May 2007305

How thick is yourinfrastructure? Sharing is about interoperations. Ensuring that when youlook at or process my data, you do it in a consistent way. “Thick” infrastructure can help interoperability. Clientsdon’t have to guess how to interpret things. Primarily targeted at OWL-DL– This does not mean that we cannot handle OWL-Full ontologies,but a number of design decisions reflect this assumption. Java based– Interfaces– Java reference implementation– But can be harder to buildThin AppsAssumptionsThin AppsApplication Main memory basedOWL onThick Infrastructure University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 31 University of Manchester, 2007What is an “OWLImplementation”?OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 32RDFOWL Modelling– Provide data structures that represent OWLontologies/documents.OWL Logic Parsing– Taking some syntactic presentation, e.g. OWL-RDF andconverting it to some [useful] internal data structure. Serializing– Producing a syntactic presentation, e.g. OWL-XML from a localdata structure. Manipulation/Change– Being able to manipulate the underlying objects. Inference– Providing a representation that implements/understands theformal semantics of the language. University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 33 University of Manchester, 2007Implementation AspectsFormat TranslationSimple EditingParsingConsistency CheckingManipulationModellingSerializing University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 34OWL Abstract Syntax Provides a definition of the language in terms of theconstructs and assertions allowed. Semantics are then defined in terms of this abstractsyntax. Our OWL API data model is based largely on this abstractsyntax presentation.– Conceptually cleaner.– Syntax doesn’t get in the wayInferenceOWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 35 University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 366

Considerations Clear identification offunctionalities and aseparation of concerns ellingSerializingInference Manipulation/Change– Granularity– Dependency– User ference– Strategies– Syntax vs. Data Model– Interface vs. Implementation– Locality of Information Inference– Separation of explicit assertions from inferred consequences– External reasoning implementations Parsing/Serialization– Insulation from underlying concrete presentations– Insulation from triples University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 37Programming to the OWL API:The API University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 38What is an Ontology?o A particular syntactic presentationo The facts represented by that syntactic presentationo The information that can be inferred from those factso E.g. consequences of the assertions plus the underlying semanticsof the language. The difference between these becomes important withlanguages like OWL. What answers will I expect when interrogating thestructure?Sean BechhoferUniversity of Manchestersean.bechhofer@manchester.ac.uk University of Manchester, 2007What is an Ontology? owl:Class rdf:about "#Man" rdf:subClassOf owl:intersectionOf rdf:parseType "Collection" owl:Class rdf:about "#Person"/ owl:Classandrdf:about "#Male"/ /owl:intersectionOf /rdf:subClassOf PersonMale /owl:Class Animal Animal owl:Class rdf:about "#Person" rdf:subClassOf owl:Class rdf:about "#Animal"/ /rdf:subClassOf Man /owl:Class PersonOWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 40Overall Philosophy The OWL API is targeted primarily at representing OWLDL An Ontology is represented as a collection of axioms thatassert information about the classes, properties andindividuals that are in the ontology– This is a change from the original approach– Fits better with current thinking surrounding OWL 1.1– Provides a uniform view on the ontology When is a class or property “in” an Ontology?– This isn’t explicitly captured in the OWL specs– Somewhat application dependentMan University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 41 University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 427

Basic Data Structures At its heart, the OWL API provides data structuresrepresenting OWL ontologies Plus classes to help– Create;––––Manipul ate;Parse;Render; andReason about those structuresOWLOntology An OWLOntology represents an ontology It consists of a collection of OWLAxioms Note that the OWLOntology object doesn’t explicitlycontain classes, properties etc.– The classes “in” the ontology are those that are referenced by theaxioms that are in the ontology– We believe this provides a clean and consistent story as regardsthe objects that make up the ontology The basic data structure represents the objects in theontology and corresponds roughly to the abstract syntaxof OWL. The OWLOntology provides an explicit context withinwhich we can assert information about classes andproperties. University of Manchester, 2007 University of Manchester, 2007– Locality of informationOWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 43Names and URIs Ontologies in OWL are named using URIs Ontologies can also be retrieved from URLs. This can cause some confusion!OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 44OWL Import The situation isn’t made any easier by OWL’s importmechanism. OWL provides a mechanism for importing one ontologyinto another The intuition is that the axioms in the imported ontologywill be added to the theory defined by the importingontology Note that the recommendation doesn’t really say muchabout how this will be achieved University of Manchester, 2007 University of Manchester, 2007– There’s no explicit requirement that the location you retrieve theontology from is the same as the name that it’s given.OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 45ImportsImporting another ontology brings the entire set of assertions provided by thatontology into the current ontology. In order to make best use of this importedontology it would normally be coordinated with a namespace declaration.Notice the distinction between these two mechanisms. The namespacedeclarations provide a convenient means to reference names defined in otherOWL ontologies. Conceptually, owl:imports is provided to indicate yourintention to include the assertions of the target ontology. Importing anotherontology, O2, will also import all of the ontologies that O2 imports.OWL Guide University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 47OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 46ImportsAn owl:imports statement references another OWL ontology containingdefinitions, whose meaning is considered to be part of the meaning of theimporting ontology. Each reference consists of a URI specifying from wherethe ontology is to be imported. Syntactically, owl:imports is a property with theclass owl:Ontology as its domain and range.The owl:imports statements are transitive, that is, if ontology A imports B,and B imports C, then A imports both B and C.Importing an ontology into itself is considered a null action, so if ontology Aimports B and B imports A, then they are considered to be equivalent.Note that whether or not an OWL tool must load an imported ontologydepends on the purpose of the tool. If the tool is a complete reasoner(including complete consistency checkers) then it must load all of theimported ontologies. Other tools, such as simple editors and incompletereasoners, may choose to load only some or even none of the importedontologies. University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 48OWL Reference8

ImportsImportsImports annotations, in effect, are directives to retrieve a Web document andtreat it as an OWL ontology. However, most aspects of the Web, includingmissing, unavailable, and time-varying documents, reside outside the OWLspecification; all that is carried here is that a URI can be “dereferenced” intoan OWL ontology. In several places in this document, therefore, idealizationsof this operational meaning for imports are used. an owl:imports annotation also imports the contents of another OWLontology into the current ontology. The imported ontology is the one, if any,that has as name the argument of the imports construct. (This treatment ofimports is divorced from Web issues. The intended use of names for OWLontologies is to make the name be the location of the ontology on the Web,but this is outside of this formal treatment.)OWL Semantics University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 49 In essence, an owl:imports statement means:– Dereference the URI that’s given, and make sure that anytime you do some reasoning, you take into account theaxioms in the imported ontology Questions like “which classes are in this ontology” can beanswered in an application specific way.– If Ontology A imports Ontology B and Class X is “in” ontology Bis it also “in” Ontology A? To complicate matters further, OWL-DL requires thatowl:imports only applies to things that are explicitly typedas owl:Ontology. University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 50Logical and Physical To get round these problems, we define the notion oflogical and physical URIsOWLEntity OWLEntity is the fundamental building block of theontology– Logical: the URI used to name the ontology– Physical: the location where the ontology was retrieved from– Classes‒ Properties An OntologyURIMapper is then used to map betweenphysical and logical URIs– Individuals– Datatypes– Allows for local copies or repositories of ontologies We are in some way playing “fast and loose” with thespec here, but there is no real practical alternative. University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 51 Named using URIs– But be aware of punning University of Manchester, 2007OWLClass Represents an OWL Class. The Class itself is a relatively lightweight object– A Class doesn’t hold information about definitions that may applyto it. Axioms relating to the class are held by an OWLOntologyobjectOWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 52OWLClass Methods are available on OWLClass that give access tothe information within a particular ontologyjava.util.Set OWLDescription getDisjointClasses(OWLOntology ontology)java.util.Set OWLDescription getEquivalentClasses(OWLOntology ontology) But these are simply convenience methods.– E.g. a superclass axiom must be stated within the context of anOWLOntology– Thus alternative characterisations/perspectives can be assertedand represented for the same class. Axioms do not relate only to a class, but to a class withinthe context of an ontology University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 53 University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 549

OWLProperty OWL makes a distinction between– Object Properties: those that relate two individuals E.g. hasBrother– Data Properties: those that relate an individual to a concrete datavalue E.g. hasName There is a strict separation between the two and twoexplicit classes representing them– OWLObjectProperty– OWLDataPropertyOWLProperty Properties can have associated domains and ranges There is also a property hierarchy– Super properties– Property equivalences– Disjoint Properties (OWL1.1) In OWL1.1, we also have the option of using propertyexpressions (e.g. property chains). Again, as with classes, the property objects are lightweightand all assertions about properties are made in thecontext of an Ontology.– E.g functional properties University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 55 University of Manchester, 2007OWLObjectProperty Represents an Object Property that can be used to relatetwo individuals Object properties can have additional characteristics– TransitivityOWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 56OWLDataProperty Represents an Object Property that can be used to relatetwo individuals Data properties can also have additional characteristics– Functional– Inverses University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 57 University of Manchester, 2007OWLDescription OWLDescription represents an OWL class expression Atomic classes Boolean expressions– Intersection (and)– Union (or)– Complement (not) Restrictions– Explicit quantification (some, all)– Cardinality restrictions (atmost, atleast) University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 59OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 58OWLAxiom An ontology contains a collection of OWLAxioms Each axiom represents some fact that is explicitly assertedin the ontology There are a number of different kinds of axiom––––Annotation AxiomsDeclaration AxiomsImport AxiomsLogical Axioms University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 6010

Annotation Axioms An OWLAnnotationAxiom is used to associate arbitrarypieces of information with an object in the ontology– Labels or natural language strings– Dublin core style metadata, e.g. author or creator information Annotation Axioms have no logical significance– They do not affect the underlying semantics of the ontologyDeclaration Axioms An OWLDeclarationAxiom simple declares or introducesan entity into an ontology Declaration axioms have no logical significance Such axioms can be useful for integrity checks, e.g. toolsmay require that every entity used in the ontology isexplicitly declared– This can help detect issues or problems with mis-spelling University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 61 University of Manchester, 2007Import Axioms An OWLImportsDeclaration annotates an ontology inorder to describe the ontologies it imports.– In the OWL specification, owl:import is a kind ofowl:OntologyProperty which is treated in a special way. As discussed earlier, we need to be careful about the wayin which we treat ontology import structures.OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 62Logical Axioms The subclasses of OWLLogicalAxiom represent the logicalassertions contained in the ontology– Supers (of classes and properties)– Equivalences (of classes and properties)– Property Characteristics Functionality, transitivity etc.– Facts about particular individuals Types Relationships Values University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 63 University of Manchester, 2007Equality Equality on objects in the API is defined structurally. In general, two objects are equal if they have the samestructure E.g. for boolean class descriptions, the operands arecompared as a Set.– If the two sets of operands are equal, the descriptions are equal. Note that this is syntactic. Logical equivalences that mayfollow from axioms or assertions in the ontology do notimpact on the equality of the objects.OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 64Visitors The API makes extensive use of the Visitor Pattern– Represents an operation to be performed on the elements of an objectstructure. Visitor lets you define a new operation without changing theclasses of the elements on which it operatesDesign Patterns (Gamm et al) The use of the Visitor pattern allows us to define manydifferent operations over the data structure without“polluting” it with application specifics. Visitor is good when the data structure is static, but costlyif the structure changes– As our data structures are based on the language, the structure islikely to remain static here. University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 65 University of Manchester, 2007OWL API Tutorial, Semantic Technologies, San Jose CA, May 2007 6611

The times they are achanging Visitors Visitors are primarily used when rendering or serializingontologies into different concrete formats. There are Visitors for each of the main classes– OWLEntityVisitor The data structures provide read-only access to theinformation held in the ontology Changes to the ontology are effected through the use ofthe Command Pattern.– OWLAxiomVisitor– OWLDescriptionVisitor– Encapsulate a request as an object, thereby letting you parameterizeclients with different requests,

An early example application built using the API was a web service that performed validation and translation to alternative syntaxes. –See OWL DL: Trees or Triples, W