190 likes | 289 Views
OWL TUTORIAL. APT CSA 3003 OWL ANNOTATOR Charlie Abela CSAI Department. Outline. Ontologies Web Ontology Language: OWL Flavours of OWL Some Differences Classes Properties Individuals Namespaces and Headers. Ontologies.
E N D
OWL TUTORIAL APT CSA 3003 OWL ANNOTATOR Charlie Abela CSAI Department
Outline • Ontologies • Web Ontology Language: OWL • Flavours of OWL • Some Differences • Classes • Properties • Individuals • Namespaces and Headers
Ontologies • Ontologies were developed in Artificial Intelligence to facilitate knowledge sharing and reuse. • Ontologies provide a machine-processable semantics of information sources that can be communicated between different agents • An ontology is a formal, explicit specification of a shared conceptualisation [Gruber, 1993] • A ‘conceptualisation’ refers to an abstract model of some phenomenon in the world which identifies the relevant concepts of that phenomenon. • ‘Explicit’ means that the type of concepts used and the constraints on their use are explicitly defined. • ‘Formal’ refers to the fact that the ontology should be machine readable.
OWL • Web Ontology Language is a language for defining and instantiating Web ontologies • OWL is intended to provide a language that can be used to describe the classes and relations (properties) between them that are inherent in Web documents and applications. • OWL has more facilities for expressing meaning and semantics than XML, RDF, and RDF-S • Reasoning capabilities provided by tools
Flavours of OWL • OWL Lite supports those users primarily needing a classification hierarchy and simple constraint features • OWL DL supports those users who want the maximum expressiveness without losing computational completeness and decidability of reasoning systems • OWL Full is meant for users who want maximum expressiveness and the syntactic freedom of RDF with no computational guarantees
Some Differences • OWL Lite supports cardinality constraints, but it only permits cardinality values of 0 or 1 • In OWL Lite and OWL DL an individual can never be at the same time a class: classes and individuals form disjoint domains • In OWL Lite there is no support for boolean constructors, unionOf (OR) and complementOf (not). Some limited support for intersectionOf (AND) • In OWL Lite there is no support for one of (EnumeratedClass) constructor.
Class Descriptions • A class identifier (a URI reference) <owl:Class rdf:ID="Human"/> • A property restriction: value Universal Quantifier (Class of all individuals whose Parents are Human) <owl:Restriction> <owl:onProperty rdf:resource="#hasParent" /> <owl:allValuesFrom rdf:resource="#Human"/ </owl:Restriction> Existential Quantifier(Class of individuals who have at least one parent a Physician) <owl:Restriction> <owl:onProperty rdf:resource="#hasParent" /> <owl:someValuesFrom rdf:resource="#Physician" /> </owl:Restriction>
Class Descriptions (2) • A property restriction: cardinality <owl:Restriction> <owl:onProperty rdf:resource="#hasParent" /> <owl:maxCardinality rdf:datatype="&xsd;nonNegativeInteger">2</owl:maxCardinality> </owl:Restriction> Other constructs: minCardinality and cardinality • The intersectionOf two or more class descriptions <owl:Class rdf:ID="Woman"> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class rdf:about="#Female"/> <owl:Class rdf:about="#Human"/> </owl:intersectionOf> </owl:Class/>
Class Axioms • Class descriptions form the building blocks for defining classes through class axioms: • rdfs:subClassOf • owl:equivalentClass <owl:Class rdf:about="#Opera"> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#hasLibrettist" /> <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality> </owl:Restriction> </rdfs:subClassOf> </owl:Class> <owl:Class rdf:about="#US_President"> <owl:equivalentClass rdf:resource="#ResidentOfWhiteHouse"/> </owl:Class>
Properties • OWL distinguishes between two types of properties: • Object properties: have a value range of class individuals, and thus link individuals to individuals. • Datatype properties have a value range of data values, and thus link individuals to data values.
Properties (2) <owl:ObjectProperty rdf:ID="course"> <rdfs:domain rdf:resource="#Meal" /> <rdfs:range rdf:resource="#MealCourse" /> </owl:ObjectProperty> <owl:DatatypeProperty rdf:ID="yearValue"> <rdfs:domain rdf:resource="#VintageYear" /> <rdfs:range rdf:resource="&xsd;positiveInteger"/> </owl:DatatypeProperty> <owl:ObjectProperty rdf:ID="hasMother"> <rdfs:subPropertyOf rdf:resource="#hasParent"/> </owl:ObjectProperty>
Property Characteristics inverseOf <owl:ObjectProperty rdf:ID="hasChild"> <owl:inverseOf rdf:resource="#hasParent"/> </owl:ObjectProperty> FunctionalProperty: is a property that can have only one (unique) value y for each instance x. <owl:ObjectProperty rdf:ID="husband"> <rdf:type rdf:resource="&owl;FunctionalProperty" /> <rdfs:domain rdf:resource="#Woman" /> <rdfs:range rdf:resource="#Man" /> </owl:ObjectProperty> ( a Woman can have only one husband) InverseFunctionalProperty: where a range value uniquely determines the domain value <owl:InverseFunctionalProperty rdf:ID="biologicalMotherOf"> <rdfs:domain rdf:resource="#Woman"/> <rdfs:range rdf:resource="#Human"/> </owl:InverseFunctionalProperty> (every human has only one biological mother)
Logical Property Characteristics owl:TransitiveProperty: P(x,y) and P(y,z) implies P(x,z) <owl:TransitiveProperty rdf:ID="subRegionOf"> <rdfs:domain rdf:resource="#Region"/> <rdfs:range rdf:resource="#Region"/> </owl:TransitiveProperty> owl:SymmetricProperty: P(x,y) iff P(y,x) <owl:SymmetricProperty rdf:ID="friendOf"> <rdfs:domain rdf:resource="#Human"/> <rdfs:range rdf:resource="#Human"/> </owl:SymmetricProperty>
Individuals Individual axioms are statements about individuals, indicating class membership and statements about relevant properties <Opera rdf:ID="Tosca"> <hasComposer rdf:resource="#Giacomo_Puccini"/> <hasLibrettist rdf:resource="#Victorien_Sardou"/> <hasLibrettist rdf:resource="#Giuseppe_Giacosa"/> <hasLibrettist rdf:resource="#Luigi_Illica"/> <premiereDate rdf:datatype="&xsd;date">1900-01- 14</premiereDate> <premierePlace rdf:resource="#Roma"/> <numberOfActs rdf:datatype="&xsd;positiveInteger">3</numberOfActs> </Opera>
Individual Identity • On the web it is not possible to have unique names for different things. • OWL provides three constructs for making statements about the identity of individuals: • owl:sameAs is used to state that two URI references refer to the same individual. The construct owl:sameIndividualAs is a synonym of owl:sameAs • owl:differentFrom is used to state that two URI references refer to different individuals • owl:AllDifferent provides an idiom for stating that a list of individuals are all different.
Individual Identity (2) <Wine rdf:ID="MikesFavoriteWine"> <owl:sameAs rdf:resource="#StGenevieveTexasRed" /> </Wine> <WineSugar rdf:ID="Sweet"> <owl:differentFrom rdf:resource="#Dry"/> </WineSugar> <owl:AllDifferent> <owl:distinctMembers rdf:parseType="Collection"> <vin:WineColor rdf:about="#Red" /> <vin:WineColor rdf:about="#White" /> <vin:WineColor rdf:about="#Rose" /> </owl:distinctMembers> </owl:AllDifferent> owl:distinctMembers can only be used in combination with owl:AllDifferent
Namespaces <rdf:RDF xmlns ="http://www.w3.org/TR/………../wine#" xmlns:vin ="http://www.w3.org/TR/……/wine#" xml:base ="http://www.w3.org/TR/……./wine#" xmlns:food="http://www.w3.org/TR/….../food#" xmlns:owl ="http://www.w3.org/2002/07/owl#" xmlns:rdf ="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xsd ="http://www.w3.org/2001/XMLSchema#"> Abbreviations can be defined using an ENTITY definition <!DOCTYPE rdf:RDF [ <!ENTITY vin "http://www.w3.org/TR/………/wine#" <!ENTITY food "http://www.w3.org/TR/……../food#" > ]> <rdf:RDF xmlns ="&vin;" xmlns:vin ="&vin;" xml:base ="&vin;" xmlns:food="&food;" …….>
Headers <owl:Ontology rdf:about=""> <rdfs:comment>Example OWL ontology</rdfs:comment> <owl:priorVersionrdf:resource="http://www.w3.org/../wine"/> <owl:imports rdf:resource="http://www.w3.org/……/food"/> <rdfs:label>Wine Ontology</rdfs:label> ………. </owl:Ontology>
Importing Ontologies • owl:imports: references another OWL ontology containing definitions, whose meaning is considered to be part of the meaning of the importing ontology. • If an OWL Lite ontology imports an OWL DL or OWL Full ontology, it effectively becomes an OWL DL or OWL Full ontology. • If ontology A imports B, and B imports C, then A imports both B and C