lect6-an introduction to ontologies and ontology development

77
LECTURE 6: An introduction to ontologies and ontology development Artificial Intelligence II – Multi-Agent Systems Introduction to Multi-Agent Systems URV, Winter-Spring 2010 (Based on a presentation by Dr David Sánchez)

Upload: antonio-moreno

Post on 15-Jan-2015

3.655 views

Category:

Technology


2 download

DESCRIPTION

Lecture 6 of MAS course at URV, 2010

TRANSCRIPT

Page 1: Lect6-An introduction to ontologies and ontology development

LECTURE 6: An introduction to ontologies and ontology development

Artificial Intelligence II – Multi-Agent Systems

Introduction to Multi-Agent Systems

URV, Winter-Spring 2010

(Based on a presentation by Dr David Sánchez)

Page 2: Lect6-An introduction to ontologies and ontology development

Outline of the lecture

OntologiesDefinitionComponentsUse in MAS

OWL: Web Ontology LanguageA method for ontology development

Page 3: Lect6-An introduction to ontologies and ontology development

Ontologies in FIPA-ACL

You have come across ontologies before in this course:

(cfp:sender (agent-identifier :name j) :receiver (set (agent-identifier :name i)):content

"((action (agent-identifier :name i)(sell book “The Lord of the Rings”)(any ?x (and (= (price book) ?x) (< ?x 10)))))"

:ontology book-market:language fipa-sl)

Page 4: Lect6-An introduction to ontologies and ontology development

What Is An Ontology (I)

Tom Gruber:Short answer: An ontology is a specification of a conceptualizationLong answer: […] an ontology is a description (like a formal specification of a program) of the concepts and relationships that can exist in a given domain of discourse for an agent or a community of agents

Page 5: Lect6-An introduction to ontologies and ontology development

What Is An Ontology (II)

An ontology is an explicit description of a domainconceptsproperties and attributes of conceptsrestrictions on properties and attributesindividuals (often, but not always)

An ontology defines a common vocabularya shared understanding of a domain among a set of agents

Page 6: Lect6-An introduction to ontologies and ontology development

Why Develop an Ontology?

To share a common understanding of the structure of information

among peopleamong software agents

To make domain assumptions explicitTo enable reuse of domain knowledge

to avoid “re-inventing the wheel”to introduce standards to allow interoperability

Page 7: Lect6-An introduction to ontologies and ontology development

Ontology components

ConceptsDisease, Treatment, Symptom

Properties and attributes of conceptsCauses, OccursIn, Receives

Restrictions on properties and attributesCancer always Receives Radiotherapy

Individuals (often, but not always)“John Smith’s cough” is a particular Symptom

Page 8: Lect6-An introduction to ontologies and ontology development
Page 9: Lect6-An introduction to ontologies and ontology development

What Is “Ontology Engineering”?

Defining concepts in the domain (classes)Arranging the concepts in a hierarchy (subclass-superclass hierarchy)Defining attributes and properties that classes can have and restrictions on their valuesDefining individuals and filling in property values

Page 10: Lect6-An introduction to ontologies and ontology development

Size and scope of an ontologyTwo extremes (the reality is usually something in between):

One huge ontology that captures "everything“ in the domainOne (small) ontology for each specific application

O

A A

A

A

A

A

A

A A

A

A

A

A

A

O O

O

O

O

O O

Page 11: Lect6-An introduction to ontologies and ontology development

"One large ontology" approach (I)

BenefitsFew or no internal inconsistenciesEasier to find for an application developerUniform documentationLess overlapping work!

Page 12: Lect6-An introduction to ontologies and ontology development

"One large ontology" approach (II)Drawbacks

Who maintains it?Who is responsible?Heavy and slow to use (both for human users and for applications)Difficult to take into account everybody's opinions and wishes at design time and when updatingDifficult and expensive construction

Page 13: Lect6-An introduction to ontologies and ontology development

Example: Unified Medical Language System (UMLS)

MetathesaurusOver 1 million biomedical conceptsIntegrates 100 vocabularies and classification systems

ICD-10: International classification of diseases (more than 12400 codes)MeSH: Medical Subjects Headings (more than 25,000 descriptors)LOINC: Logical Observation Identifiers Names and Codes (58,000 observation terms)SNOMED CT: Systematized Nomenclature of Medicine -- Clinical Terms (over 1 million medical concepts)

Page 14: Lect6-An introduction to ontologies and ontology development

"Several small ontologies" approach (I)

BenefitsOntologies fit perfectly the application demandsSmaller, and thus faster to useEasier to understand and to form the complete picture of an ontology (fewer concepts and interrelations)

Page 15: Lect6-An introduction to ontologies and ontology development

"Several small ontologies" approach (II)

DrawbacksDifferent ontologies do not fit together without either

central coordination body, orontology alignment software

Overlapping work - same concepts defined in multiple ontologies, either in the same way or (even worse!) differentlyApplication developers have to choose between multiple incomplete options

Page 16: Lect6-An introduction to ontologies and ontology development

Basic example of ontology alignment

Page 17: Lect6-An introduction to ontologies and ontology development

Some mixed approaches

O

A

A

AA

A

O

O

O

O

Oupperontology

A

A

AA

A

O O

O

OO

OO

O

domains

O

AA

A

A

A

A

AO

MO

mediatingsoftware

A

A

A

AA

A

A

none

Page 18: Lect6-An introduction to ontologies and ontology development

Importance in MAS (I)Agent-systems are typically distributed systems

There is certainly the possibility of being able to access different domain ontologies

Agent-systems consisting of a single agent are rare and often not useful

Agents typically need to communicate with each otherAgents should understand each other

Page 19: Lect6-An introduction to ontologies and ontology development

Importance in MAS (II)

People often design and implement agents independently, unaware of other developers working in the same domain

Agents' understanding of each other is mostly based on ontologies

Page 20: Lect6-An introduction to ontologies and ontology development

Usual alternatives (I)

Single, common ontologyUses:

MAS developed by a unique group[Practical exercise]Well-structured domainwith a jointly agreed standard vocabulary[Medicine]

O

A A

A

A

A

A

A

Page 21: Lect6-An introduction to ontologies and ontology development

Usual alternatives (II)

Common core ontology (e.g. high level ontologies like WordNet) complemented with especialised lower-level classes and instances locally by each agent

O

A

A

AA

A

O

O

O

O

O

Page 22: Lect6-An introduction to ontologies and ontology development

Usual alternatives (III)

Application that maps the concepts and relationships in different partial domain ontologies

Usually quite complex, and with human supervisionUnion of previous MASs

O

AA

A

A

A

A

A

O

MO

Page 23: Lect6-An introduction to ontologies and ontology development

Outline of the lecture

OntologiesDefinitionComponentsUse in MAS

OWL: Web Ontology LanguageA method for ontology development

Page 24: Lect6-An introduction to ontologies and ontology development

Representation of ontologies

Languages: RDF, DAML, OIL, OWLTools to edit ontologies:

ProtégéOilEdOntoEdit

Page 25: Lect6-An introduction to ontologies and ontology development
Page 26: Lect6-An introduction to ontologies and ontology development
Page 27: Lect6-An introduction to ontologies and ontology development
Page 28: Lect6-An introduction to ontologies and ontology development
Page 29: Lect6-An introduction to ontologies and ontology development

OWL: Web Ontology Language

The newest ontology representation languageSince October 2009, OWL2

Standard worldwide notationDesigned to bring semantic content to the Web (Semantic Web)WebOnt group developed the OWL formalism

OWL language now a W3C recommendationhttp://www.w3.org/TR/2009/REC-owl2-quick-reference-20091027/ OWL2 Quick Reference Guide (October 2009)

Page 30: Lect6-An introduction to ontologies and ontology development

OWL: Language components

RDF Schemas FeaturesEquality and InequalityProperty CharacteristicsProperty RestrictionsLogical Operators

Page 31: Lect6-An introduction to ontologies and ontology development

RDF Schemas Features

They define basic ontological componentsClassesSubclassesIndividualsPropertiesSubpropertiesDomainRange

Page 32: Lect6-An introduction to ontologies and ontology development

Classes

Classes are sets of individuals with common characteristicsA Class should be described such that it is possible for it to contain IndividualsClasses that cannot possibly contain any individuals are said to be inconsistentEg: Disorder, Patient, Treatment, Symptom

Page 33: Lect6-An introduction to ontologies and ontology development

Subclasses

Define class specializations by constraining their coverage Ex: Breast Cancer is a subclass of CancerClass hierarchies can be specified by making one or more statements that a class is a subclass of another class

Page 34: Lect6-An introduction to ontologies and ontology development
Page 35: Lect6-An introduction to ontologies and ontology development

Individuals (Instances)

Individuals are the specific objects in the domainIndividuals may be (and are likely to be) members of multiple ClassesEx. St_Johns_Hospital, Peter_Smith_disorder

Page 36: Lect6-An introduction to ontologies and ontology development

Properties

Properties can be used to state relationships between individuals or from individuals to data valuesRelationships in OWL are binary

Subject predicate ObjectIndividual a hasProperty Individual bIndividual hasProperty Value

Eg: hasSymptom, isCausedBy, Author

Page 37: Lect6-An introduction to ontologies and ontology development

Property types

Object Property: relates individualsEstablishes a relationship between objects

Datatype Property: relates individuals to data (int, string, float etc)

Can be considered “attributes” of the instanceAnnotation Property: for attaching metadata to classes, individuals or properties

E.g. version, author, comment

Page 38: Lect6-An introduction to ontologies and ontology development

Property examples

Disorder CauseisCausedBy

DisorderhasScientificName

comment

String

Meta-dataDisorder

ObjectProperty

DatatypeProperty

AnnotationProperty

Page 39: Lect6-An introduction to ontologies and ontology development

Built-in datatypes

Basic datatypes:http://www.w3.org/2001/XMLSchema#name

xsd:string, xsd:boolean, xsd:decimal, xsd:float, xsd:double, xsd:dateTime, xsd:time, xsd:date, xsd:gYearMonth, xsd:gYear, xsd:gMonthDay, xsd:gDay, xsd:gMonth, xsd:hexBinary, xsd:base64Binary, xsd:anyURI, xsd:normalizedString, xsd:token, xsd:language, xsd:NMTOKEN, xsd:Name, xsd:NCName, xsd:integer, xsd:nonPositiveInteger, xsd:negativeInteger, xsd:long, xsd:int, xsd:short, xsd:byte, xsd:nonNegativeInteger, xsd:unsignedLong, xsd:unsignedInt, xsd:unsignedShort, xsd:unsignedByte and xsd:positiveInteger.

Page 40: Lect6-An introduction to ontologies and ontology development

Sub Properties

Defines properties specializations by constraining their coverageMake hierarchies from one or more statements that a property is a subproperty of one or more other properties Ex. hasScientificName is a subPropertyOf hasName

Page 41: Lect6-An introduction to ontologies and ontology development

Domain

It indicates the individuals to which the property should be applied

If a property relates an individual A to another individual B, and the property has a class C as its domain, then the individual A must belong to class C

Ex. hasSymptom has the domain Disorder

X hasSymptom Y X is a Disorder

Page 42: Lect6-An introduction to ontologies and ontology development

Range

It indicates the individuals to which the property should be applied

If a property relates an individual A to another individual B, and the property has class C as its range, then the individual B must belong to class C

Ex. hasSymptom has a range of SymptomX hasSymptom Y Y is a Symptom

Page 43: Lect6-An introduction to ontologies and ontology development

Equality and InequalityOWL terms that allow expressing equalitiesand inequalities between ontological components

EquivalentClass: two classes are equivalentEquivalentProperty: two properties are equivalentSameIndividualAs: different names that refer to the same individualDifferentFrom: two individuals are differentAllDifferent: all members of a list are distinct and pairwise disjoint

Page 44: Lect6-An introduction to ontologies and ontology development

Property Characteristics

They define the semantics of propertiesInverseProperty: one property is the inverse of anotherTransitiveProperty: the property is transitiveSymmetricProperty: the property is symmetricFunctionalProperty: the property has a unique valueInverseFunctionalProperty: The inverse of the property is functional

Page 45: Lect6-An introduction to ontologies and ontology development

Property Restrictions (I)

Define some constraints on the use of properties

AllValuesFrom: all the values in the range of a property belong to a given class

Cancer isTreatedWith [AllValuesFrom Radiotherapy]SomeValuesFrom: at least one value in the range of a property belongs to a given class

Flu hasSymptom [SomeValuesFrom Fever]

Page 46: Lect6-An introduction to ontologies and ontology development

Property Restrictions (II)

MinCardinality, MaxCardinality: minimum/maximum number of individuals to whom you can be related with a certain property

Page 47: Lect6-An introduction to ontologies and ontology development

Logical Operators (I)

Define classes out of other classesIntersectionOf

Tuberculosis_Symptoms = Fever IntersectionOf Coughing_Blood

UnionOfFlu_Symptoms = Fever UnionOf Vomit

ComplementOfStandardDisorder = ComplementOf ContagiousDisorder

Page 48: Lect6-An introduction to ontologies and ontology development

Logical Operators (II)

DisjointWith: two classes are disjointSymptom DisjointWith Cause

OneOf: defines a class by enumerating all the individuals that belong to it

Hospitals is OneOf {University-Hospital}, {St_John}, {City-Clinic}

Page 49: Lect6-An introduction to ontologies and ontology development

OWL -

Conclusions

OWL is a language for representing ontologies, which extends frame languagesOWL has a rich set of featuresThere exist reasoners to check the consistency of an ontologyBefore building a knowledge base (ontology) an study of the domain is required (in order to determine constraints, relationships and incompatibilities)

Page 50: Lect6-An introduction to ontologies and ontology development

Outline of the lecture

OntologiesDefinitionComponentsUse in MAS

OWL: Web Ontology LanguageA method for ontology development

Page 51: Lect6-An introduction to ontologies and ontology development

Ontology Development Process

In this talk:

determine scope

consider reuse

enumerateterms

define classes

define properties

define restrictions

create instances

In reality - an iterative process:determine

scopeconsider

reuseenumerate

termsdefine

classesconsider

reuseenumerate

termsdefine

classes

define properties

create instances

define classes

define properties

define restrictions

create instances

define classes

consider reuse

define properties

define restrictions

create instances

Page 52: Lect6-An introduction to ontologies and ontology development

General golden rules

There is not one ‘correct’ way to model a domain

There are always different structuring possibilities

Ontology development is necessarily an iterative processConcepts in the ontology should be close to (physical or logical) objects –nouns- and relationships –verbs- in the domain of interest

Page 53: Lect6-An introduction to ontologies and ontology development

I-Determine Domain and Scope

Goal: limit the scope of the modelWhat is the domain that the ontology will cover?For what are we going to use the ontology?To what types of questions (competency questions) should the information in the ontology provide answers? Who will use and maintain the ontology?

Answers to these questions may change during the lifecycle

determine scope

consider reuse

enumerateterms

define classes

define properties

define restrictions

create instances

Page 54: Lect6-An introduction to ontologies and ontology development

Limiting the scope

An ontology should not contain all the possible information about the domain

No need to specialize or generalize more than the application requiresNo need to include all the possible properties of a class

Only the most relevant propertiesOnly the properties that the application requires

Page 55: Lect6-An introduction to ontologies and ontology development

Competency Questions

Incremental explicit list of questions that the final ontology knowledge base should be able to answer

Is cancer contagious or not?Which symptoms define the flu disorder?Which are the causes of hypertension?Which treatment should I apply for a patient that is allergic to penicillin and has flu?

Page 56: Lect6-An introduction to ontologies and ontology development

II-Consider Reuse

Why reuse other ontologies?To avoid repeating the workTo interact with the tools that use other ontologiesTo use ontologies that have been validated through use in previous applicationsTo make the final knowledge base compatible with predefined standards (e.g. MeSH, UMLS)

determine scope

consider reuse

enumerateterms

define classes

define properties

define restrictions

create instances

Page 57: Lect6-An introduction to ontologies and ontology development

What to Reuse?Domain-specific standard terminology

Unified Medical Language System (UMLS)MeSH, ICD10

Page 58: Lect6-An introduction to ontologies and ontology development

Example: Gene Ontology

Page 59: Lect6-An introduction to ontologies and ontology development

III-Enumerate Important Terms

Goal: build a complete list of terms in the delimited scope. Are they the appropriate ones to answer all the Competency Questions?

Which are the terms we need to talk about?What do we want to say about the terms?

Make a comprehensive list of the terms without considering (here) the overlap between concepts they represent, relations among terms, or whether the concepts are classes or properties

consider reuse

determine scope

enumerateterms

define classes

define properties

define restrictions

create instances

Page 60: Lect6-An introduction to ontologies and ontology development

Enumerating Terms – Medical Ontology

Disorder, symptom, treatment, cause, …Disorder contagiousness, disorder scientific

name, disorder standard code, …Cancer, blood disorder, flu, hepatitis, …Fever, icterus, vomit, cough, …

Page 61: Lect6-An introduction to ontologies and ontology development

IV-Define Classes and a Class Hierarchy

Goal: find out in the list of terms those which represent concepts in the domainA class is a concept in the domain

A class of DisordersA class of SymptomsA class of Cancers

A class is a collection of elements with similar propertiesA class can later be instantiated

John’s blood disorder

consider reuse

determine scope

define classes

define properties

define restrictions

create instances

enumerateterms

Page 62: Lect6-An introduction to ontologies and ontology development

Class Inheritance

Classes usually constitute a taxonomic hierarchy (a subclass-superclass hierarchy)An instance of a subclass is an instance of a

superclassIf you think of a class as a set of elements, a subclass is a subset that has a certain common characteristic

Page 63: Lect6-An introduction to ontologies and ontology development

Class Inheritance - Example

Cancer is a subclass of DisorderEvery cancer is a disorder

Lung cancer is a subclass of CancerEvery lung cancer is a cancer

Page 64: Lect6-An introduction to ontologies and ontology development

Levels in the Hierarchy

Page 65: Lect6-An introduction to ontologies and ontology development

Modes of Development

Top-down: define the most general concepts first and then specialize themBottom-up: start with the most specific concepts and then organize them in more general classesCombination: define the more relevant concepts first and then generalize and specialize them as necessary

Page 66: Lect6-An introduction to ontologies and ontology development

Documentation

Classes (and properties) usually have documentation

Describing the class in natural languageListing domain assumptions relevant to the class definitionListing synonymsDifferent labels for different languages

Page 67: Lect6-An introduction to ontologies and ontology development

Some hints

If a class only has one child, there may be a modelling problemIf a class has more than a dozen children, additional subcategories may be necessarySubclasses of a class usually …

have additional propertieshave different restrictionsparticipate in different relationships

Page 68: Lect6-An introduction to ontologies and ontology development

V-Define Properties of Classes

Describe attributes of instances of the class and relations to other instances

[Attributes] For each disorder we want to know its naturallanguage name, its scientific name, its ICD-10 code, etc.

[Relations to other concepts] Each disorder has symptoms, causes, treatments, etc.

consider reuse

determine scope

define restrictions

create instances

enumerateterms

define classes

define properties

Page 69: Lect6-An introduction to ontologies and ontology development

Relationships in a medical ontology

Page 70: Lect6-An introduction to ontologies and ontology development

Properties

Datatype vs Object propertiesDatatype properties (attributes)

Contain primitive values (strings, numbers)Disorder name: stringDisorder scientific name: stringDisorder ICD-10 code: floatDisorder contagiousness: boolean

Object properties (relationships)Contain (or point to) other objects

A syndrome has a set of symptomsA disease can be the cause of a syndromeAn intervention plan is associated with a syndrome

Page 71: Lect6-An introduction to ontologies and ontology development

Property and Class Inheritance

A subclass inherits all the properties from its superclassIf a disorder has a name and a contagiousness, a Flu

disorder also has a name and a contagiousness

If a class has multiple superclasses, it inherits properties from all of themLeukemia is both a Blood disorder and a Cancer

Page 72: Lect6-An introduction to ontologies and ontology development

VI-Property Restrictions

Property restrictions constrain or limit the set of possible values for a propertyThe scientific name of a disorder is a stringThe symptoms of any disorder have to be instances of the

Symptom classA disorder is required to have at least one MeSH code

consider reuse

determine scope

create instances

enumerateterms

define classes

define restrictions

define properties

Page 73: Lect6-An introduction to ontologies and ontology development

Common Restrictions

Cardinality: the number of values a property hasValue type: the type of values a property hasMinimum and maximum value: a range of values for a numeric propertyDefault value: the value a property has unless explicitly specified otherwise

Page 74: Lect6-An introduction to ontologies and ontology development

Domain and Range of a Property

Domain of a property: the class (or classes) that have the property

More precisely: class (or classes) of instances which can have the property

Which are the classes that can use a property?

Range of a property: the class (or classes) to which property values belong

Which are the classes restricting the property possible values?

Page 75: Lect6-An introduction to ontologies and ontology development

Restrictions and Class Inheritance

A subclass inherits all the properties restrictions from its superclassA subclass can override the restrictions to “narrow” the list of allowed values

Make the cardinality range smallerReplace a class in the range with a subclass

Page 76: Lect6-An introduction to ontologies and ontology development

VII-Create Instances (Individuals)

Choose the class of the instance to be createdCreate an instance of a class

The class becomes a direct type of the instanceAny superclass of the direct type is a type of the instance

Assign property values for the instance frameProperty values should conform to the restrictionsKnowledge-acquisition tools often check it

consider reuse

determine scope

create instances

enumerateterms

define classes

define properties

define restrictions

Page 77: Lect6-An introduction to ontologies and ontology development

Extra material in Moodle space

OWL official descriptionLink to Protégé web page