ontologies: introduction, design, languages and tools

Post on 08-May-2015

4.003 Views

Category:

Education

0 Downloads

Preview:

Click to see full reader

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

Ontologies

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

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

SummaryIntroduction to ontologiesOntology “engineering”

ontologies creation processOntology languagesTools for ontologies design

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, …}

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

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

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

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

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

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

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

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

Example of ontology engineering

chairchair

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

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

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

Example of ontology engineering

chairchair seatseat stoolstool benchbench

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

??????

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

chairchair seatseat stoolstool benchbench

Something I can sit on

“sittable”“sittable”

Example of ontology engineering

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

chairchair seatseat stoolstool benchbench

tabletable

Example of ontology engineering

Something I can sit on

“sittable”“sittable”

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

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

Ontology structure

chairchair seatseat stoolstool benchbench

“for_sitting”“for_sitting”

tabletable

“sittable”“sittable”

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

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”

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”

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

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

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

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

Individuals

Also known as “instances”can be concrete objects

animalsmoleculestrees

or abstract objectsnumberswords

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

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”

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

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

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

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

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

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}

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

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

Relationships

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

domain range

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

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

Example

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

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

Ontology languages

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

RDF / RDF Schema

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

RDF Schema example

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)

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

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

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

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

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

Ontology Web Language (OWL)

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

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>

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>

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>

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>

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>

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))

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>

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

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>

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

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>

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>

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>

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”

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

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

OWL class constructors

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

OWL axioms

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

Example of ontology building in OWL with Protégé

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/

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

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

Project steps

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

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

Step 0

Conceptual design of the ontology

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

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

Step 1a

Define classes and subclassesIs-a relationship, or subsumption

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

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

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>

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

Step 1c

Define multipleinheritance

ActivityActivity

AdventureAdventure SightseeingSightseeing

MuseumsMuseumsSafariSafari

BunjeeJumpingBunjeeJumping

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>

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>

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

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

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

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

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

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

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

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

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

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

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

Semantic annotation

Semantic annotation

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

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

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

“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

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

Resource fragmentationIdentifying fragments

StructureXML nestingXHTML sectioningDIV nesting

Visual appearanceLayout reverse-engineeringExploit common usability conventionsDiscard navigation information

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

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

“…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

“…is related to…”

Annotation storageAnnotation creationRDF (ResourceDescriptionFramework)

related xxxxyyxyx

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

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

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

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

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

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

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.

top related