1 / 67

OWL: Web Ontologies

OWL: Web Ontologies. Matthew Yau C.Y.Yau@warwick.ac.uk. Reminder on Ontologies. An ontology is a formal, explicit specification of a shared conceptualisation.

nerina
Download Presentation

OWL: Web Ontologies

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. OWL:Web Ontologies Matthew Yau C.Y.Yau@warwick.ac.uk

  2. Reminder on Ontologies An ontology is a formal, explicit specification of a shared conceptualisation. • 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 understandable, i.e. the machine should be able to interpret the semantics of the information provided. • Shared reflects the notion that an ontology captures consensual knowledge, that is, it is not restricted to some individual, but accepted by a group.

  3. RDF Schema and Ontologies • Can define Classes and Properties • Using: <rdfs:Class ...>...</rdfs:Class> • Using: <rdfs:Property ...>...</rdfs:Property> • Can identify Individuals as members of classes • Using: <rdf:type ... />. • Can identity the domain and range of a property. • Using: <rdfs:domain ...> • Using: <rdfs:range ...> • Can identity subclasses and subproperties • Using: <rdfs:subClassOf ...>...</rdfs:subClassOf> • Using: <rdfs:subPropertyOf ...>...</rdfs:subPropertyOf>

  4. RDF Schema Problems • there are lot of relationships we would like to add which RDF Schema does not allow us to say: That two classes are disjoint - they have no members in common • e.g. Cats and Dogs That properties are Inverses of each other - that is one property is the other "backwards": • e.g. hasChild and hasParent That one class is formed by taking union of two other classes. • e.g. UniversityMembers is the combination of Staff and Students That two classes are the same. • e.g. the class Humans is the same as the class People

  5. OWL: Three variants on OWL • OWL provides three increasingly expressive sublanguages designed for use by specific communities of implementers and users. • OWL Lite: • OWL DL: • OWL Full

  6. OWL: Namespaces • As we are using RDF as the basis of OWL, we start with a rdf:RDF element, and a series of Namespace declarations. • <rdf:RDF xmlns ="http://example.org/walkthru-in-owl#" xmlns:oex ="http://example.org/walkthru-in-owl#" 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/2000/10/XMLSchema#">

  7. OWL: Starting the Ontology • This give metadata about the ontology. <owl:Ontology rdf:about=""> <owl:versionInfo>walkthru-in- owl.v2.0.0</owl:versionInfo> <owl:priorVersion rdf:resource="http://example.org/wal kthru-in-owl-v1"></owl:priorVersion> <rdfs:comment> An example ontology, with data types taken from XML Schema </rdfs:comment> <owl:imports rdf:resource="..."/> <rdfs:label>Walkthru Ontology</rdfs:label> </owl:Ontology>

  8. OWL: Defining Classes • Classes are defined in a very similar manner to RDF Schema classes. <owl:Class rdf:ID="Animal"> <rdfs:label>Animal</rdfs:label> <rdfs:comment> This is the class of animals. </rdfs:comment> </owl:Class>

  9. OWL: Defining Classes • owl:Class is defined as a subclass of rdfs:Class <rdfs:Class rdf:ID="Class"> <rdfs:label>Class</rdfs:label> <rdfs:comment>The class of all "object" classes</rdfs:comment> <rdfs:subClassOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class" /> </rdfs:Class>

  10. OWL: Class Thing and Nothing <Class rdf:ID="Thing"> <rdfs:label>Thing</rdfs:label> <rdfs:comment> The most general (object) class in DAML. This is equal to the union of any class and its complement. </rdfs:comment> <unionOf rdf:parseType="Collection"> <rdfs:Class rdf:about="#Nothing"/> <rdfs:Class> <complementOf rdf:resource="#Nothing"/> </rdfs:Class> </unionOf> </Class> <Class rdf:ID="Nothing"> <rdfs:label>Nothing</rdfs:label> <rdfs:comment>the class with no things in it.</rdfs:comment> <complementOf rdf:resource="#Thing"/> </Class>

  11. OWL: Defining SubClasses • As OWL classes are also RDF classes, we can use RDF Schema's subclassing mechanism <owl:Class rdf:ID="Male"> <rdfs:subClassOf rdf:resource="#Animal"/> </owl:Class> <owl:Class rdf:ID="Man"> <rdfs:subClassOf rdf:resource="#Person"/> <rdfs:subClassOf rdf:resource="#Male"/> </owl:Class>

  12. OWL: disjointWith Axiom • Class descriptions form the building blocks for defining classes through class axioms. <owl:Class rdf:ID="Female"> <rdfs:subClassOf rdf:resource="#Animal"/> <owl:disjointWith rdf:resource="#Male"/> </owl:Class> • NOTE: OWL Lite does not allow the use of owl:disjointWith

  13. OWL: Defining Individuals • Recall that in the OIL example, we provided individuals. • Can simply do the same in OWL - as in RDF: <Man rdf:ID="Peter" /> <Man rdf:ID="Ian"/> This just says that Peter and Ian are objects in the class Man. The first is equivalent to saying: <owl:Thing rdf:ID="Peter" /> <owl:Thing rdf:about="#Peter"> <rdf:type rdf:resource="#Man"/> </owl:Thing>

  14. OWL: sameAs Individuals • OWL can allow us to assert that individuals are the same • Use the owl:sameAs property <Man rdf:ID="Peter" /> <Man rdf:ID="MrSmith"> <owl:sameAs rdf:resource="#Peter" /> </Man>

  15. OWL: Enumerated Classes • OWL DL (not OWL Lite) can provide Classes of enumerated individual values. <owl:Class rdf:ID="Height"> <owl:oneOf rdf:parseType="owl:collection"> <Height rdf:ID="short"/> <Height rdf:ID="medium"/> <Height rdf:ID="tall"/> </owl:oneOf> </owl:Class>

  16. OWL: Defining Properties • OWL allows us to define two sorts of Properties: • Datatype properties • Object properties

  17. OWL: Defining DataType Properties • DataType Properties relate Classes with Datatypes (e.g. literals defined in XML Schema) <owl:DatatypeProperty rdf:ID="age"> <rdfs:comment> age is a DatatypeProperty whose range is xsd:nonNegativeInteger. </rdfs:comment> <rdfs:range rdf:resource="http://www.w3.org/2000/10/XMLSchema#nonNegativeInteger"/> </owl:DatatypeProperty>

  18. OWL: Object Properties • To define Object Properties, we use owl:ObjectProperty. Again similar to RDF Schema properties, with domains and ranges: <owl:ObjectProperty rdf:ID="hasParent"> <rdfs:domain rdf:resource="#Animal"/> <rdfs:range rdf:resource="#Animal"/> </owl:ObjectProperty> • Domain and range information can be used to infer type information <owl:Thing rdf:ID="Fred"> <hasParent rdf:resource="#Ian" /> </owl:Thing> • Allows us to deduce that Fred is an Animal

  19. OWL: Object Properties • As another example, we define a property called hasHeight <owl:ObjectProperty rdf:ID="hasHeight"> <rdfs:range rdf:resource="#Height"/> </owl:ObjectProperty> • We don't specify a domain, so this can be the height of any "Thing" • The following is the formal defintion of ObjectProperty from the OWL standard.

  20. OWL: Object Properties • The following is the formal defintion of ObjectProperty from the OWL standard <rdfs:Class rdf:ID="ObjectProperty"> <rdfs:label>ObjectProperty</rdfs:label> <rdfs:comment>if P is an ObjectProperty, and P(x, y), then y is an object. </rdfs:comment> <rdfs:subClassOf rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property" /> </rdfs:Class>

  21. OWL: SubProperties • Subproperties again are similar to RDF Schema: <owl:ObjectProperty rdf:ID="hasFather"> <rdfs:subPropertyOf rdf:resource="#hasParent"/> <rdfs:range rdf:resource="#Male"/> </owl:ObjectProperty>

  22. OWL: Property Characteristics • Property Characteristics specify the nature of properties, which can then be used to enhance the reasoning over the property. • We can specify what they mean by considering triples, that is we consider the triples (x P y) for the property P.

  23. OWL: Symmetric Property • A symmetric property is one which can be "switched around" and still remain within the property • That is, for a symmetric property P, if triple (x,P,y) then triple (y,P,x) <owl:SymmetricProperty rdf:ID="isMarriedTo"> <rdfs:domain rdf:resource="#Person"/> <rdfs:range rdf:resource="#Person"/> </owl:SymmetricProperty> • So if we have: Mary isMarriedTo Adam • Then since isMarriedTo is Symmetric, then Adam isMarriedTo Mary

  24. OWL: Transitive Property • That is P is a transitive property, if triple (x,P,y) and triple (y,P,z), then triple (x,P,z): <owl:TransitiveProperty rdf:ID="hasAncestor"> <rdfs:label>hasAncestor</rdfs:label> </owl:TransitiveProperty> <owl:TransitiveProperty rdf:ID="descendant"/>

  25. OWL: Transitive Property • So if we have: Mary hasAncestor Anne . Anne hasAncestor Adam . • Then since hasAncestor is Transitive, then Mary hasAncestor Adam. • TransitiveProperty is a sub-property of ObjectProperty

  26. OWL: Functional Property • So P is a FunctionalProperty if triple (x,P,y) and triple (x,P,z), then (y = z). <owl:FunctionalProperty rdf:ID="hasMother"> <rdfs:subPropertyOf rdf:resource="#hasParent"/> <rdfs:range rdf:resource="#Female"/> </owl:FunctionalProperty>

  27. OWL: Functional Property • So if we have: Mary hasMother MrsRobinson. Mary hasMother Anne. • Then since hasMother is Functional, then : Anne owl:sameAs MrsRobinson.

  28. OWL: Functional Property • We can also say that Datatype properties are functional. <owl:DatatypeProperty rdf:ID="age"> <rdfs:comment> age is also a FunctionalProperty (can only have one age) </rdfs:comment> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/> <rdfs:range rdf:resource="http://www.w3.org/2000/10/XMLSchema#nonNegativeInteger"/> </owl:DatatypeProperty>

  29. OWL: Inverse Functional Property • So P is a InverseFunctionalProperty if triple (x,P,y) and triple (z,P,y), then (x = z). : <owl:InverseFunctionalProperty rdf:ID="isMarriedTo"/> • We can also say that Datatype properties are inverse functional. <owl:DatatypeProperty rdf:ID="studentNumber"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#InverseFunctionalProperty"/> <rdfs:range rdf:resource="http://www.w3.org/2000/10/XMLSchema#nonNegativeInteger"/> </owl:DatatypeProperty>

  30. OWL: Inverse Functional Property • So if we have: Mary studentNumber 87324. MsSmith studentNumber 87324. • Then since studentNumber is Inverse Functional, then : Mary owl:sameAs MsSmith. • If the Ontology demands that they are different objects, then there is a contradiction.

  31. OWL: Inverse Property • if have the triple (x,P,y), then triple (y,Q,x)): <owl:ObjectProperty rdf:ID="hasChild"> <owl:inverseOf rdf:resource="#hasParent"/> </owl:ObjectProperty> • So if we have: Mary hasChild Adam . • Then since hasChild and hasParent are inverse properties, then : Adam hasParent Mary .

  32. OWL: Property Restrictions • A slightly tricky example - as this is recursive. <owl:Class rdf:ID="Person"> <rdfs:subClassOf rdf:resource="#Animal"/> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#hasParent"/> <owl:allValuesFrom rdf:resource="#Person"/> </owl:Restriction> </rdfs:subClassOf> </owl:Class>

  33. OWL: Property Restrictions - Some Values From • As well as using allValuesFrom, we can also construct restrictions where at least one value of a domain is from a particular class <owl:Class rdf:ID="Carnivore"> <rdfs:subClassOf rdf:resource="#Animal"/> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#eats"/> <owl:someValuesFrom rdf:resource="#Animal"/> </owl:Restriction> </rdfs:subClassOf> </owl:Class>

  34. OWL: Cardinality Restrictions • Can also use restriction to set the number of times a property can occur on a class instance: <owl:Class rdf:about="#Person"> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#hasFather"/> <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality> </owl:Restriction> </rdfs:subClassOf> </owl:Class>

  35. OWL: Cardinality Restrictions • Can also have minCardinality and maxCardinality <owl:Class rdf:about="#Person"> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#hasSpouse"/> <owl:maxCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:maxCardinality> </owl:Restriction> </rdfs:subClassOf> </owl:Class>

  36. OWL: Defining Classes by Value • OWL DL (not OWL Lite) allows us to specify classes based on the existence of particular property values. • TallThing is within the class of things whose hasHeight has the value tall: <owl:Class rdf:ID="TallThing"> <owl:subClassOf > <owl:Restriction> <owl:onProperty rdf:resource="#hasHeight"/> <owl:hasValue rdf:resource="#tall"/> </owl:Restriction> </owl:subClassOf> </owl:Class>

  37. OWL: Equivalent Classes and Properties • OWL provides constructs to say that Classes and Properties can be equivalant. • We can set classes to be equivalent. <owl:Class rdf:ID="HumanBeing"> <owl:EquivalentClass rdf:resource="#Person"/> </owl:Class> • We can declare that two properties are the same: <owl:ObjectProperty rdf:ID="hasMum"> <owl:EquivalentProperty rdf:resource="#hasMother"/> </owl:ObjectProperty>

  38. OWL: Equivalent Classes and Properties • These constructs can be used to map different Ontologies together. <owl:Class rdf:ID="MyPerson"> <owl:EquivalentClass rdf:resource="foaf:Person"/> </owl:Class>

  39. OWL: Equivalent Classes and Properties • Also, we can combine with a property restriction to say that the new class is exactly the restricted class. <owl:Class rdf:about="#Carnivore"> <rdfs:EquivalentClass> <owl:Restriction> <owl:onProperty rdf:resource="#eats"/> <owl:allValuesFrom rdf:resource="#Animal"/> </owl:Restriction> </rdfs:EquivalentClass> </owl:Class>

  40. OWL: Union • Thus Unions e.g. People are made up of exactly Men and Women: <owl:Class rdf:about="#Person"> <rdfs:comment>every person is a man or a woman</rdfs:comment> <owl:unionOf rdf:parseType="owl:collection"> <owl:Class rdf:about="#Man"/> <owl:Class rdf:about="#Woman"/> </owl:unionOf> </owl:Class>

  41. OWL: Intersection • Similarly for Intersection e.g. a tall man is a tall thing which is also a man: <owl:Class rdf:ID="TallMan"> <owl:intersectionOf rdf:parseType="owl:collection"> <owl:Class rdf:about="#TallThing"/> <owl:Class rdf:about="#Man"/> </owl:intersectionOf> </owl:Class>

  42. OWL: Complementary Classes • Complements e.g. Inanimate objects are the things which are not living: <owl:Class rdf:ID="InanimateThing"> <owl:complementOf rdf:parseType="owl:collection"> <owl:Class rdf:about="#LivingThing"/> </owl:complementOf> </owl:Class>

  43. OWL: Defining Classes using these operations • Can be used to give the necessary and sufficient condition for a class. • e.g. Married People are People who are Married: <owl:Class rdf:ID="MarriedPerson"> <owl:intersectionOf rdf:parseType="owl:collection"> <owl:Class rdf:about="#Person"/> <owl:Restriction > <owl:onProperty rdf:resource="#hasSpouse"/> <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality> </owl:Restriction> </owl:intersectionOf> </owl:Class>

  44. OWL: Defining Classes using these operations • e.g. People are not Cats: <owl:Class rdf:ID="Cat"> <rdfs:comment>no cat is a person</rdfs:comment> <rdfs:subClassOf> <owl:Class> <owl:complementOf rdf:resource="#Person"/> </owl:Class> </rdfs:subClassOf> </owl:Class>

  45. OWL: User Defined DataTypes • By combining with XML Schema DataTypes we can make more precise definitions of the values that Datatype properties can have, in the XML Schema. <xsd:simpleType name="over17"> <xsd:restriction base="xsd:positiveInteger"> <xsd:minInclusive value="18"/> </xsd:restriction> </xsd:simpleType>

  46. OWL: User Defined DataTypes • And in the OWL file: <owl:Class rdf:ID="Adult"> <owl:Restriction> <owl:onProperty rdf:resource="#age"/> <owl:allValuesFrom rdf:resource= "http://example.org/walkthru-in-owl#over17"/> </owl:Restriction> </owl:Class>

  47. OWL: Defining Instances • Thus to redefine the Individuals we had earlier, with some additional properties: <Person rdf:ID="Peter"> <shoesize>9.5</shoesize> <age>46</age> <shirtsize>15</shirtsize> </Person> <Person rdf:ID="Ian"> <shoesize>14</shoesize> <age>37</age> <shirtsize><xsd:string rdf:value="12"/></shirtsize> </Person>

  48. OWL-QL • OWL-QL (OWLQuery Language) • a query language for OWL • based on DQL (DAML Query Lang.) • supports query-answering dialogues

  49. Basic Queries a query pattern (required) a must-bind variables list a may-bind variables list a don’t bind variables list an answer pattern a query premise an answer KB pattern an answer bundle size bound

  50. A simple OWL-QL query 1 • If C1 is a Seafood Course and W1 is a drink of C1,what color is W1? P: (type C1 Seafood-Course) (drink C1 W1) Q: (has-color W1 ?x) V: must-bind ?x AP: drink ?x Wine with Seafoood KB: http://somewhere.com/wine.owl A: drink White Wine with Seafood

More Related