Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 OWL: Web Ontologies Matthew Yau

Similar presentations


Presentation on theme: "1 OWL: Web Ontologies Matthew Yau"— Presentation transcript:

1 1 OWL: Web Ontologies Matthew Yau

2 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 3 RDF Schema and Ontologies  Can define Classes and Properties Using:...  Can identify Individuals as members of classes Using:.  Can identity the domain and range of a property. Using:  Can identity subclasses and subproperties Using:...

4 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 5 OWL: Three variants on OWL  OWL provides three increasingly expressive sublanguages designed for use by specific communities of implementers and users. 1. OWL Lite: 2. OWL DL: 3. OWL Full

6 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. 

7 7 OWL: Starting the Ontology  This give metadata about the ontology. walkthru-in- owl.v2.0.0 An example ontology, with data types taken from XML Schema Walkthru Ontology

8 8 OWL: Defining Classes  Classes are defined in a very similar manner to RDF Schema classes. Animal This is the class of animals.

9 9 OWL: Defining Classes  owl:Class is defined as a subclass of rdfs:Class Class The class of all "object" classes

10 10 OWL: Class Thing and Nothing Thing The most general (object) class in DAML. This is equal to the union of any class and its complement. Nothing the class with no things in it.

11 11 OWL: Defining SubClasses  As OWL classes are also RDF classes, we can use RDF Schema's subclassing mechanism

12 12 OWL: disjointWith Axiom  Class descriptions form the building blocks for defining classes through class axioms.  NOTE: OWL Lite does not allow the use of owl:disjointWith

13 13 OWL: Defining Individuals  Recall that in the OIL example, we provided individuals.  Can simply do the same in OWL - as in RDF: This just says that Peter and Ian are objects in the class Man. The first is equivalent to saying:

14 14 OWL: sameAs Individuals  OWL can allow us to assert that individuals are the same  Use the owl:sameAs property

15 15 OWL: Enumerated Classes  OWL DL (not OWL Lite) can provide Classes of enumerated individual values.

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

17 17 OWL: Defining DataType Properties  DataType Properties relate Classes with Datatypes (e.g. literals defined in XML Schema) age is a DatatypeProperty whose range is xsd:nonNegativeInteger.

18 18 OWL: Object Properties  To define Object Properties, we use owl:ObjectProperty. Again similar to RDF Schema properties, with domains and ranges:  Domain and range information can be used to infer type information  Allows us to deduce that Fred is an Animal

19 19 OWL: Object Properties  As another example, we define a property called hasHeight  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 20 OWL: Object Properties  The following is the formal defintion of ObjectProperty from the OWL standard ObjectProperty if P is an ObjectProperty, and P(x, y), then y is an object.

21 21 OWL: SubProperties  Subproperties again are similar to RDF Schema:

22 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 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)  So if we have: Mary isMarriedTo Adam  Then since isMarriedTo is Symmetric, then Adam isMarriedTo Mary

24 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): hasAncestor

25 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 26 OWL: Functional Property  So P is a FunctionalProperty if triple (x,P,y) and triple (x,P,z), then (y = z).

27 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 28 OWL: Functional Property  We can also say that Datatype properties are functional. age is also a FunctionalProperty (can only have one age)

29 29 OWL: Inverse Functional Property  So P is a InverseFunctionalProperty if triple (x,P,y) and triple (z,P,y), then (x = z). :  We can also say that Datatype properties are inverse functional.

30 30 OWL: Inverse Functional Property  So if we have: Mary studentNumber MsSmith studentNumber  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 31 OWL: Inverse Property  if have the triple (x,P,y), then triple (y,Q,x)):  So if we have: Mary hasChild Adam.  Then since hasChild and hasParent are inverse properties, then : Adam hasParent Mary.

32 32 OWL: Property Restrictions  A slightly tricky example - as this is recursive.

33 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

34 34 OWL: Cardinality Restrictions  Can also use restriction to set the number of times a property can occur on a class instance: 1

35 35 OWL: Cardinality Restrictions  Can also have minCardinality and maxCardinality 1

36 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:

37 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.  We can declare that two properties are the same:

38 38 OWL: Equivalent Classes and Properties  These constructs can be used to map different Ontologies together.

39 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.

40 40 OWL: Union  Thus Unions e.g. People are made up of exactly Men and Women: every person is a man or a woman

41 41 OWL: Intersection  Similarly for Intersection e.g. a tall man is a tall thing which is also a man:

42 42 OWL: Complementary Classes  Complements e.g. Inanimate objects are the things which are not living:

43 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: 1

44 44 OWL: Defining Classes using these operations  e.g. People are not Cats: no cat is a person

45 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.

46 46 OWL: User Defined DataTypes  And in the OWL file:

47 47 OWL: Defining Instances  Thus to redefine the Individuals we had earlier, with some additional properties:

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

49 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 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: A: drink White Wine with Seafood

51 51 Basic Queries 1

52 52 A simple OWL-QL query 2 Query: ( “ Who owns a red car? ” ) Query Pattern: (owns ?p ?c) (type ?c Car) (has-color ?c Red) Must-Bind Variables List: (?p) May-Bind Variables List: () Don ’ t-Bind Variables List: () Answer Pattern: (owns ?p a red car) Answer KB Pattern: …

53 53 Basic Queries 2 5 /* … answer pattern*/

54 54 Query patterns  specifies a collection of OWL sentences in which some URIrefs are considered to be variables  Query Pattern: (owns ?p ?c) (type ?c Car) (has-color ?c Red)

55 55 OWL-QL bindings  A KB may entail the existence of a query answer, but not entail a binding for every variable in the query  A KB says -every person has exactly one father and -Joe is a person  The KB -entails that Joe has a father -but may not entail a value of property “ hasFather ” for Joe (i.e., the KB may not identify the father)

56 56 OWL-QL bindings  Three types of OWL-QL bindings 1. must-bind variables lists -Answers must provide bindings for all the must-bind variables 2. may-bind variables lists -Answers may provide bindings for any of the may-bind variables 3. don ’ t-bind variables lists -Answers are not to provide bindings for any of the don ’ t-bind variables

57 57 Answer patterns  specify the format in which answer bindings are returned  Answer Pattern: (owns ?p a red car)}

58 58 Query premises  enable “ if-then ” queries -such as “ If Joe is a person, then does Joe have a father? ” - “ if-then ” queries cannot be stated using only a query pattern  When a premise is included in a query -it is considered to be included in the answer KB Query: “ If C1 is a Seafood Course and W1 is a drink of C1, then what color is W1? Premise: {(type C1 Seafood-Course) (has- drink W1 C1)} Query Pattern: {(has-color W1 ?x)} Must-Bind Variables List: (?x)

59 59 Answer KB patterns  specify answer KBs -answer KB: a set of OWL sentences that are used by the server in answering a query  If a query ’ s answer KB pattern is -a variable then the server is free to select or to generate an answer KB from which to answer the query -a KB (or a reference to a KB) then the answer sentences must be entailed by that KB -a list of KBs then answer sentences must be entailed by conjunction of the KBs in that list

60 60 An OWL-QL answer  Contains -answer pattern instances -an answer bundle (including process handle)

61 61 A simple OWL-QL answer Query: ( “ Who owns a red car? ” ) Query Pattern: {(owns ?p ?c) (type ?c Car) (has- color ?c Red)} Must-Bind Variables List: (?p) May-Bind Variables List: () Don ’ t-Bind Variables List: () Answer Pattern: (owns ?p a red car) Answer KB Pattern: … Answer: ( “ Joe owns a red car. ” ) Answer Pattern Instance: (owns Joe a red car) Query: … Server: …

62 62 A simple OWL-QL answer

63 63 A simple OWL-QL answer (Cont)

64 64 Answer bundle size bounds  specify the maximum number of answers in each “ bundle ” -answers are delivered by the server in bundles 5  contain at most the number of query answers given by the answer bundle size bound

65 65 Support for OWL  OWL-QL -takes advantage of the expressive power of the OWL language itself  Q: (subclassOf ?x Person) must-bind ?x will return the derivable subclasses of class Person  Q: (type ?x Person) must-bind ?x will return the derivable instances of class Person  limited to concepts which can be expressed using OWL no way to express the concept of a most specific type in OWL E.g., expressivity for numerical quantities is absent and is currently handled outside the OWL and reasoning  No OWL-specific query language recommended (SPARQL is temporary solution)

66 66 Online Demonstrations  Try OWQL Query Service at /FrontEnd /FrontEnd

67 67 References  OWL Web Ontology Language Guide  OWL-QL Project for the Stanford Knowledge Systems Laboratory s/owl-ql/  SPARQL and OWL-QL /sep541-07summer.dir/sparql- owlql-(105pages).pdf


Download ppt "1 OWL: Web Ontologies Matthew Yau"

Similar presentations


Ads by Google