63
Introduction to Semantic Web Jose Emilio Labra Gayo University of Oviedo, Spain http://www.di.uniovi.es/~labra

Sem webmaubeuge

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Sem webmaubeuge

Introduction toSemantic Web

Jose Emilio Labra Gayo

University of Oviedo, Spainhttp://www.di.uniovi.es/~labra

Page 2: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

The current Web

Current Web = the biggest repository of information ever compiled by HumanityDesigned for direct human consumption

Lots of information available in:Natural Language in HTML

English, Spanish, Chinese, Italian, etc.

More and More multimediaImages, audio, video, etc.

Too much data, not enough knowledge

Page 3: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

Example of Web PageWhat we see through a

browser

Page 4: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

Source code of a web pageWhat a machine

can see

Page 5: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

Another web pageWhat we see through a

browser

Page 6: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

Source codeWhat a machine

can see

Page 7: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

Difficult queries

Different languages

Multimedia

Combine different travel dataExample: Travel from Oviedo to Rome

Complex questionsExample: Asturian people who play soccer

Page 8: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

The Syntactic Web

Pages and links

University of Oviedo

List of Schools• School of Computer Science Engineering• Faculty of Chemistry• …

School of Computer Science Engineering

General InformationNews…

Faculty of Chemistry

LocationStaff… Location…

……

Staff……

http://www.uniovi.es

http://www.euitio.uniovi.es

http://chemistry.uniovi.es

Unit of information = HTML Page

Links are syntactic = href

href

href

href

href

Page 9: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

The Semantic Web

Data and semantic links

http://euitio.uniovi.es

r:name

School of Computer Engineering

http://uniovi.es

r:contains

r:name University of Oviedor:contains

r:name Faculty of Chemistry

http://chemistry.uniovi.es

r:author

Mary Jordanr:name

23r:age

Unit of information = Data

Links are semantic = Properties identified by URI

Page 10: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

The semantic web

The Semantic Web = Web of Data

A vision of the web where data is published and can be linked with other data

Goals:Reuse data

Automate tasks

Tim Berners Lee, inventor of the WWW

Page 11: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

Features of the Web

Non-centralizedThe information may not be consistent

Dynamic informationData may change (or servers can fail)

Lots of informationThe system cannot try to capture all the data

Open systemMore information can appear in the future

Page 12: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

Towards the Semantic Web

URIUnicode

XML

RDF

Query:SPARQL

RDF Schema

OntologiesOWL

Trust

Dig

ital

Si g

na t

ure

Unifying Logic

RulesRIF

Proof

Semantic web layer cake, by Tim Berners Lee

Page 13: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

RDF

Resource Description Framework (1998)

Description of resourcesResources = entities identified by URI

Binary Relationships between resourcesProperty = global name of the relationship (URI)

Subject Predicate Object

Page 14: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

RDF Triples

SubjectA resource identified by URI

Can also be a blank node (bNode)

PredicateGlobal Property identified by URI

ObjectValue of property

Can be URI, Literal or bNode

Page 15: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

RDF Graph Model

http://euitio.uniovi.es r:name

School of Computer Engineering

r:hasPicturer:subjecthttp://pictures.org/

p1.jpg

r:Building

@prefix r: <http://example.org#> .

<http://euitio.uniovi.es> r:hasPicture <http://pictures.org/p1.jpg>.<http://euitio.uniovi.es> r:name "School of Computer Engineering".<http://pictures.org/p1.jpg> r:subject r:Building .

Can be represented in N-Triples

URIs are usually abbreviated using namespace declarations

Page 16: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

RDF is Compositional

http://euitio.uniovi.es r:name

School of Computer Engineering

r:hasPicturer:subjecthttp://pictures.org/

p1.jpg

r:Building

graph1.rdf

http://euitio.uniovi.es

http://uniovi.es

r:contains

http://chemistry.uniovi.es

r:name

University of Oviedo

r:contains

graph2.rdf

r:hasPicture

http://pictures.org/p2.jpg

r:Building

r:subject

r:name

Faculty of Chemistry

http://chemistry.uniovi.es

graph3.rdf

RDF graphs can be composed

Page 17: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

RDF is Compositional

http://euitio.uniovi.es

r:name

School of Computer Engineering

r:hasPicture

r:subjecthttp://pictures.org/p1.jpg

r:Building

graph1.rdf + graph2.rdf+ graph3.rdf

http://uniovi.es

r:contains

r:name

University of Oviedo

r:contains

r:hasPicture

http://pictures.org/p2.jpg

r:subject

r:nameFaculty of Chemistry

http://chemistry.uniovi.es

RDF graphs can be composed

Page 18: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

Blank Nodes in RDF

Blank nodes are used to identify things that have no URIExample: The author of a web page is a person, not a URI

http://euitio.uniovi.es

r:authorr:name John Smith

r:age23

r:authorr:name Mary Jordan

<http://euitio.uniovi.es> r:author _:1 .<http://euitio.uniovi.es> r:author _:2 ._:1 r:name “John Smith” ._:2 r:age “23”^^xsd:positiveInteger ._:2 r:name “Mary Jordan” .

Blank nodes are represented as _:number in N-Triples

Page 19: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

Tables in RDF

RDF can model relational databasesFirstName LastName Age

John Smith 25

Mary Jordan 23

_:1

John

Smithr:lastName

25_:0

r:firstName

r:ager:nodes

_:2

Mary

Jordan

r:lastName

23

r:firstName

r:age

r:next

Page 20: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

RDF serialization formats

There are several formats to represent RDF data:N3

RDF/XML

N-Triples

Turtle

etc.

Page 21: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

RDF Data

Lots of information is currently published in RDFSome examples:

DBPedia offers RDF triples of more than 80,000 persons, 293,000 places, 62,000 music albums, 36,000 films, etc.

Page 22: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

From Wikipedia to DBPedia

Infoset

Page 23: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

From Wikipedia to DBPedia

Page 24: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

Benefits of RDF

RDF enables better integration of dataTransform the Web from fileserver to database

Linking open dataExpose open datasets in RDF

Set links among the data of those datasets

Set up query endpoints

Altogether billions of triples, millions of links

Page 25: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

Benefits of RDF

Linking open data existing datasets

Page 26: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

RDF Schema

Extends RDF with a Schema vocabularyClass, Property, Resource,…

type, subClassOf, subPropertyOf,…

range, domain,…

RDF Schema enables simple inferences

Page 27: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

RDF Schema

Example

r:Teacher

rdfs:subClassOfr:Person

Meaning:

if x rdf:type r:Teacherthen x rdf:type r:Person

r:hasTeacher

rdfs:ranger:Teacher

Meaning:

if X r:hasTeacher Y then Y rdf:type r:Teacher

Page 28: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

RDFS Inference

http://euitio.uniovi.es

r:hasTeacher

r:name

Jose

r:Teacher

r:Person

rdfs:subClassOf

rdf:typerdf:type

Page 29: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

SPARQL

Simple Protocol and RDF Query LanguageQuery language for the semantic web

Graph matching language

Extracts information from RDF models

A protocolDefines a way of invoking a service

WSDL description file

HTTP and SOAP bindings

It also defines an XML vocabulary for results

Page 30: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

SPARQL

Example

prefix r: <http://example.org#>

select ?n where { ?p r:subject r:Building. ?x r:hasPicture ?p . ?x r:name ?n . }

“Find names of resources who have a picture whose subject is Building”

Page 31: Sem webmaubeuge

SPARQL example

select ?n where { ?p r:subject r:Building. ?x r:hasPicture ?p . ?x r:name ?n . }

http://euitio.uniovi.es

r:name

School of Computer Engineeringr:hasPicture

r:subjecthttp://pictures.org/p1

r:Building

http://uniovi.es

r:contains

r:name

University of Oviedo

r:contains

r:hasPicture

http://pictures.org/p2.

r:subject

r:name

Faculty of Chemistry

http://chemistry.uniovi.es

?x

r:hasPicturer:subject

?p r:Building

?nr:name

School of Computer Engineering

Results

?x

?p

?n

?x

?p

?nFaculty of Chemistry

Page 32: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

SPARQL & Inference

The RDF Graph may be obtained by inference

r:name

Mary Jordan

rdf:type r:Teacher

r:Person

rdfs:subClassOf

select ?n where { ?x rdf:type r:Person. ?x r:name ?n . }

Mary Jordan

Results

rdf:type

Page 33: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

SPARQL

More featuresLimit the number of returned results; remove

duplicates, sort them, …Optional subpatterns (match if possible…)Specify several data sources within the query Construct a graph combining a separate pattern

and the query results, or simply ask whether a pattern matches

Use datatypes and/or language tags when matching a pattern

Page 34: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

Obtaining RDF

SPARQL Endpoints offer an integration mechanismBig RDF datasets accesible to applications

Example: DBPedia

Nowadays Data is mostly in DatabasesIt is not feasible to convert all databases to RDF

More practical to convert on the fly

Several systems: Oracle 11g, Sesame, …

Page 35: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

RDF and HTML

Problems to embed RDF/XML in (x)HTMLIt can be linked from an HTML page

There are some “scrappers” to extract the structure of web pages and dynamically generate RDFCan be a solution for legacy web content

Not very elegant

2 proposals for a more systematic way:GRDDL

RDFa

Page 36: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

GRDDL

<html xmlns="http://www.w3.org/1999/"> <head profile="http://www.w3.org/2003/g/data-view"> <title>University of Oviedo</title> <link rel="transformation" href="http:…/dc-extract.xsl"/> <meta name="DC.author" content=“Mary Jordan"/> ... </head> ... <span class="date">2008-01-02</span> ...</html>

http:…/dc-extract.xsl

page.html

http://www.uniovi.es

2008-01-02

Mary Jordandc:author

dc:date

Page 37: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

RDFa

RDFa defines attributes to add meta-data to HTML elementsSimilar to microformats

<html xmlns:cal="http://www.w3.org/2002/12/cal/ical#"> …<body> <p class="cal:Event" about="#meetingBcn"> I will attend a meeting in <span property="cal:location">Barcelona</span>, on <span property="cal:dtstart" content="20070508T1000+0200"> May 8th at 10am </span> </p> ... </body> </html>

meetingBcn

cal:Event

20070508T1000+0200

Barcelona

rdf:type

cal:location

cal:dtstart

Page 38: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

Ontologies

RDFS does not solve all requirementsApplications need more expressivity and reasoning

In RDFS, it is not possible to create new subclasses

OWL (Web Ontology Language) offers a common language to define ontologies

Page 39: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

What is an Ontology?A model of (some aspect of) the world

Page 40: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

What is an Ontology?A model of (some aspect of) the world

Introduces vocabulary relevant to domain, e.g.:Anatomy

Page 41: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

What is an Ontology?A model of (some aspect of) the world

Introduces vocabulary relevant to domain, e.g.:Anatomy

Cellular biology

Page 42: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

What is an Ontology?A model of (some aspect of) the world

Introduces vocabulary relevant to domain, e.g.:Anatomy

Cellular biology

Aerospace

Page 43: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

What is an Ontology?A model of (some aspect of) the world

Introduces vocabulary relevant to domain, e.g.:Anatomy

Cellular biology

Aerospace

Dogs

Page 44: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

What is an Ontology?A model of (some aspect of) the world

Introduces vocabulary relevant to domain, e.g.:Anatomy

Cellular biology

Aerospace

Dogs

Hotdogs

Page 45: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

What is an Ontology?A model of (some aspect of) the world

Introduces vocabulary relevant to domain

Specifies meaning of termsHeart is a muscular organ thatis part of the circulatory system

Page 46: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

What is an Ontology?A model of (some aspect of) the world

Introduces vocabulary relevant to domain

Specifies meaning of termsHeart is a muscular organ thatis part of the circulatory system

Formalised using suitable logic

Page 47: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

OWL

OWL enables the description of new classesBy enumeration

Through intersection, union, complement

Through property restrictions

It is based on Description LogicsWell defined semantics

A subset of Predicate Logic Limited use of variables

Binary predicates = Properties

Unary predicates = Classes

Page 48: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

OWL: Classes by enumeration

Example: “The European Union is formed by Italy, France, Germany, etc.”

EUCountry = { Italy, France, Germany, … }

#Italy

#EUCountryoneOf

#France

#Germany

Page 49: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

OWL: Set theoretic definitions

Example: A person is a man or a woman

Person = Man Woman

#Man

#PersonunionOf

#Woman

It also has IntersectionOf and complementOf

Page 50: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

OWL: Property restrictions

It is possible to define new classes by restricting the property values of some classReasoner acts as a classifier

Page 51: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

OWL: Property restrictions

Value constraints some () value must be from a class

all () values must be from a class

x (European(x) Person(x) y (hasNationality(x,y) EUCountry(y))

hasNationality(#Sergio, #Italy)Person(#Sergio) inference European(#Sergio)

European Person hasNationality EUCountry

Example: “An european is a person who has nationality from a European Union country”

Page 52: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

OWL: Property restrictions

Cardinality constraints (ie, how many times the property is used on an instance?)exact cardinality

minimum cardinality

maximum cardinality

Person hasFather = 1

x (Person(x) y (hasFather(x,y) z (hasFather(x,z) z = y)))

Page 53: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

OWL: Property characterizations

It is possible to characterize the behaviour of properties: Symmetric, transitive, functional, inverse

functional, …

transitive(isPartOf)

isPartOf(#Rome, #Italy)isPartOf(#Italy, #Europe)

isPartOf(#Rome,#Europe)inference

Page 54: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

OWL: Datatype properties

Properties whose range are typed literals

Example: age

datatypeProperty(#age)range(#age, xsd:positiveInteger)CanVote Person age > “18”

Person(#Sergio)age(#Sergio, 20)

CanVote(#Sergio)inference

Page 55: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

OWL and Unique Name Assumption

Web = Open System2 different URIs could identify the same object

OWL does not support Unique Name Assumption

Person hasFather = 1

hasFather(#Peter, #William)hasFather(#Peter, #Bill)Person(#Peter)

There is no error in the model

It infers that #william and #Bill are the same

Page 56: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

OWL: Open World Assumption

Traditional systems used Closed World Assumption

OWL uses the Open World AssumptionSingleton isMarriedWith PersonMarried isMarriedWith Person

Person(#Peter)Person(#Mary)Person(#James)

isMarriedWith(#Mary,#Peter)Married(#James)

It does not infer: Married(#Peter) Singleton(#Peter)

It infers: Married(#Mary)

It also infers that James …is married with someone… but it does not know with whom

Page 57: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

Conclusions

Semantic Web technologies = ready for deploymentIt is easy to publish something in RDF

There are already huge amounts of data in RDF

Linking to existing ontologies is already possible

Social barriers have to be overcome“Open door” policy

Use standards

Connect to others so others can connect to you

A little semantics can have a lot of impact

Page 58: Sem webmaubeuge

The End

Questions?

More information: http://www.di.uniovi.es/~labra

Page 59: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

About Oviedo

Page 61: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

About the University of Oviedo

Established in 1608 (400 years)

Approx. 25000 students

31 faculties and schools

79 bachelor programmes

35 doctoral programmes

26 master programmes

Page 62: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

About the School of Computing

Established in 1982 1000 students

1200 graduates

Programmes:Bachelor in Software Engineering

Master in Web Engineering

Doctoral programme in Web Engineering

http://www.informatica.uniovi.es

Page 63: Sem webmaubeuge

Jose Emilio Labra Gayo, http://www.di.uniovi.es/~labra

Acknowledgements

Parts of this presentation have been taken from similar presentations by:

Ivan Hermann

Jacco van Ossenbruggen

Nova Spivak

Ian Horrocks