1 masws multi-agent semantic web systems: owl stephen potter, cisa, school of informatics,...

32
1 MASWS Multi-Agent Semantic Web Systems: OWL Stephen Potter, CISA, School of Informatics, University of Edinburgh, Edinburgh, UK. [email protected]

Upload: willa-whitehead

Post on 28-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

1

MASWS

Multi-Agent Semantic Web Systems: OWL

Stephen Potter,CISA, School of Informatics,

University of Edinburgh, Edinburgh, UK.

[email protected]

2

MASWS

OWL: Web Ontology OWL: Web Ontology LanguageLanguage

Description Logics have…:

– …well-defined semantics;

– …tractable inference algorithms.

OWL (Web Ontology Language) is…

– …an ontology language based on DLs for the Semantic Web;

– …a W3C standard;

– …built on top of RDF (and semantically extends RDF(S));

– …expressed using an RDF/XML syntax.

3

MASWS

The Description Logics The Description Logics FamilyFamily

ALC– Sound and complete subsumption testing

ALCN– ALC + number restriction n R

ALCR+ – ALC + transitively closed roles

SHIQ– SH family: ALC + transitive roles and role hierarchy

SHOQ(D)– Adds datatypes (D) and enumerated types to SHIQ

SHIF(D)– Adds datatypes transitive roles and role hierarchy, plus

functional attributes to SHIQ (OWL-Lite)

SHOIN(D)– Adds nominals to class descriptions (oneOf {a,b,c}) and

arbitrary cardinality constraints (OWL-DL)

4

MASWS

OWL and the Semantic OWL and the Semantic WebWeb

XML provides document syntax;

XML Schema allows structuring of documents plus datatypes;

RDF provides a data model for talking about objects (resources) and their relationships;

RDF Schema provides a simple vocabulary for describing properties and classes of resources.

OWL provides a richer language for describing properties and classes

– Eg. provides some relations between classes (such as disjointedness), characteristics of properties, cardinality, etc

5

MASWS

OWL SpeciesOWL Species

OWL-Full: few restrictions on use of language constructs, but not decidable (closer to FOL).

– Use if expressiveness is more important than complete reasoning.

OWL-DL: restricted version of OWL-Full, but with restrictions on the use of the language constructs to ensure decidability. Corresponds to a description logic.

OWL-Lite: a subset of OWL-DL – a simple description logic.

– Use for simple class hierarchies with simple constraints;

– (Provides a migration path for existing thesauri/taxonomies)

6

MASWS

OWL OntologiesOWL Ontologies

OWL allows for the distributed nature of the web in several ways:

– An ontology can be related to other ontologies (eg., by explicitly importing definitions).

– OWL makes an open-world assumption (definitions not confined to a single scope) – something is false only if it can be proved to contradict other information in the ontology

– OWL propositions are monotonic, that is, new information can never retract previous information – facts and entailments can be added, never deleted (however this new information can be contradictory).

Allows TBox (terminological statements) and ABox (assertions/individuals) to be represented.

7

MASWS

Components of an OWL Components of an OWL ontologyontology

Classes

Properties

Individuals

Thing

Country

Human

James

United Kingdom

livesInCountry

8

MASWS

<?xml version="1.0"?><!DOCTYPE rdf:RDF [ <!ENTITY owl "http://www.w3.org/2002/07/owl#" > <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" > ... ]><rdf:RDF xmlns = "http://www.inf.ed.ac.uk/ontology/example#" xml:base = " http://www.inf.ed.ac.uk/ontology/example#“ ... xmlns:owl = "http://www.w3.org/2002/07/owl#“>

First Things FirstFirst Things First

Introduce any XML namespace declarations:

– Allows identifiers to be specified unambiguously

– Makes the ontology more readable.

<owl:Ontology rdf:about="">

<rdfs:comment>An example OWL ontology</rdfs:comment>

<rdfs:label>Example Ontology</rdfs:label>

<owl:imports>...</owl:imports>

...

Declare the ontology and any meta-information

9

MASWS

OWL ClassesOWL Classes

OWL supports a number of different ways of defining a class.

In OWL-Lite:

– As a simple named class;

…and in OWL-DL:

– As the intersection of other classes;

– As the union of other classes;

– As the complement of another class;

– Using class restrictions;

– By enumerating the class.

10

MASWS

Named ClassesNamed Classes If not stated, a class is

assumed to be a subclass of owl:Thing:

Human ⊑ ⊤

Use rdfs:subClassOf to explicitly subclass another class:

Student ⊑ Human

Thing

Human

<owl:Class rdf:ID="Student">

<rdfs:subClassOf rdf:resource="#Human"/>

</owl:Class>

<owl:Class rdf:ID="Human"/>

Student

11

MASWS

OWL IndividualsOWL Individuals

Using a class definition:

…we can now create individuals of this class:

and perhaps elsewhere provide additional information:

<owl:Class rdf:ID="Student">

<rdfs:subClassOf rdf:resource="#Human"/>

</owl:Class>

<Student rdf:ID="James_Smith" />

Student

James_Smith

<owl:Thing rdf:about="#James_Smith">

<livesInCountry rdf:resource="#UnitedKingdom" />

</owl:Thing>

12

MASWS

OWL PropertiesOWL Properties

In DLs properties allow us to define general relationships between classes, and specific relationships between individuals.

OWL distinguishes between two types of properties:

– Datatype properties describe relationships between individuals of some class and RDF literals or XML Schema datatypes.

– Object properties describe relationships between individuals of two classes.

RangeDomain

Property relationship

13

MASWS

OWL PropertiesOWL Properties

Eg:

– <http://some.full.uri/example#James_Smith, ”James Smith”>: hasName

Eg:

– <http://some.full.uri/example#James_Smith, http://some.other.uri/country#UnitedKingdom>: livesInCountry

<owl:DatatypeProperty rdf:ID="hasName">

<rdfs:domain rdf:resource="#Human" />

<rdfs:range rdf:resource="&xsd;string"/>

</owl:DatatypeProperty>

<owl:ObjectProperty rdf:ID="livesInCountry">

<rdfs:domain rdf:resource="#Human" />

<rdfs:range rdf:resource="#Country" />

</owl:ObjectProperty>

14

MASWS

Property CharacteristicsProperty Characteristics

In addition, a property can be defined to be:

– FunctionalProperty: a given individual has only one value of the property (eg. hasDateOfBirth).

– InverseFunctionalProperty: the inverse of the property is functional (eg. birthDateOf).

– SymmetricProperty: if a property relates x to y, then it can be inferred that it relates y to x (eg. nextTo).

– TransitiveProperty: if a property relates x to y, and y to z, then it can also be inferred that it relates x to z (eg. locatedIn).

– subPropertyOf another property.

– inverseOf: (eg. birthDateOf is inverse of hasDateOfBirth).

15

MASWS

OWL-DL ClassesOWL-DL Classes

OWL supports a number of different ways of defining a class.

In OWL-Lite:

– As a simple named class;

…and in OWL-DL:

– Using property restrictions;

– As the intersection of other classes;

– As the union of other classes;

– As the complement of another class;

– By enumerating the class.

16

MASWS

Property RestrictionsProperty Restrictions

Property Restrictions define a class of individuals based on the nature and/or number of relationships in which they participate.

Restrictions can be considered to fall into three groups:

– Quantifier restrictions (someValuesFrom, allValuesFrom).

– Cardinality restrictions (cardinality, minCardinallity, maxCardinality).

– hasValue restriction.

17

MASWS

someValuesFromsomeValuesFrom Restriction Restriction

The ‘existential’ restriction (∃).

Read as ‘has some values from’ or ‘at least one’.

Describes the class of individuals that have at least one kind of relationship along the specified property with an individual that is a member of a specified class.

So: ∃R.C defines the class of individuals that are in at least one relationship R with an individual of class C.

So: ∃eats.Plant defines the class of individuals that eat some/at least one (individuals from the set of) Plants.

{ x | ∃y.(eats(x,y) ⋀ Plant(y)) }

18

MASWS

someValuesFromsomeValuesFrom Restriction Restriction

Plant

∃eats.Plant eatseats

eats

eats

eats

<owl:Restriction>

<owl:onProperty rdf:resource="#eats" />

<owl:someValuesFrom rdf:resource="#Plant" />

</owl:Restriction>

eats

19

MASWS

allValuesFromallValuesFrom Restriction Restriction

The ‘universal’ restriction (∀).

Read as “has all values from” or “only”.

Describes the class of individuals that if they are in a particular relationship along the specified property, it is only with individuals that are a member of the specified class.

So: ∀R.C defines the class of individuals that, if they are in relationship R, it is only with individuals of class C.

So: ∀eats.Plant defines the class of individuals that, if they eat anything, they eat only (individuals from the set of) Plants.

{ x | ∀y.(eats(x,y) → Plant(y)) }

eats(a,b) Plant(b) →false false truefalse true truetrue false falsetrue true true

20

MASWS

allValuesFromallValuesFrom Restriction Restriction

Plant

∀eats.Plant eatseats

eats

eats

eats

<owl:Restriction>

<owl:onProperty rdf:resource="#eats" />

<owl:allValuesFrom rdf:resource="#Plant" />

</owl:Restriction>

eats

eats

21

MASWS

Cardinality RestrictionsCardinality Restrictions For a given property, cardinality

restrictions allow us to define the number of relationships that individuals of a class participate in:

– cardinality ("exactly"), minCardinality ("at least"), maxCardinality ("at most").

– Restricted to values of 0 and 1in OWL-Lite (positive integers allowed in OWL-DL).<owl:Class rdf:ID="PostgraduateStudent">

<rdfs:subClassOf>

<owl:Restriction>

<owl:onProperty rdf:resource="#hasMatriculationNumber"/>

<owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>

</owl:Restriction>

</rdfs:subClassOf>

</owl:Class>

Note: stronger than a functionalProperty: ...every student has exactly one matric. number

22

MASWS

hasValuehasValue Restrictions Restrictions hasValue restrictions allow us to define the

class of individuals which have a particular property relationship with a particular individual.

<owl:Class rdf:ID="UKResidents"> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#livesInCountry" /> <owl:hasValue rdf:resource="#UnitedKingdom" /> </owl:Restriction> </rdfs:subClassOf></owl:Class>

CountrylivesInCountry ∋ UnitedKindom livesInCountry

livesInCountry

livesInCountry

livesInCountryUnitedKindom

France

23

MASWS

Intersection of Classes: Intersection of Classes: intersectionOfintersectionOf

Class defined as the intersection of two or more classes:

Woman ≡ Human ⊓ Female

(Could use more complicated class definitions.)

Female

<owl:Class rdf:ID="Woman">

<owl:intersectionOf rdf:parseType="Collection">

<owl:Class rdf:about="#Human" />

<owl:Class rdf:about="#Female" />

</owl:intersectionOf>

</owl:Class>

Human

24

MASWS

Union of Classes: Union of Classes: unionOfunionOf

Class defined as the union of two or more classes:

Parent ≡ Father ⊔ Mother Father

<owl:Class rdf:ID="Parent">

<owl:unionOf rdf:parseType="Collection">

<owl:Class rdf:about="#Father" />

<owl:Class rdf:about="#Mother" />

</owl:unionOf>

</owl:Class>

Mother

25

MASWS

Complement Classes: Complement Classes: complementOfcomplementOf

Class defined as the complement of another class:

Childless ≡ ¬Parent Parent

<owl:Class rdf:ID="Childless">

<owl:complementOf rdf:resource="#Parent" />

</owl:Class>

Childless

26

MASWS

Enumerated Classes: Enumerated Classes: oneOfoneOf

An enumerated class is specified by explicitly and exhaustively listing the individuals that are members of the class.

<owl:Class rdf:ID="HolidayDestinations">

<owl:oneOf rdf:parseType="Collection">

<owl:Thing rdf:about="#Spain"/>

<owl:Thing rdf:about="#Italy"/>

<owl:Thing rdf:about="#Greece"/>

</owl:oneOf>

</owl:Class>

HolidayDestinations Greece

Spain

Italy

27

MASWS

Disjointness: Disjointness: disjointWithdisjointWith

Specifying disjointness ensures that a member of one class is not also a member of any disjoint class.

ie., An animal cannot also be a plant nor a mineral.

Note: this does not imply that Plant and Mineral are also disjoint - we need to say this explicitly!

<owl:Class rdf:ID="Animal">

<owl:disjointWith rdf:resource="#Plant"/>

<owl:disjointWith rdf:resource="#Mineral"/>

</owl:Class>

28

MASWS

EquivalencesEquivalences

We can say that a class (property, individual) is equivalent to a second class (property, individual).

– indicates that the two classes (properties) have exactly the same instances (tuples) as members.

– (use equivalentProperty for properties, and owl:sameAs for individuals.)

equivalentClass allows the specification of necessary and sufficent conditions for class membership (subClassOf gives just necessary).

Can be used for relating elements of one ontology to those of another.

Can also say that two individuals are differentFrom each other.

<owl:Class rdf:ID="Country">

<owl:equivalentClass rdf:resource="&otheront;Nation"/>

</owl:Class>

29

MASWS

Ontology VersioningOntology Versioning

OWL recognises the fact that ontologies develop over time:

Also backwardCompatibleWith and incompatibleWith.

Can indicate that particular classes/properties have become deprecated.

– Only in OWL-Full can you make these sorts of statements…

– …and the semantics are not defined anyway.

<owl:Ontology rdf:about="">

...

<owl:priorVersion rdf:resource="http://www.inf.ed.ac.uk/ontology/old-example"/>

...

</owl:Ontology>

30

MASWS

Reasoning in OWL-DLReasoning in OWL-DL

For OWL-Lite and OWL-DL ontologies, we can use automated reasoners to infer information that is not explicitly stated in the ontology.

Standard reasoning 'services' include:

– classification: construct class hierarchy based on definitions of the classes.

– subsumption testing: does C⊑ D ?

• ie. do all members of set C necessarily belong to set D under all possible interpretations?

– equivalence testing: does C≡D ?

• ie. is set C equivalent to set D under all possible interpretations?

– satisfiability/consistency testing: is C consistent wrt TBox?

• ie. is the set C non-empty under at least one interpretation?

– instance checking: is a given individual an instance of a specified class?

31

MASWS

OWL SummaryOWL Summary

OWL is a W3C standard language for specifying ontologies for the Semantic Web:

– language includes some elements that support distributed ontology and knowledge base use/development.

It is layered on top of RDF and RDFS, and is based on description logics.

There are three species of OWL: OWL-Lite, OWL-DL and OWL-Full.

We can perform reasoning over ontologies written in OWL-Lite and OWL-DL.

32

MASWS

Further Reading…Further Reading…

W3C OWL web site:– http://www.w3.org/2004/OWL/

OWL Web Ontology Language Overview:– http://www.w3.org/TR/2004/REC-owl-features-20040210/

CO-ODE web site:– http://www.co-ode.org/