ontologies: introduction, design, languages and tools

106
Ontologies Fulvio Corno, Laura Farinetti Politecnico di Torino Dipartimento di Automatica e Informatica e-Lite Research Group – http://elite.polito.it

Upload: fulvio-corno

Post on 08-May-2015

4.003 views

Category:

Education


0 download

DESCRIPTION

An introduction to ontologies. The OWL ontology web language. Creating simple ontologies with Protégé. Slides for the PhD Course on Semantic Web (http://elite.polito.it/). less

TRANSCRIPT

Page 1: Ontologies: introduction, design, languages and tools

Ontologies

Fulvio Corno, Laura FarinettiPolitecnico di TorinoDipartimento di Automatica e Informaticae-Lite Research Group – http://elite.polito.it

Page 2: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 2

SummaryIntroduction to ontologiesOntology “engineering”

ontologies creation processOntology languagesTools for ontologies design

Page 3: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 3

Semantically rich descriptions to support search

http://dictybase.org/db/html/help/GO.htmlhttp://dictybase.org/db/html/help/GO.html

Topic ={metabolism, …}

Page 4: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 4

OntologiesAn ontology is an explicit description of a domain

conceptsproperties and attributes of conceptsconstraints on properties and attributesindividuals (often, but not always)

An ontology defines a common vocabularya shared understanding

Page 5: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 5

“Ontology engineering”Defining terms in the domain and relations among them

defining concepts in the domain (classes)arranging the concepts in a hierarchy(subclass-superclass hierarchy)defining which attributes and properties (slots) classes can have and constraints on their valuesdefining individuals and filling in slot values

Page 6: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 6

Why develop an ontology?

To share common understanding of the structure of information

among peopleamong software agents

To enable reuse of domain knowledgeto avoid “re-inventing the wheel”to introduce standards to allow interoperability

Page 7: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 7

An ontology

HNC

HND

Certificate

Diploma

Award

2 years

1 year

Is_a

Is_a

Is_a

Is_a

takes

takes

takes

takes

Is_equivalent_to

Page 8: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 8

A more complex ontology[base.Entity]

Person Worker

Faculty Professor

AssistantProfessorAssociateProfessorFullProfessorVisitingProfessor

Lecturer PostDoc

Assistant ResearchAssistantTeachingAssistant

AdministrativeStaffDirector Chair {Professor} Dean {Professor} ClericalStaffSystemsStaff

Student UndergraduateStudentGraduateStudent

Page 9: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 9

A more complex ontologyOrganization

Department School University Program ResearchGroupInstitute

Publication Article

TechnicalReportJournalArticleConferencePaper

UnofficialPublicationBook Software Manual Specification

Work Course Research

Schedule

Page 10: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 10

A more complex ontology

Relation Argument 1 Argument 2 ======================================================publicationAuthor Publication Person publicationDate Publication .DATE publicationResearch Publication Research softwareVersion Software .STRING softwareDocumentation Software Publication teacherOf Faculty Course teachingAssistantOf TeachingAssistant Course takesCourse Student Course age Person .NUMBER emailAddress Person .STRING head Organization PersonundergraduateDegreeFrom Person UniversitymastersDegreeFrom Person UniversitydoctoralDegreeFrom Person University advisor Student Professor subOrganization Organization Organization ………..

Page 11: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 11

Example of ontology engineering

chairchair

Page 12: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 12

Example of ontology engineering

1.A piece of furniture consisting of a seat, legs, back, and oftenarms, designed to accommodate one person.2.A seat of office, authority, or dignity, such as that of a bishop.

a.An office or position of authority, such as a professorship.b.A person who holds an office or a position of authority, such as one who presides over a meeting or administers a department of instruction at a college; a chairperson.

3.The position of a player in an orchestra.4.Slang. The electric chair.5.A seat carried about on poles; a sedan chair.6.Any of several devices that serve to support or secure, such as a metal block that supports and holds railroad track in position.

chairchair

Page 13: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 13

Example of ontology engineering

A piece of furniture consisting of a seat, legs, back, and often arms, designed to accommodate one person.

chairchair

Page 14: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 14

Example of ontology engineering

chairchair seatseat stoolstool benchbench

Page 15: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 15

Example of ontology engineering

Something I can sit on

chairchair seatseat stoolstool benchbench

Something I can sit on

??????

Page 16: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 16

chairchair seatseat stoolstool benchbench

Something I can sit on

“sittable”“sittable”

Example of ontology engineering

Page 17: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 17

chairchair seatseat stoolstool benchbench

tabletable

Example of ontology engineering

Something I can sit on

“sittable”“sittable”

Page 18: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 18

Example of ontology engineering

Something I can sit on

chairchair seatseat stoolstool benchbench

“for_sitting”“for_sitting”

tabletable

“sittable”“sittable”

Something designed for sitting

Page 19: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 19

Ontology structure

chairchair seatseat stoolstool benchbench

“for_sitting”“for_sitting”

tabletable

“sittable”“sittable”

Page 20: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 20

Ingredients

Conceptsshorthand name (internal use)synthetic title (to be displayed)definition (real unambiguous shared definition)

Relationships among conceptsis_aother

Annotations

Page 21: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 21

Concepts

Some piece of furniture that can be used to sit on, either by design or by its shape.

Furniture to sit on

Shorthand name

Synthetic title

Definition“sittable”“sittable”

Page 22: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 22

Internationalization

Some piece of furniture that can be used to sit on, either by design or by its shape.

Furniture to sit on

Shorthand name

Synthetic title

Definition

Furniture to sit onFurniture to sit onFurniture to sit onFurniture to sit onFurniture to sit onFurniture to sit on

Some piece of furniture that can be used to sit on, either by design or by its shape.

Some piece of furniture that can be used to sit on, either by design or by its shape.

Some piece of furniture that can be used to sit on, either by design or by its shape.

Some piece of furniture that can be used to sit on, either by design or by its shape.

Some piece of furniture that can be used to sit on, either by design or by its shape.

Some piece of furniture that can be used to sit on, either by design or by its shape.

“sittable”“sittable”

Page 23: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 23

Relationships

chairchair seatseat stoolstool benchbench

“for_sitting”“for_sitting”

tabletable

“sittable”“sittable”

is_a is_a is_ais_a

is_a

is_a

roomroommaterialmaterial

woodwood

is_a

classroomclassroom

dining roomdining room

is_ais_a

Page 24: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 24

Relationships

chairchair seatseat stoolstool benchbench

“for_sitting”“for_sitting”

tabletable

“sittable”“sittable”

is_a is_a is_ais_a

is_a

is_a

roomroommaterialmaterial

woodwood

is_a

classroomclassroom

dining roomdining room

is_ais_a

made_of

furnished

made_of

Page 25: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 25

Ontology building blocksOntologies generally describe:

Individualsthe basic or “ground level” objects

Classessets, collections, or types of objects

Attributesproperties, features, characteristics, or parameters that objects can have and share

Relationshipsways that objects can be related to one another

Page 26: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 26

Individuals

Also known as “instances”can be concrete objects

animalsmoleculestrees

or abstract objectsnumberswords

Page 27: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 27

ConceptsAlso known as “Classes”

abstract groups, sets, or collections of objectsThey may contain

individualsother classesa combination of both

ExamplesPerson: the class of all peopleVehicle: the class of all vehicles

Page 28: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 28

ConceptsCan be defined extensionally …

By defining every object that falls under the definition of the conceptA class C is extensionally defined if and only if for every class C', if C' has exactly the same members of C, C and C' are identicalE.g.: DayOfWeek = {Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday}

… or intensionallyBy defining the necessary and sufficient conditions for belonging to the conceptE.g.: “bachelor” is an “unmarried man”

Page 29: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 29

Concepts

Defined by Name: any identifier, usually carefully chosenDefinition: describes the well agreed meaning of the concept, in a human readable formTerms (Lexicon): list of terms (synonyms, etc.) usually adopted to identify the concept

Page 30: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 30

SubsumptionA concept (class) can subsume / be subsumed by any other classSubsumption is used to establish class hierarchies

Page 31: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 31

Class partitionA set of related classes and associated rules that allow objects to be placed into the appropriate class

GEOMETRICFIGURE

GEOMETRICFIGURE

GEOMETRICPOINT

GEOMETRICPOINT TWO

DIMENSIONALFIGURE

TWODIMENSIONAL

FIGUREONE

DIMENSIONALFIGURE

ONEDIMENSIONAL

FIGURE

Page 32: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 32

Class partitionDisjoint partition

A disjoint partition rule guarantees that a single instance of a class cannot be in more than one sub-classes E.g. one specific truckcannot be in both 4-axle and6-axle classes

VEHICLEVEHICLE

CARCARTRUCKTRUCK

6-AXLE6-AXLE 4-AXLE4-AXLE

Page 33: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 33

Class partition

Exhaustive partitionevery concrete object in the super-class is an instance of at least one of the partition classes

Page 34: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 34

Attributes

Describe specific featuresCan be complex (e.g.: list of values)Defined for a class/concept (e.g. car)Examples:

number-of-doors: 4number-of-wheels: 4engine: {3.0L,4.0L}

Page 35: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 35

Relationships

Attributes that relate two or more concepts two concepts → binary relationshipthree concepts → ternary relationship

Domainthe concept(s) from which the relationship departs

Rangethe concept(s) to which the relationship applies

Page 36: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 36

Relationships

ExamplesCar(MiniMinor) → individual definitionCar(Mini) → individual definitionSuccessor(Mini,MiniMinor) → relationship

domain range

Page 37: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 37

Commonly used relationshipsSubsumption

the most importantis-superclass-ofusually denoted by its inverse is-a(is-subclass-of)

Meronymyis-part-ofdescribes how object are combined together to form composite objects

Page 38: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 38

Example

http://www.yeastgenome.org/help/GO.htmlhttp://www.yeastgenome.org/help/GO.html

Page 39: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 39

http://www.webology.ir/2006/v3n3/a28.htmlhttp://www.webology.ir/2006/v3n3/a28.html

Ontology alignment

Page 40: Ontologies: introduction, design, languages and tools

Ontology languages

Page 41: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 41

RDF / RDF Schema

Page 42: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 42

RDF Schema example

Page 43: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 43

RDFS problemsRDFS is too “weak” to describe resources with a suitable level of details

range and domain cannot be localized (e.g. the range of hasChild is a person when applied to a person, elephant when applied to an elephant)no constraints on existence or cardinality (e.g. all instances of persons have one and only one mother which is a person, and have exactly two parents)

Page 44: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 44

RDFS problemsit is not possible to define transitive, inverseor symmetrical statements (e.g. part of is a transitive property, hasPart is the inverse of isPartOf, touches is symmetrical)

Reasoning is not well supportedNon standard semantics, no native reasonerexists

Page 45: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 45

Requirements for an ontology language

Extend existing Web standardsXML, RDF, RDFS, ...

Easy to understand and to usebased on well known KR languages

Formally specifiedAdequate expressive powerAutomatic support for reasoning

Page 46: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 46

Stack of Web languages

XML

XOL SHOE OML RDF(S)

OIL

OWL

DAML+OILbioinformatics communitybioinformatics community

University of MarylandUniversity of Maryland

University of WashingtonUniversity of Washington

IST EU project OntoKnowledgeIST EU project OntoKnowledge

W3CW3C

DARPADARPA

Page 47: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 47

Ontology Web Language (OWL)4th level on the semantic web cakeBuilt on top of

XMLRDF/S

Three versionsLiteDL (maps to Description Logic)Full (not fully tractable)

Serializable as XML

Page 48: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 48

Ontology Web Language (OWL)

Page 49: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 49

OWL-DLBased on Description LogicWell defined formal semantics

well defined rules to treat sentence meaningwell defined assumptions on the world being modeled

Well known reasoning/inferencingalgorithms

tractable, conclusions can be derived in finite time

Widely available reasoning systems

Page 50: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 50

Building blocks in OWLOntology declaration (XML syntax)

Ontology metadata (information about the ontology)

<rdf:RDF 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#">

<rdf:RDF 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#">

<owl:Ontology rdf:about=""><rdfs:comment>An example OWL ontology</rdfs:comment><owl:priorVersion

rdf:resource="http://www.mydomain.org/uni-ns-old"/><owl:imports

rdf:resource="http://www.mydomain.org/persons"/><rdfs:label>University Ontology</rdfs:label>

</owl:Ontology>

<owl:Ontology rdf:about=""><rdfs:comment>An example OWL ontology</rdfs:comment><owl:priorVersion

rdf:resource="http://www.mydomain.org/uni-ns-old"/><owl:imports

rdf:resource="http://www.mydomain.org/persons"/><rdfs:label>University Ontology</rdfs:label>

</owl:Ontology>

Page 51: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 51

ClassesEvery class is a descendant of

owl:ThingClasses are defined using

owl:Class

Equivalenceowl:equivalentClass

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

<owl:Class rdf:ID="Car"><owl:equivalentClass rdf:resource="#Automobile"/>

</owl:Class>

<owl:Class rdf:ID="Car"><owl:equivalentClass rdf:resource="#Automobile"/>

</owl:Class>

Page 52: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 52

Subsumption

Provided byowl:subClassOf

<owl:Class rdf:ID="2-Wheel-Drive"><rdfs:subClassOf rdf:resource="#Car"/>

</owl:Class>

<owl:Class rdf:ID="2-Wheel-Drive"><rdfs:subClassOf rdf:resource="#Car"/>

</owl:Class>

Page 53: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 53

Partitions

Disjoint partitionowl:disjointWith

<owl:Class rdf:about="#2-Wheel-Drive"><owl:disjointWith

rdf:resource="#4-Wheel-Drive"/></owl:Class>

<owl:Class rdf:about="#2-Wheel-Drive"><owl:disjointWith

rdf:resource="#4-Wheel-Drive"/></owl:Class>

Page 54: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 54

Partitions

Exhaustive partitionowl:oneOf

<owl:Class rdf:ID="Car"><owl:oneOf rdf:parseType="Collection">

<owl:Thing rdf:about="#2-Wheel-Drive"/><owl:Thing rdf:about="#4-Wheel-Drive"/>

</owl:oneOf></owl:Class>

<owl:Class rdf:ID="Car"><owl:oneOf rdf:parseType="Collection">

<owl:Thing rdf:about="#2-Wheel-Drive"/><owl:Thing rdf:about="#4-Wheel-Drive"/>

</owl:oneOf></owl:Class>

Page 55: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 55

AttributesKnown also as “properties”Datatype properties

Attributes that specify a class features by means of data (XSD datatype)Phone, title, age

Object propertiesAttributes that define relationships between classes (Relations)isTaughtBy(Class(course), Class(professor))

Page 56: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 56

Datatype propertiesAllow to describe a specific aspect of a concept

Based on XSD data typesThe range specifies the data typeThe domain specifies the class to which the property is referred

<owl:DatatypeProperty rdf:ID="age"><rdfs:domain rdf:resource="#Person"/><rdfs:range rdf:resource="http://www.w3.org/2001/

XMLSchema#nonNegativeInteger"/></owl:DatatypeProperty>

<owl:DatatypeProperty rdf:ID="age"><rdfs:domain rdf:resource="#Person"/><rdfs:range rdf:resource="http://www.w3.org/2001/

XMLSchema#nonNegativeInteger"/></owl:DatatypeProperty>

Page 57: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 57

Relationships

Directed From one concept to another, no viceversa

Defined through object propertiesDomain: the class(es) from which the relation departsRange: the relation destination(s)

Subsumption between relationships is possible

Page 58: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 58

Relationships

Example

<owl:ObjectProperty rdf:ID="isTaughtBy"><rdfs:domain rdf:resource="#course"/><rdfs:range rdf:resource="#academicStaffMember"/><rdfs:subPropertyOf rdf:resource="#involves"/>

</owl:ObjectProperty>

<owl:ObjectProperty rdf:ID="isTaughtBy"><rdfs:domain rdf:resource="#course"/><rdfs:range rdf:resource="#academicStaffMember"/><rdfs:subPropertyOf rdf:resource="#involves"/>

</owl:ObjectProperty>

Page 59: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 59

Instances (individuals)No unique name assumption in OWL

If two instances have a different name or ID this does not imply that they are different individualsE.g.: “Queen Elizabeth”, “The Queen” and “Elizabeth Windsor” might all refer to the same individual It must be explicitly stated that individuals are the same as each other, or different to each other

Page 60: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 60

Instances (individuals)Defined by means of

rdf:Description + rdf:Type

<academicStaffMember rdf:ID="949352"><uni:age rdf:datatype="&xsd;integer">

39</uni:age>

</academicStaffMember><rdf:Description rdf:ID="949353">

<rdf:type rdf:resource="#academicStaffMember"/></rdf:Description>

<academicStaffMember rdf:ID="949352"><uni:age rdf:datatype="&xsd;integer">

39</uni:age>

</academicStaffMember><rdf:Description rdf:ID="949353">

<rdf:type rdf:resource="#academicStaffMember"/></rdf:Description>

Page 61: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 61

Advanced constructsOWL supports several advanced constructs to define classes and relationshipsIntensional definition of classes

By defining constraints on attribute values (either object or datatype properties)

<owl:Class rdf:about="#academicStaffMember"><rdfs:subClassOf>

<owl:Restriction><owl:onProperty rdf:resource="#teaches"/><owl:someValuesFrom

rdf:resource="#undergraduateCourse"/></owl:Restriction>

</rdfs:subClassOf></owl:Class>

<owl:Class rdf:about="#academicStaffMember"><rdfs:subClassOf>

<owl:Restriction><owl:onProperty rdf:resource="#teaches"/><owl:someValuesFrom

rdf:resource="#undergraduateCourse"/></owl:Restriction>

</rdfs:subClassOf></owl:Class>

Page 62: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 62

Advanced constructsCardinality

Used to fix the number of instances that can be relatedE.g.: a department should have at least 10 members

<owl:Class rdf:about="#department"><rdfs:subClassOf>

<owl:Restriction><owl:onProperty rdf:resource="#hasMember"/><owl:minCardinality

rdf:datatype="&xsd;nonNegativeInteger"> 10</owl:minCardinality>

</owl:Restriction></rdfs:subClassOf></owl:Class>

<owl:Class rdf:about="#department"><rdfs:subClassOf>

<owl:Restriction><owl:onProperty rdf:resource="#hasMember"/><owl:minCardinality

rdf:datatype="&xsd;nonNegativeInteger"> 10</owl:minCardinality>

</owl:Restriction></rdfs:subClassOf></owl:Class>

Page 63: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 63

Special propertiesowl:TransitiveProperty

defines a transitive property, such as “has better grade than”, “is taller than”, or “is ancestor of”

owl:SymmetricPropertydefines a symmetric property, such as “has same grade as” or “is sibling of”

owl:FunctionalPropertydefines a property that has at most one value for each object, such as “age”, “height”, or “directSupervisor”

Page 64: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 64

Special properties

owl:InverseFunctionalPropertydefines a property for which two different objects cannot have the same valueE.g.: the property “isTheSocialSecurityNumberFor”: a social security number is assigned to one person only

Page 65: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 65

OWL class constructors

Page 66: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 66

OWL axioms

Page 67: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 67

OWL: what for?To build an ontology

define classes and provide information on themdefine properties and provide information on them

To express facts about a domainprovide information on instances (individuals)

To reason about ontologies and factsdiscover consequences of what is expressly stated

Page 68: Ontologies: introduction, design, languages and tools

Example of ontology building in OWL with Protégé

Page 69: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 69

Protégé

Open source ontology editor Developed by Stanford Center for Biomedical Informatics Research at the Stanford University School of Medicinehttp://protege.stanford.edu/

Page 70: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 70

Page 71: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 71

Project steps

0. Conceptual design of the ontology1. Classes definition2. Properties definition3. Individuals definition4. Restrictions definition

Page 72: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 72

Step 0

Conceptual design of the ontology

Page 73: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 73

AccommodationAccommodation

BudgetAccommodation

BudgetAccommodation

Bed&BreakfastBed&Breakfast

HotelHotel

CampingCamping

AccommodationRating

AccommodationRating

ContactContact

DestinationDestination

FamilyDestination

FamilyDestination

QuietDestination

QuietDestination

BeachBeach

BackpackerDestination

BackpackerDestination

ActivityActivity

AdventureAdventure

RelaxationRelaxation

SightseeingSightseeing

SportsSports

MuseumsMuseumsSafariSafari

BunjeeJumpingBunjeeJumping

SunbathingSunbathing

YogaYoga

HikingHiking

SurfingSurfing

OneStarRatingOneStarRating

TwoStarRatingTwoStarRating

ThreeStarRatingThreeStarRating

RiminiRiminiBardonecchiaBardonecchia

CapreraCaprera

GallipoliGallipoli

SheratonSheraton

Luxury HotelLuxury Hotel

int

string

string

string

hasRating

hasAccommodation

hasContact

hasActivity

isOffered

hasZipCode

hasEMail

hasStreet

hasCity

Page 74: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 74

Step 1a

Define classes and subclassesIs-a relationship, or subsumption

Page 75: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 75

AccommodationAccommodation

AccommodationRating

AccommodationRating

ContactContact

DestinationDestination

ActivityActivity

BudgetAccommodation

BudgetAccommodation

Bed&BreakfastBed&Breakfast

HotelHotel

CampingCamping

Luxury HotelLuxury Hotel

FamilyDestination

FamilyDestination

QuietDestination

QuietDestination

BeachBeach

BackpackerDestination

BackpackerDestinationHikingHiking

SurfingSurfing

SunbathingSunbathing

YogaYoga

SafariSafariBunjeeJumpingBunjeeJumping

MuseumsMuseums

AdventureAdventure

RelaxationRelaxation

SightseeingSightseeing

SportsSports

Page 76: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 76

<owl:Class rdf:ID="Camping"><rdfs:subClassOf><owl:Class rdf:ID="Accommodation"/>

</rdfs:subClassOf></owl:Class><owl:Class rdf:ID="BudgetAccommodation"><rdfs:subClassOf rdf:resource="#Accommodation"/>

</owl:Class><owl:Class rdf:ID="BedAndBreakfast"><rdfs:subClassOf rdf:resource="#Accommodation"/>

</owl:Class><owl:Class rdf:ID="LuxuryHotel"><rdfs:subClassOf><owl:Class rdf:ID="Hotel"/>

</rdfs:subClassOf></owl:Class><owl:Class rdf:about="#Hotel"><rdfs:subClassOf rdf:resource="#Accommodation"/>

</owl:Class>

<owl:Class rdf:ID="Camping"><rdfs:subClassOf><owl:Class rdf:ID="Accommodation"/>

</rdfs:subClassOf></owl:Class><owl:Class rdf:ID="BudgetAccommodation"><rdfs:subClassOf rdf:resource="#Accommodation"/>

</owl:Class><owl:Class rdf:ID="BedAndBreakfast"><rdfs:subClassOf rdf:resource="#Accommodation"/>

</owl:Class><owl:Class rdf:ID="LuxuryHotel"><rdfs:subClassOf><owl:Class rdf:ID="Hotel"/>

</rdfs:subClassOf></owl:Class><owl:Class rdf:about="#Hotel"><rdfs:subClassOf rdf:resource="#Accommodation"/>

</owl:Class>

OWL code

Page 77: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 77

Step 1b

Define disjointclasses AccommodationAccommodation

BudgetAccommodation

BudgetAccommodation

Bed&BreakfastBed&Breakfast

HotelHotel

CampingCamping

Disjoint

<owl:Class rdf:about="#Hotel"><owl:disjointWith rdf:resource="#Camping"/><owl:disjointWith><owl:Class rdf:about="#BedAndBreakfast"/>

</owl:disjointWith><rdfs:subClassOf rdf:resource="#Accommodation"/>

</owl:Class>

<owl:Class rdf:about="#Hotel"><owl:disjointWith rdf:resource="#Camping"/><owl:disjointWith><owl:Class rdf:about="#BedAndBreakfast"/>

</owl:disjointWith><rdfs:subClassOf rdf:resource="#Accommodation"/>

</owl:Class>

Page 78: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 78

Step 1c

Define multipleinheritance

ActivityActivity

AdventureAdventure SightseeingSightseeing

MuseumsMuseumsSafariSafari

BunjeeJumpingBunjeeJumping

Page 79: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 79

Step 2a

Define object propertiesrelationships

AccommodationAccommodation

DestinationDestination

hasAccommodation

Range

Domain

<owl:ObjectProperty rdf:ID="hasAccommodation"><rdfs:domain rdf:resource="#Destination"/><rdfs:range rdf:resource="#Accommodation"/>

</owl:ObjectProperty>

<owl:ObjectProperty rdf:ID="hasAccommodation"><rdfs:domain rdf:resource="#Destination"/><rdfs:range rdf:resource="#Accommodation"/>

</owl:ObjectProperty>

Page 80: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 80

Step 2bDefine object properties characteristics

E.g: define an inverse object property

DestinationDestination

ActivityActivity

hasActivity

isOffered

<owl:ObjectProperty rdf:about="#isOffered"><rdfs:range rdf:resource="#Destination"/><owl:inverseOf rdf:resource="#hasActivity"/><rdfs:domain rdf:resource="#Activity"/>

</owl:ObjectProperty>

<owl:ObjectProperty rdf:about="#isOffered"><rdfs:range rdf:resource="#Destination"/><owl:inverseOf rdf:resource="#hasActivity"/><rdfs:domain rdf:resource="#Activity"/>

</owl:ObjectProperty>

Page 81: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 81

Step 2c

Define datatype propertiesThe range specifies thedata type

<owl:DatatypeProperty rdf:ID="hasEMail"><rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/><rdfs:domain rdf:resource="#Contact"/>

</owl:DatatypeProperty><owl:DatatypeProperty rdf:ID="hasZipCode"><rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#int"/><rdfs:domain rdf:resource="#Contact"/>

</owl:DatatypeProperty>

<owl:DatatypeProperty rdf:ID="hasEMail"><rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/><rdfs:domain rdf:resource="#Contact"/>

</owl:DatatypeProperty><owl:DatatypeProperty rdf:ID="hasZipCode"><rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#int"/><rdfs:domain rdf:resource="#Contact"/>

</owl:DatatypeProperty>

ContactContact

int

string

string

hasZipCode

hasEMail

hasStreet

Page 82: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 82

Step 3

Define individualsinstances

<AccommodationRating rdf:ID="OneStarRating"/><AccommodationRating rdf:ID="ThreeStarRating"/><AccommodationRating rdf:ID="TwoStarRating"/><FamilyDestination rdf:ID="Bardonecchia"/><FamilyDestination rdf:ID="Rimini"/>

<AccommodationRating rdf:ID="OneStarRating"/><AccommodationRating rdf:ID="ThreeStarRating"/><AccommodationRating rdf:ID="TwoStarRating"/><FamilyDestination rdf:ID="Bardonecchia"/><FamilyDestination rdf:ID="Rimini"/>

AccommodationRating

AccommodationRating

OneStarRatingOneStarRating

TwoStarRatingTwoStarRating

ThreeStarRatingThreeStarRating

FamilyDestination

FamilyDestination

RiminiRiminiBardonecchiaBardonecchia

Page 83: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 83

Step 4

Define restrictionsTo restrict the individuals that belong to a classQuantifier restrictions (existential, universal quantifiers)Cardinality restrictionshasValue restrictions

Page 84: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 84

Step 4 – example 1

FamilyDestination is a Destination with at least one accommodation and at least 2 activities

Cardinality restriction

Necessary andsufficient condition

AccommodationAccommodation

DestinationDestination

FamilyDestination

FamilyDestination

ActivityActivity

hasAccommodation >= 1

hasActivity >= 2

Page 85: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 85

Step 4 – example 1<owl:Class rdf:ID="FamilyDestination">

<owl:equivalentClass><owl:Class><owl:intersectionOf rdf:parseType="Collection"><owl:Restriction><owl:onProperty><owl:ObjectProperty rdf:ID="hasAccommodation"/>

</owl:onProperty><owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#int">1</owl:minCardinality>

</owl:Restriction><owl:Restriction><owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#int">2</owl:minCardinality><owl:onProperty><owl:ObjectProperty rdf:ID="hasActivity"/>

</owl:onProperty></owl:Restriction><owl:Class rdf:about="#Destination"/>

</owl:intersectionOf></owl:Class>

</owl:equivalentClass></owl:Class>

<owl:Class rdf:ID="FamilyDestination"><owl:equivalentClass><owl:Class><owl:intersectionOf rdf:parseType="Collection"><owl:Restriction><owl:onProperty><owl:ObjectProperty rdf:ID="hasAccommodation"/>

</owl:onProperty><owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#int">1</owl:minCardinality>

</owl:Restriction><owl:Restriction><owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#int">2</owl:minCardinality><owl:onProperty><owl:ObjectProperty rdf:ID="hasActivity"/>

</owl:onProperty></owl:Restriction><owl:Class rdf:about="#Destination"/>

</owl:intersectionOf></owl:Class>

</owl:equivalentClass></owl:Class>

FamilyDestination is a Destination with at least one accommodation and at least 2 activities

FamilyDestination is a Destination with at least one accommodation and at least 2 activities

Page 86: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 86

Step 4 – example 2

QuietDestination is a Destination that is not chosen by noisy families

Complement restriction

DestinationDestination

FamilyDestination

FamilyDestination

QuietDestination

QuietDestination

Page 87: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 87

Step 4 – example 2

<owl:Class rdf:ID="QuietDestination"><owl:equivalentClass><owl:Class><owl:intersectionOf rdf:parseType="Collection"><owl:Class>

<owl:complementOf rdf:resource="#FamilyDestination"/></owl:Class><owl:Class rdf:about="#Destination"/>

</owl:intersectionOf></owl:Class>

</owl:equivalentClass></owl:Class>

<owl:Class rdf:ID="QuietDestination"><owl:equivalentClass><owl:Class><owl:intersectionOf rdf:parseType="Collection"><owl:Class>

<owl:complementOf rdf:resource="#FamilyDestination"/></owl:Class><owl:Class rdf:about="#Destination"/>

</owl:intersectionOf></owl:Class>

</owl:equivalentClass></owl:Class>

QuietDestination is a Destination that is not chosen by noisy families

QuietDestination is a Destination that is not chosen by noisy families

Page 88: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 88

Step 4 – example 3

BudgetAccommodation is an Accommodation that has either one or two star rating

AccommodationAccommodation

BudgetAccommodation

BudgetAccommodation

Bed&BreakfastBed&Breakfast

HotelHotel

CampingCamping

AccommodationRating

AccommodationRating

OneStarRatingOneStarRating

TwoStarRatingTwoStarRating

ThreeStarRatingThreeStarRating

SheratonSheraton

Luxury HotelLuxury Hotel

hasRating

Existential restriction

Page 89: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 89

Step 4 – example 3<owl:Class rdf:ID="BudgetAccommodation"><owl:equivalentClass><owl:Class><owl:intersectionOf rdf:parseType="Collection"><owl:Restriction>

<owl:onProperty><owl:ObjectProperty rdf:ID="hasRating"/>

</owl:onProperty><owl:someValuesFrom><owl:Class>

<owl:oneOf rdf:parseType="Collection"><AccommodationRating rdf:ID="OneStarRating"/><AccommodationRating rdf:ID="TwoStarRating"/>

</owl:oneOf></owl:Class>

</owl:someValuesFrom></owl:Restriction><owl:Class rdf:about="#Accommodation"/>

</owl:intersectionOf></owl:Class>

</owl:equivalentClass></owl:Class>

<owl:Class rdf:ID="BudgetAccommodation"><owl:equivalentClass><owl:Class><owl:intersectionOf rdf:parseType="Collection"><owl:Restriction>

<owl:onProperty><owl:ObjectProperty rdf:ID="hasRating"/>

</owl:onProperty><owl:someValuesFrom><owl:Class>

<owl:oneOf rdf:parseType="Collection"><AccommodationRating rdf:ID="OneStarRating"/><AccommodationRating rdf:ID="TwoStarRating"/>

</owl:oneOf></owl:Class>

</owl:someValuesFrom></owl:Restriction><owl:Class rdf:about="#Accommodation"/>

</owl:intersectionOf></owl:Class>

</owl:equivalentClass></owl:Class>

BudgetAccommodation is an Accommodation that has either one or two star rating

BudgetAccommodation is an Accommodation that has either one or two star rating

Page 90: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 90

Step 4 – example 4BackpackerDestination is a Destination that provides budget accommodation and offers sport or adventure activities

AccommodationAccommodation

BudgetAccommodation

BudgetAccommodation

DestinationDestination

BackpackerDestination

BackpackerDestination

ActivityActivity

AdventureAdventure

SportsSports

hasAccommodation

hasActivity

Bed&BreakfastBed&BreakfastHotelHotel

CampingCamping

RelaxationRelaxation

SightseeingSightseeing

Page 91: Ontologies: introduction, design, languages and tools

F. Corno, L. Farinetti- Politecnico di Torino 91

Step 4 – example 4<owl:Class rdf:ID="BackpackerDestination">

<owl:equivalentClass><owl:Class>

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

<owl:onProperty><owl:ObjectProperty rdf:ID="hasAccommodation"/>

</owl:onProperty><owl:someValuesFrom rdf:resource="#BudgetAccommodation"/>

</owl:Restriction><owl:Class rdf:about="#Destination"/><owl:Restriction>

<owl:onProperty><owl:ObjectProperty rdf:ID="hasActivity"/>

</owl:onProperty><owl:someValuesFrom>

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

<owl:Class rdf:about="#Sports"/><owl:Class rdf:about="#Adventure"/>

</owl:unionOf></owl:Class>

</owl:someValuesFrom></owl:Restriction>

</owl:intersectionOf></owl:Class>

</owl:equivalentClass></owl:Class>

<owl:Class rdf:ID="BackpackerDestination"><owl:equivalentClass>

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

<owl:Restriction><owl:onProperty>

<owl:ObjectProperty rdf:ID="hasAccommodation"/></owl:onProperty><owl:someValuesFrom rdf:resource="#BudgetAccommodation"/>

</owl:Restriction><owl:Class rdf:about="#Destination"/><owl:Restriction>

<owl:onProperty><owl:ObjectProperty rdf:ID="hasActivity"/>

</owl:onProperty><owl:someValuesFrom>

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

<owl:Class rdf:about="#Sports"/><owl:Class rdf:about="#Adventure"/>

</owl:unionOf></owl:Class>

</owl:someValuesFrom></owl:Restriction>

</owl:intersectionOf></owl:Class>

</owl:equivalentClass></owl:Class>

BackpackerDestination is a Destination that provides budget accommodation and offers sport or adventure activities

BackpackerDestination is a Destination that provides budget accommodation and offers sport or adventure activities

Page 92: Ontologies: introduction, design, languages and tools

Semantic annotation

Page 93: Ontologies: introduction, design, languages and tools

Semantic annotation

Explicit representation of a factA given resource......is related to......a given conceptual representation

F. Corno, L. Farinetti- Politecnico di Torino 93

Page 94: Ontologies: introduction, design, languages and tools

Annotation

xxxyxyxyyx xyxyx xyxyxyx xyxyyx yyxyyx

yxyyyx yxxyyx xyyx yxyyyxyx

xyxyyxxy xyx xyyxyx

xyyx xyx yyyxyxyxyyyxyxyyx xyyxyyx

xyxyyx yxy xyyxyx

related

F. Corno, L. Farinetti- Politecnico di Torino 94

Page 95: Ontologies: introduction, design, languages and tools

“A given resource...”

URIURI Content

TextXML / XHTMLMultimedia

Structured documentsFragment

xxxyxyxyyx xyxyx xyxyxyx xyxyyx yyxyyx

yxyyyx yxxyyx xyyx yxyyyxyx

xyxyyxxy xyx xyyxyx

xyyx xyx yyyxyxyxyyyxyxyyx xyyxyyx

xyxyyx yxy xyyxyx

F. Corno, L. Farinetti- Politecnico di Torino 95

Page 96: Ontologies: introduction, design, languages and tools

Resource = fragment

xyxyxyyx xyxyx xyxyxyx xyxyyx yyxyyx

yxyyyx yxxyyx xyyx yxyyyxyx

xyxyyxxy xyx xyyxyx

xyyx xyx yyyxyxyxyyyxyxyyx xyyxyyx

xyxyyx yxy xyyxyx

related

related

related

related

F. Corno, L. Farinetti- Politecnico di Torino 96

Page 97: Ontologies: introduction, design, languages and tools

Resource fragmentationIdentifying fragments

StructureXML nestingXHTML sectioningDIV nesting

Visual appearanceLayout reverse-engineeringExploit common usability conventionsDiscard navigation information

F. Corno, L. Farinetti- Politecnico di Torino 97

Page 98: Ontologies: introduction, design, languages and tools

Pushing fragmentation to the end

Annotate each sentence, or each wordIn this way, we interpret semantics as linguistic semantics (deep semantics)The rest of this presentation favors the interpretation of conceptual semantics(shallow semantics)

F. Corno, L. Farinetti- Politecnico di Torino 98

Page 99: Ontologies: introduction, design, languages and tools

“…to a given conceptual representation”

Identify a suitable conceptual representation of the resourceIs a single concept a suitable representation?

Weighted relationshipsConceptual spectraFuzzy logic…

F. Corno, L. Farinetti- Politecnico di Torino 99

Page 100: Ontologies: introduction, design, languages and tools

“…is related to…”

Annotation storageAnnotation creationRDF (ResourceDescriptionFramework)

related xxxxyyxyx

F. Corno, L. Farinetti- Politecnico di Torino 100

Page 101: Ontologies: introduction, design, languages and tools

Explicit annotation

This is the DREAM of the Semantic WebEach resource is explicitly (manually?) annotated

by the authorby an independent “classifier”

Annotation may refer to different ontologies, and may relate to the resource or to [some of] its fragments

see the Linked Data projectF. Corno, L. Farinetti- Politecnico di Torino 101

Page 102: Ontologies: introduction, design, languages and tools

Automatic annotation

Given a set of resourcesGiven an ontologyGenerate a set of annotations, describing the resources with respect to the ontology concepts

Also called “Information Extraction”

F. Corno, L. Farinetti- Politecnico di Torino 102

Page 103: Ontologies: introduction, design, languages and tools

Automatic annotation creation

Can a concept “know” if a resource is relevant?

The concept name is not relevantThe documents may be in other languages

Bootstrap problem!Need “syntactical” ties with conceptsNeed “semantic” knowledge with resources

F. Corno, L. Farinetti- Politecnico di Torino 103

Page 104: Ontologies: introduction, design, languages and tools

Bootstrap techniques

Provide a set of words / patterns / sequences / rules / … for each concept (and for each language) that “activate” the conceptProvide a set of relevant “real” resourcesclassified on the ontology concepts…depends on the classification algorithm

F. Corno, L. Farinetti- Politecnico di Torino 104

Page 105: Ontologies: introduction, design, languages and tools

Annotation for multimedia

Semantic engines don’t care about resource format (text, video, image, ...)Automatic annotation is well developed and robust for text, only

Text extraction, whenever possible (even if partially)Multimodal approaches to enrich knowledgeUse user experience (Web 2.0)

F. Corno, L. Farinetti- Politecnico di Torino 105

Page 106: Ontologies: introduction, design, languages and tools

License

This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.