Top Banner
The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License
118

The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

Dec 26, 2015

Download

Documents

Megan Elliott
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

The Semantic Web

2 sessions in the Module INF347at the Eacutecole nationale supeacuterieure des Teacuteleacutecommunications

in ParisFrance in Summer 2011

by Fabian M Suchanek

This document is available under aCreative Commons Attribution Non-Commercial License

2

Organisation

bull 2 sessions (each 15h) on the Semantic Web

bull 15h lab session

bull Web-siteshttpwwwinfresenstfr~danzartINF347

httpsuchanekname Teaching

3

MotivationIn the last class on Information Extraction we saw how to move from unstructured data to structured data

Person

Job

Elvis singer

But even between structured data interaction is difficult

Person

Occupation

Elvis P singer

ltxmlgt ltpersongt ltoccupationgt singer

4

Motivation

Person

Job

Elvis singer

But even between structured data interaction is difficult in particular if the data is in different formats

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

5

Motivation

Person

Job

Elvis singer

But even between structured data interaction is difficult in particular if the data is in different formats on different machines or devices

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

6

Motivation

Person

Job

Elvis singer

But even between structured data interaction is difficult in particular if the data is in different formats on different machines or devices or in different companies

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

7

Use casesExamplesbull Booking a flight Interaction between office computer flight company travel agency shuttle services hotel my calendar

bull Finding a restaurant Interaction between mobile device map service

recommendation service restaurant reservation service

bull Web search Interaction between client search service

Web page content provider

Use cases

8

bull Intelligent home Fridge knows my calendar orders food if I am planning a dinner

bull Intelligent cars Car knows my schedule where and when to get gas how not to hit other cars what are the legal regulations

bull Web service composition Interaction between client and Web services and

Web services themselves

9

MergingExamplesbull Adding data to a database From XML files from other databases

bull Merging data after company mergers (eg Apple buys Microsoft) Different terminology has to be bridged accounts to be merged

bull Merging data in research eg biochemical genetic pharmaceutical research data

(Less exciting but probably more frequent)

10

The Semantic Web

Idea We need an infrastructure that allows computers to ldquounderstandrdquo their data

This infrastructure shallbull allow machines to process data from other machinesbull ensure interoperability between different schemas

devices and organizationsbull allow data to describe databull allow machines to reason on the databull allow machines to answer semantic queries

This is what the Semantic Web aims at

11

The Semantic Web

The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format

hellip we will learn more about this format in a minute

12

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data1935

singer

born

Elvis where are you

born

bull Publish data (RDFa)

Ontology

13

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

Standards produced byor endorsed by theWord Wide Web Consortium(W3C)

represented in Europeby the European Research Consortium for Informatics and Mathematics (ERCIM) with INRIA being a member

14

URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity

Elvis

Elvis

Elvis Presley

15

URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

httpimitatorsorgElvisFG17

httpelvisorgme

httpontocompeoplesingersEP

A URI can take the form of a URL

16

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

76

5

17

NamespaceshttpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

The domain provides a ldquonamespacerdquo ie a range of identifiers that cannot collide with other

identifiers

httpimitatorsorgElvis hellip

httpelvisorgElvis

httpimitatorsorgMadonna

httpholyorgMadonna

18

URI Use Cases

There should be no URI with two meanings

People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs

httpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

19

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

The IANA (Internet Assigned Numbers Authority) operated by ICANN assigns namespaces to specific organizations

The organization then specifies the identifier

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 2: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

2

Organisation

bull 2 sessions (each 15h) on the Semantic Web

bull 15h lab session

bull Web-siteshttpwwwinfresenstfr~danzartINF347

httpsuchanekname Teaching

3

MotivationIn the last class on Information Extraction we saw how to move from unstructured data to structured data

Person

Job

Elvis singer

But even between structured data interaction is difficult

Person

Occupation

Elvis P singer

ltxmlgt ltpersongt ltoccupationgt singer

4

Motivation

Person

Job

Elvis singer

But even between structured data interaction is difficult in particular if the data is in different formats

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

5

Motivation

Person

Job

Elvis singer

But even between structured data interaction is difficult in particular if the data is in different formats on different machines or devices

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

6

Motivation

Person

Job

Elvis singer

But even between structured data interaction is difficult in particular if the data is in different formats on different machines or devices or in different companies

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

7

Use casesExamplesbull Booking a flight Interaction between office computer flight company travel agency shuttle services hotel my calendar

bull Finding a restaurant Interaction between mobile device map service

recommendation service restaurant reservation service

bull Web search Interaction between client search service

Web page content provider

Use cases

8

bull Intelligent home Fridge knows my calendar orders food if I am planning a dinner

bull Intelligent cars Car knows my schedule where and when to get gas how not to hit other cars what are the legal regulations

bull Web service composition Interaction between client and Web services and

Web services themselves

9

MergingExamplesbull Adding data to a database From XML files from other databases

bull Merging data after company mergers (eg Apple buys Microsoft) Different terminology has to be bridged accounts to be merged

bull Merging data in research eg biochemical genetic pharmaceutical research data

(Less exciting but probably more frequent)

10

The Semantic Web

Idea We need an infrastructure that allows computers to ldquounderstandrdquo their data

This infrastructure shallbull allow machines to process data from other machinesbull ensure interoperability between different schemas

devices and organizationsbull allow data to describe databull allow machines to reason on the databull allow machines to answer semantic queries

This is what the Semantic Web aims at

11

The Semantic Web

The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format

hellip we will learn more about this format in a minute

12

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data1935

singer

born

Elvis where are you

born

bull Publish data (RDFa)

Ontology

13

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

Standards produced byor endorsed by theWord Wide Web Consortium(W3C)

represented in Europeby the European Research Consortium for Informatics and Mathematics (ERCIM) with INRIA being a member

14

URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity

Elvis

Elvis

Elvis Presley

15

URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

httpimitatorsorgElvisFG17

httpelvisorgme

httpontocompeoplesingersEP

A URI can take the form of a URL

16

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

76

5

17

NamespaceshttpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

The domain provides a ldquonamespacerdquo ie a range of identifiers that cannot collide with other

identifiers

httpimitatorsorgElvis hellip

httpelvisorgElvis

httpimitatorsorgMadonna

httpholyorgMadonna

18

URI Use Cases

There should be no URI with two meanings

People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs

httpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

19

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

The IANA (Internet Assigned Numbers Authority) operated by ICANN assigns namespaces to specific organizations

The organization then specifies the identifier

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 3: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

3

MotivationIn the last class on Information Extraction we saw how to move from unstructured data to structured data

Person

Job

Elvis singer

But even between structured data interaction is difficult

Person

Occupation

Elvis P singer

ltxmlgt ltpersongt ltoccupationgt singer

4

Motivation

Person

Job

Elvis singer

But even between structured data interaction is difficult in particular if the data is in different formats

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

5

Motivation

Person

Job

Elvis singer

But even between structured data interaction is difficult in particular if the data is in different formats on different machines or devices

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

6

Motivation

Person

Job

Elvis singer

But even between structured data interaction is difficult in particular if the data is in different formats on different machines or devices or in different companies

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

7

Use casesExamplesbull Booking a flight Interaction between office computer flight company travel agency shuttle services hotel my calendar

bull Finding a restaurant Interaction between mobile device map service

recommendation service restaurant reservation service

bull Web search Interaction between client search service

Web page content provider

Use cases

8

bull Intelligent home Fridge knows my calendar orders food if I am planning a dinner

bull Intelligent cars Car knows my schedule where and when to get gas how not to hit other cars what are the legal regulations

bull Web service composition Interaction between client and Web services and

Web services themselves

9

MergingExamplesbull Adding data to a database From XML files from other databases

bull Merging data after company mergers (eg Apple buys Microsoft) Different terminology has to be bridged accounts to be merged

bull Merging data in research eg biochemical genetic pharmaceutical research data

(Less exciting but probably more frequent)

10

The Semantic Web

Idea We need an infrastructure that allows computers to ldquounderstandrdquo their data

This infrastructure shallbull allow machines to process data from other machinesbull ensure interoperability between different schemas

devices and organizationsbull allow data to describe databull allow machines to reason on the databull allow machines to answer semantic queries

This is what the Semantic Web aims at

11

The Semantic Web

The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format

hellip we will learn more about this format in a minute

12

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data1935

singer

born

Elvis where are you

born

bull Publish data (RDFa)

Ontology

13

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

Standards produced byor endorsed by theWord Wide Web Consortium(W3C)

represented in Europeby the European Research Consortium for Informatics and Mathematics (ERCIM) with INRIA being a member

14

URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity

Elvis

Elvis

Elvis Presley

15

URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

httpimitatorsorgElvisFG17

httpelvisorgme

httpontocompeoplesingersEP

A URI can take the form of a URL

16

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

76

5

17

NamespaceshttpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

The domain provides a ldquonamespacerdquo ie a range of identifiers that cannot collide with other

identifiers

httpimitatorsorgElvis hellip

httpelvisorgElvis

httpimitatorsorgMadonna

httpholyorgMadonna

18

URI Use Cases

There should be no URI with two meanings

People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs

httpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

19

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

The IANA (Internet Assigned Numbers Authority) operated by ICANN assigns namespaces to specific organizations

The organization then specifies the identifier

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 4: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

4

Motivation

Person

Job

Elvis singer

But even between structured data interaction is difficult in particular if the data is in different formats

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

5

Motivation

Person

Job

Elvis singer

But even between structured data interaction is difficult in particular if the data is in different formats on different machines or devices

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

6

Motivation

Person

Job

Elvis singer

But even between structured data interaction is difficult in particular if the data is in different formats on different machines or devices or in different companies

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

7

Use casesExamplesbull Booking a flight Interaction between office computer flight company travel agency shuttle services hotel my calendar

bull Finding a restaurant Interaction between mobile device map service

recommendation service restaurant reservation service

bull Web search Interaction between client search service

Web page content provider

Use cases

8

bull Intelligent home Fridge knows my calendar orders food if I am planning a dinner

bull Intelligent cars Car knows my schedule where and when to get gas how not to hit other cars what are the legal regulations

bull Web service composition Interaction between client and Web services and

Web services themselves

9

MergingExamplesbull Adding data to a database From XML files from other databases

bull Merging data after company mergers (eg Apple buys Microsoft) Different terminology has to be bridged accounts to be merged

bull Merging data in research eg biochemical genetic pharmaceutical research data

(Less exciting but probably more frequent)

10

The Semantic Web

Idea We need an infrastructure that allows computers to ldquounderstandrdquo their data

This infrastructure shallbull allow machines to process data from other machinesbull ensure interoperability between different schemas

devices and organizationsbull allow data to describe databull allow machines to reason on the databull allow machines to answer semantic queries

This is what the Semantic Web aims at

11

The Semantic Web

The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format

hellip we will learn more about this format in a minute

12

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data1935

singer

born

Elvis where are you

born

bull Publish data (RDFa)

Ontology

13

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

Standards produced byor endorsed by theWord Wide Web Consortium(W3C)

represented in Europeby the European Research Consortium for Informatics and Mathematics (ERCIM) with INRIA being a member

14

URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity

Elvis

Elvis

Elvis Presley

15

URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

httpimitatorsorgElvisFG17

httpelvisorgme

httpontocompeoplesingersEP

A URI can take the form of a URL

16

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

76

5

17

NamespaceshttpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

The domain provides a ldquonamespacerdquo ie a range of identifiers that cannot collide with other

identifiers

httpimitatorsorgElvis hellip

httpelvisorgElvis

httpimitatorsorgMadonna

httpholyorgMadonna

18

URI Use Cases

There should be no URI with two meanings

People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs

httpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

19

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

The IANA (Internet Assigned Numbers Authority) operated by ICANN assigns namespaces to specific organizations

The organization then specifies the identifier

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 5: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

5

Motivation

Person

Job

Elvis singer

But even between structured data interaction is difficult in particular if the data is in different formats on different machines or devices

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

6

Motivation

Person

Job

Elvis singer

But even between structured data interaction is difficult in particular if the data is in different formats on different machines or devices or in different companies

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

7

Use casesExamplesbull Booking a flight Interaction between office computer flight company travel agency shuttle services hotel my calendar

bull Finding a restaurant Interaction between mobile device map service

recommendation service restaurant reservation service

bull Web search Interaction between client search service

Web page content provider

Use cases

8

bull Intelligent home Fridge knows my calendar orders food if I am planning a dinner

bull Intelligent cars Car knows my schedule where and when to get gas how not to hit other cars what are the legal regulations

bull Web service composition Interaction between client and Web services and

Web services themselves

9

MergingExamplesbull Adding data to a database From XML files from other databases

bull Merging data after company mergers (eg Apple buys Microsoft) Different terminology has to be bridged accounts to be merged

bull Merging data in research eg biochemical genetic pharmaceutical research data

(Less exciting but probably more frequent)

10

The Semantic Web

Idea We need an infrastructure that allows computers to ldquounderstandrdquo their data

This infrastructure shallbull allow machines to process data from other machinesbull ensure interoperability between different schemas

devices and organizationsbull allow data to describe databull allow machines to reason on the databull allow machines to answer semantic queries

This is what the Semantic Web aims at

11

The Semantic Web

The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format

hellip we will learn more about this format in a minute

12

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data1935

singer

born

Elvis where are you

born

bull Publish data (RDFa)

Ontology

13

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

Standards produced byor endorsed by theWord Wide Web Consortium(W3C)

represented in Europeby the European Research Consortium for Informatics and Mathematics (ERCIM) with INRIA being a member

14

URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity

Elvis

Elvis

Elvis Presley

15

URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

httpimitatorsorgElvisFG17

httpelvisorgme

httpontocompeoplesingersEP

A URI can take the form of a URL

16

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

76

5

17

NamespaceshttpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

The domain provides a ldquonamespacerdquo ie a range of identifiers that cannot collide with other

identifiers

httpimitatorsorgElvis hellip

httpelvisorgElvis

httpimitatorsorgMadonna

httpholyorgMadonna

18

URI Use Cases

There should be no URI with two meanings

People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs

httpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

19

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

The IANA (Internet Assigned Numbers Authority) operated by ICANN assigns namespaces to specific organizations

The organization then specifies the identifier

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 6: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

6

Motivation

Person

Job

Elvis singer

But even between structured data interaction is difficult in particular if the data is in different formats on different machines or devices or in different companies

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

7

Use casesExamplesbull Booking a flight Interaction between office computer flight company travel agency shuttle services hotel my calendar

bull Finding a restaurant Interaction between mobile device map service

recommendation service restaurant reservation service

bull Web search Interaction between client search service

Web page content provider

Use cases

8

bull Intelligent home Fridge knows my calendar orders food if I am planning a dinner

bull Intelligent cars Car knows my schedule where and when to get gas how not to hit other cars what are the legal regulations

bull Web service composition Interaction between client and Web services and

Web services themselves

9

MergingExamplesbull Adding data to a database From XML files from other databases

bull Merging data after company mergers (eg Apple buys Microsoft) Different terminology has to be bridged accounts to be merged

bull Merging data in research eg biochemical genetic pharmaceutical research data

(Less exciting but probably more frequent)

10

The Semantic Web

Idea We need an infrastructure that allows computers to ldquounderstandrdquo their data

This infrastructure shallbull allow machines to process data from other machinesbull ensure interoperability between different schemas

devices and organizationsbull allow data to describe databull allow machines to reason on the databull allow machines to answer semantic queries

This is what the Semantic Web aims at

11

The Semantic Web

The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format

hellip we will learn more about this format in a minute

12

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data1935

singer

born

Elvis where are you

born

bull Publish data (RDFa)

Ontology

13

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

Standards produced byor endorsed by theWord Wide Web Consortium(W3C)

represented in Europeby the European Research Consortium for Informatics and Mathematics (ERCIM) with INRIA being a member

14

URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity

Elvis

Elvis

Elvis Presley

15

URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

httpimitatorsorgElvisFG17

httpelvisorgme

httpontocompeoplesingersEP

A URI can take the form of a URL

16

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

76

5

17

NamespaceshttpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

The domain provides a ldquonamespacerdquo ie a range of identifiers that cannot collide with other

identifiers

httpimitatorsorgElvis hellip

httpelvisorgElvis

httpimitatorsorgMadonna

httpholyorgMadonna

18

URI Use Cases

There should be no URI with two meanings

People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs

httpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

19

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

The IANA (Internet Assigned Numbers Authority) operated by ICANN assigns namespaces to specific organizations

The organization then specifies the identifier

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 7: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

7

Use casesExamplesbull Booking a flight Interaction between office computer flight company travel agency shuttle services hotel my calendar

bull Finding a restaurant Interaction between mobile device map service

recommendation service restaurant reservation service

bull Web search Interaction between client search service

Web page content provider

Use cases

8

bull Intelligent home Fridge knows my calendar orders food if I am planning a dinner

bull Intelligent cars Car knows my schedule where and when to get gas how not to hit other cars what are the legal regulations

bull Web service composition Interaction between client and Web services and

Web services themselves

9

MergingExamplesbull Adding data to a database From XML files from other databases

bull Merging data after company mergers (eg Apple buys Microsoft) Different terminology has to be bridged accounts to be merged

bull Merging data in research eg biochemical genetic pharmaceutical research data

(Less exciting but probably more frequent)

10

The Semantic Web

Idea We need an infrastructure that allows computers to ldquounderstandrdquo their data

This infrastructure shallbull allow machines to process data from other machinesbull ensure interoperability between different schemas

devices and organizationsbull allow data to describe databull allow machines to reason on the databull allow machines to answer semantic queries

This is what the Semantic Web aims at

11

The Semantic Web

The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format

hellip we will learn more about this format in a minute

12

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data1935

singer

born

Elvis where are you

born

bull Publish data (RDFa)

Ontology

13

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

Standards produced byor endorsed by theWord Wide Web Consortium(W3C)

represented in Europeby the European Research Consortium for Informatics and Mathematics (ERCIM) with INRIA being a member

14

URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity

Elvis

Elvis

Elvis Presley

15

URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

httpimitatorsorgElvisFG17

httpelvisorgme

httpontocompeoplesingersEP

A URI can take the form of a URL

16

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

76

5

17

NamespaceshttpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

The domain provides a ldquonamespacerdquo ie a range of identifiers that cannot collide with other

identifiers

httpimitatorsorgElvis hellip

httpelvisorgElvis

httpimitatorsorgMadonna

httpholyorgMadonna

18

URI Use Cases

There should be no URI with two meanings

People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs

httpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

19

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

The IANA (Internet Assigned Numbers Authority) operated by ICANN assigns namespaces to specific organizations

The organization then specifies the identifier

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 8: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

Use cases

8

bull Intelligent home Fridge knows my calendar orders food if I am planning a dinner

bull Intelligent cars Car knows my schedule where and when to get gas how not to hit other cars what are the legal regulations

bull Web service composition Interaction between client and Web services and

Web services themselves

9

MergingExamplesbull Adding data to a database From XML files from other databases

bull Merging data after company mergers (eg Apple buys Microsoft) Different terminology has to be bridged accounts to be merged

bull Merging data in research eg biochemical genetic pharmaceutical research data

(Less exciting but probably more frequent)

10

The Semantic Web

Idea We need an infrastructure that allows computers to ldquounderstandrdquo their data

This infrastructure shallbull allow machines to process data from other machinesbull ensure interoperability between different schemas

devices and organizationsbull allow data to describe databull allow machines to reason on the databull allow machines to answer semantic queries

This is what the Semantic Web aims at

11

The Semantic Web

The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format

hellip we will learn more about this format in a minute

12

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data1935

singer

born

Elvis where are you

born

bull Publish data (RDFa)

Ontology

13

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

Standards produced byor endorsed by theWord Wide Web Consortium(W3C)

represented in Europeby the European Research Consortium for Informatics and Mathematics (ERCIM) with INRIA being a member

14

URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity

Elvis

Elvis

Elvis Presley

15

URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

httpimitatorsorgElvisFG17

httpelvisorgme

httpontocompeoplesingersEP

A URI can take the form of a URL

16

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

76

5

17

NamespaceshttpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

The domain provides a ldquonamespacerdquo ie a range of identifiers that cannot collide with other

identifiers

httpimitatorsorgElvis hellip

httpelvisorgElvis

httpimitatorsorgMadonna

httpholyorgMadonna

18

URI Use Cases

There should be no URI with two meanings

People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs

httpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

19

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

The IANA (Internet Assigned Numbers Authority) operated by ICANN assigns namespaces to specific organizations

The organization then specifies the identifier

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 9: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

9

MergingExamplesbull Adding data to a database From XML files from other databases

bull Merging data after company mergers (eg Apple buys Microsoft) Different terminology has to be bridged accounts to be merged

bull Merging data in research eg biochemical genetic pharmaceutical research data

(Less exciting but probably more frequent)

10

The Semantic Web

Idea We need an infrastructure that allows computers to ldquounderstandrdquo their data

This infrastructure shallbull allow machines to process data from other machinesbull ensure interoperability between different schemas

devices and organizationsbull allow data to describe databull allow machines to reason on the databull allow machines to answer semantic queries

This is what the Semantic Web aims at

11

The Semantic Web

The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format

hellip we will learn more about this format in a minute

12

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data1935

singer

born

Elvis where are you

born

bull Publish data (RDFa)

Ontology

13

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

Standards produced byor endorsed by theWord Wide Web Consortium(W3C)

represented in Europeby the European Research Consortium for Informatics and Mathematics (ERCIM) with INRIA being a member

14

URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity

Elvis

Elvis

Elvis Presley

15

URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

httpimitatorsorgElvisFG17

httpelvisorgme

httpontocompeoplesingersEP

A URI can take the form of a URL

16

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

76

5

17

NamespaceshttpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

The domain provides a ldquonamespacerdquo ie a range of identifiers that cannot collide with other

identifiers

httpimitatorsorgElvis hellip

httpelvisorgElvis

httpimitatorsorgMadonna

httpholyorgMadonna

18

URI Use Cases

There should be no URI with two meanings

People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs

httpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

19

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

The IANA (Internet Assigned Numbers Authority) operated by ICANN assigns namespaces to specific organizations

The organization then specifies the identifier

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 10: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

10

The Semantic Web

Idea We need an infrastructure that allows computers to ldquounderstandrdquo their data

This infrastructure shallbull allow machines to process data from other machinesbull ensure interoperability between different schemas

devices and organizationsbull allow data to describe databull allow machines to reason on the databull allow machines to answer semantic queries

This is what the Semantic Web aims at

11

The Semantic Web

The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format

hellip we will learn more about this format in a minute

12

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data1935

singer

born

Elvis where are you

born

bull Publish data (RDFa)

Ontology

13

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

Standards produced byor endorsed by theWord Wide Web Consortium(W3C)

represented in Europeby the European Research Consortium for Informatics and Mathematics (ERCIM) with INRIA being a member

14

URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity

Elvis

Elvis

Elvis Presley

15

URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

httpimitatorsorgElvisFG17

httpelvisorgme

httpontocompeoplesingersEP

A URI can take the form of a URL

16

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

76

5

17

NamespaceshttpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

The domain provides a ldquonamespacerdquo ie a range of identifiers that cannot collide with other

identifiers

httpimitatorsorgElvis hellip

httpelvisorgElvis

httpimitatorsorgMadonna

httpholyorgMadonna

18

URI Use Cases

There should be no URI with two meanings

People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs

httpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

19

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

The IANA (Internet Assigned Numbers Authority) operated by ICANN assigns namespaces to specific organizations

The organization then specifies the identifier

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 11: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

11

The Semantic Web

The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format

hellip we will learn more about this format in a minute

12

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data1935

singer

born

Elvis where are you

born

bull Publish data (RDFa)

Ontology

13

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

Standards produced byor endorsed by theWord Wide Web Consortium(W3C)

represented in Europeby the European Research Consortium for Informatics and Mathematics (ERCIM) with INRIA being a member

14

URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity

Elvis

Elvis

Elvis Presley

15

URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

httpimitatorsorgElvisFG17

httpelvisorgme

httpontocompeoplesingersEP

A URI can take the form of a URL

16

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

76

5

17

NamespaceshttpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

The domain provides a ldquonamespacerdquo ie a range of identifiers that cannot collide with other

identifiers

httpimitatorsorgElvis hellip

httpelvisorgElvis

httpimitatorsorgMadonna

httpholyorgMadonna

18

URI Use Cases

There should be no URI with two meanings

People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs

httpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

19

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

The IANA (Internet Assigned Numbers Authority) operated by ICANN assigns namespaces to specific organizations

The organization then specifies the identifier

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 12: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

12

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data1935

singer

born

Elvis where are you

born

bull Publish data (RDFa)

Ontology

13

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

Standards produced byor endorsed by theWord Wide Web Consortium(W3C)

represented in Europeby the European Research Consortium for Informatics and Mathematics (ERCIM) with INRIA being a member

14

URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity

Elvis

Elvis

Elvis Presley

15

URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

httpimitatorsorgElvisFG17

httpelvisorgme

httpontocompeoplesingersEP

A URI can take the form of a URL

16

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

76

5

17

NamespaceshttpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

The domain provides a ldquonamespacerdquo ie a range of identifiers that cannot collide with other

identifiers

httpimitatorsorgElvis hellip

httpelvisorgElvis

httpimitatorsorgMadonna

httpholyorgMadonna

18

URI Use Cases

There should be no URI with two meanings

People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs

httpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

19

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

The IANA (Internet Assigned Numbers Authority) operated by ICANN assigns namespaces to specific organizations

The organization then specifies the identifier

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 13: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

13

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

Standards produced byor endorsed by theWord Wide Web Consortium(W3C)

represented in Europeby the European Research Consortium for Informatics and Mathematics (ERCIM) with INRIA being a member

14

URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity

Elvis

Elvis

Elvis Presley

15

URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

httpimitatorsorgElvisFG17

httpelvisorgme

httpontocompeoplesingersEP

A URI can take the form of a URL

16

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

76

5

17

NamespaceshttpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

The domain provides a ldquonamespacerdquo ie a range of identifiers that cannot collide with other

identifiers

httpimitatorsorgElvis hellip

httpelvisorgElvis

httpimitatorsorgMadonna

httpholyorgMadonna

18

URI Use Cases

There should be no URI with two meanings

People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs

httpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

19

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

The IANA (Internet Assigned Numbers Authority) operated by ICANN assigns namespaces to specific organizations

The organization then specifies the identifier

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 14: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

14

URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity

Elvis

Elvis

Elvis Presley

15

URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

httpimitatorsorgElvisFG17

httpelvisorgme

httpontocompeoplesingersEP

A URI can take the form of a URL

16

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

76

5

17

NamespaceshttpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

The domain provides a ldquonamespacerdquo ie a range of identifiers that cannot collide with other

identifiers

httpimitatorsorgElvis hellip

httpelvisorgElvis

httpimitatorsorgMadonna

httpholyorgMadonna

18

URI Use Cases

There should be no URI with two meanings

People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs

httpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

19

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

The IANA (Internet Assigned Numbers Authority) operated by ICANN assigns namespaces to specific organizations

The organization then specifies the identifier

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 15: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

15

URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

httpimitatorsorgElvisFG17

httpelvisorgme

httpontocompeoplesingersEP

A URI can take the form of a URL

16

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

76

5

17

NamespaceshttpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

The domain provides a ldquonamespacerdquo ie a range of identifiers that cannot collide with other

identifiers

httpimitatorsorgElvis hellip

httpelvisorgElvis

httpimitatorsorgMadonna

httpholyorgMadonna

18

URI Use Cases

There should be no URI with two meanings

People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs

httpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

19

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

The IANA (Internet Assigned Numbers Authority) operated by ICANN assigns namespaces to specific organizations

The organization then specifies the identifier

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 16: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

16

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

76

5

17

NamespaceshttpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

The domain provides a ldquonamespacerdquo ie a range of identifiers that cannot collide with other

identifiers

httpimitatorsorgElvis hellip

httpelvisorgElvis

httpimitatorsorgMadonna

httpholyorgMadonna

18

URI Use Cases

There should be no URI with two meanings

People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs

httpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

19

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

The IANA (Internet Assigned Numbers Authority) operated by ICANN assigns namespaces to specific organizations

The organization then specifies the identifier

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 17: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

17

NamespaceshttpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

The domain provides a ldquonamespacerdquo ie a range of identifiers that cannot collide with other

identifiers

httpimitatorsorgElvis hellip

httpelvisorgElvis

httpimitatorsorgMadonna

httpholyorgMadonna

18

URI Use Cases

There should be no URI with two meanings

People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs

httpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

19

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

The IANA (Internet Assigned Numbers Authority) operated by ICANN assigns namespaces to specific organizations

The organization then specifies the identifier

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 18: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

18

URI Use Cases

There should be no URI with two meanings

People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs

httpimitatorsorgElvisFG17

World-wide uniquemapping to domain owner

in the responsibilityof the domain owner

19

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

The IANA (Internet Assigned Numbers Authority) operated by ICANN assigns namespaces to specific organizations

The organization then specifies the identifier

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 19: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

19

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

The IANA (Internet Assigned Numbers Authority) operated by ICANN assigns namespaces to specific organizations

The organization then specifies the identifier

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 20: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

20

Example URNsA Uniform Resource Name (URN) is a URI that is globally assigned

A URN takes the form

ldquournrdquo + Namespace + ldquordquo + Identifier

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 21: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

21

Example URNs

bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840

examples arehypothetical

Example

Object IDs identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 22: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

22

UUIDs

bull UUID urnuuid6e8bc430-9c3a-11d9-9669-0800200c9a66

A Universally Unique ID (UUID) is a software-generated string that is globally unique

Computed eg by using bull the MAC address (identifier of the computer)bull plus a timestamp

Example run ifconfig getmac

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 23: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

23

URIs SummaryA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

The goal is to give ldquoall things on Earthrdquo a unique identifier

Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)

URNs URLs

URIs

Propose another real-world domain where we could establish URNs

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 24: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

24

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 25: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

25

RDFThe Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model

An RDF statement (triple) is a triple of 3 URIs calledthe subject the predicate and the object

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 26: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

26

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 27: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

27

RDF Graphs

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

won

Grammy Award

A set of RDF statements is isomorphic to a labeled directed multi-graph which is the notation we will use here

The subject and object of a triple correspond to nodesthe predicate corresponds to directed edge from subject to object with a label given by the predicate

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 28: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

28

Sample RDF Graph Example Elvis in YAGO

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 29: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

29

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 30: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

30

Default Prefix

himself inriawon grammyprize

prefix httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon In the following we assume such a prefix

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 31: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

31

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 32: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

32

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 33: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

33

Event EntitiesAll tabular data can be expressed in RDF

Person

Prize Year

Elvis Grammy Award 1967

GrammyAward

1967

Event42 year

prize

person

Event42

Event entities are artificial entities that representa complex constellation

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 34: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

34

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 35: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

Notation 3

35

Notation 3 (N3) is a concrete syntax for RDF

prefix lthttpinriafrgt prefix elvis lthttpelvisorggt

NatAcademy presents lthttpg-acomprizegt

elvishimself won lthttpg-acomprizegt plays ltguitargt

Qnames or URIs

Same subject can be abbreviated

GrammyAwardwon

NatAcademypresents

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 36: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

RDF XML Syntax

36

RDF can also be stored in XML format

ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3orgnsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt

ltrdfDescription rdfabout=ldquohttpelvisorghimselfrdquogt ltiwon rdfresource=ldquohttpAwardldquo gt ltrdfDescriptiongt

Properties of X are listed inside an rdfDescription about=X

GrammyAwardwon

NatAcademypresents

Namespaces become XML namespaces

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 37: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

RDF Concrete Syntax

37

RDF can also in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 38: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

38

Labels

ldquoElvisrdquo ldquoThe Kingrdquo

rdfslabelrdfslabel

A label is a human-readable name for an entity

Synonymy Two labels share the same entity

Ambiguity One label refers

to different entities

Find 1 example for synonymyand 1 example for ambiguity

Another namespacewhich we will see later

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 39: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

39

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 40: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

40

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 41: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

41

Classes in RDF

person

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 42: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

42

Classes in RDFThe fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )

person

rdfssubclassOf

singer

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 43: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

43

Taxonomy

singer

rdftype

A taxonomy is a hierarchy of classes

person

Resource

rdfssubclassOf

rdfssubclassOf

unemployed

rdftype

theory

abstraction

rdftype

rdfssubclassOf

taxo

nom

yin

stan

ces

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 44: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

44

Taxonomy

singer

rdftype

person

rdfsResource

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

The most general class is rdfsResource ndash everything is a resource

More special class

More general class

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 45: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

45

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

Y is a class if we can say ldquoX is a Yrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything else is an instance (of a particular class)

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 46: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

46

SubclassOf Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfltXsubclassOfYgtltYsubclassOfZgt

ltXsubclassOfZgt

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 47: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

51

RDFS Semantics

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

RDFS specifies 44 entailment rules of the form

If the graph contains these triples

then the graph contains this triple

The entailment rules are appliedrecursively until the graph doesnot change any more

The result is called the deductive closure

rdfssubclassOfrdfsResource

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 48: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

53

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 49: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

54

Storing dataRDF data is usually stored on a server (=internet accessible computer)

gGrammy Award

gPrize

rdftype

gNatAcademy

gpresents

Namespaceg = httpg-acom

prefix g httpg-acom prefix rdf httpwwww3org

gGrammyAward rdftype gAward

gNatAcademy gpresents gGrammyAward

The server at httpg-acom stores

Try this

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 50: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

55

Storing data

The ontology is shown here in the graphical form but it is stored on the server in textual form

Example The YAGO ontology is stored at the server at httpmpiideyago

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 51: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

56

Cool URIsA URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward

but it can be dereferenceable This means that if I access the URL the server responds with an RDF snippet

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

URIs can be ldquoclickedrdquo (followed)

=gt NOT FOUND

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 52: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

57

Cool URIs

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpg-acom

Server at httpelviscom

The RDF graph becomes traversable

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 53: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

58

Wersquore all one GraphIf two RDF graphs share one node they are actually 1 graph

gGrammy Award 1935

esinger

born

gPrize

ewon

rdftype

Namespacee = httpexampleorg

Namespaceg = httpg-acom

A machine can follow the links and retrieve more information in the neighboring ontology

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 54: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

59

Standard VocabularyA number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

dc Dublin Core (predicates for describing documents) httppurlorgdcelements11

foaf Friend Of A Friend (relationships between people) httpxmlnscomfoaf01

cc Creative Commons (types of licences) httpcreativecommonsorgns

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 55: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

60

Standard Vocabulary

Standard vocabulary provided by the W3Cbull type bull subclassOf bull Property bull Classbull labelbull hellip

A number of standard vocabularies have evolved

rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns

rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 56: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

61

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 57: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

62

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermits

Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works

rdftype

Try this

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 58: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

63

Sharing FOAFfoaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01

AllShookUpfoafmadefoafknows

ldquoElvis Presleyrdquofoafname

foafPerson

Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 59: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

64

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 60: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

65

The Goal of OWLRDFS just allows us to define classes and subclasses with very limited inference

Can we go further

bull Reasoning If X is left of Y and Y is left of Z then X is left of Zbull Class definitions The class of husbands is the class of married menbull Class properties People and tables are two disjoint classes

Goal of the Web Ontology Language(OWL)

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 61: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

66

OWL VocabularyOWL is a namespace that defines predicates with certain semantic rules

Man

Father

Parent

listowlIntersectionOf

rdftypeX rdftype CC owlintersectionOf LISTLIST hasElement Z

X rdftype Z

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 62: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

67

OWL UndecidabilityOWL defines so powerful predicates that it is undecidable

owloneOf

owltwoOf

owlreflexiveIntersectionOf

owlcomplicatedCombinationOf

owlhyperSymmetricProperty

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

The ldquolistrdquo is an RDF list with predicates defined there

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 63: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

68

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

OWL-DL comes with a simplified notationcalled Description Logic

father = parent | | man

This notation is equivalent to the RDF graph representationWe will use the simplified notation now

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 64: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

Intersection

69

X | | Y The class of things that are in both X and Y

father = parent | | malePerson

This corresponds to the First-Order Formula

x father(x) lt= gt parent(x) malePerson(x)

malePerson parent

fath

er

OWL-DL is primarily concerned with describing sets of entities

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 65: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

Union Intersection Negation

70

X | | YX | | Y~X

= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married

= person | | ~(hardRockSinger | | softRockSinger)

person parent hardRockSinger softRockSinger happyPerson marriedPerson malePerson

unmarried-rock-singing-father

non-rock-singing-person

rockSinger = hardRockSinger| | softRockSinger

The class of things that are in X or in YThe class of things that are in both X and YThe class of things that are not in X

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 66: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

71

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

R A predicateroleC a class

has-happy-child = hasChildhappyPerson

E

This corresponds to the First Order Logic formula x has-happy-child(x) lt=gt y hasChild(xy) happyPerson(y)

hasChildhappyPerson

hasChild

hasHappyChild

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 67: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

72

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

has-only-happy-children =

hasChildhappyPerson

A

This corresponds to the First Order Logic formula x has-only-happy-children(x) lt=gt y hasChild(xy) =gt happyPerson(y)

hasChild

hasChild

happyPerson

hasHappyChild

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 68: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

73

RestrictionsRC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

singer-with-happy-child =

singer | | hasChildhappyPerson

singer-with-only-happy-children =

singer | | hasChildhappyPerson

A

E

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 69: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

74

Subclass Assertions

X | Y X is a subclass of Y (everything in X is also in Y)

happysingers| singer | | hasChildhappyPerson

singer | person

This corresponds to the First Order Logic formula x singer(x) =gt person(x)

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 70: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

75

Type Assertionsa C a is of type C (a is in C)

elvis singer | | hasChildhappyPerson

elvis singer

This corresponds to the First Order Logic formula

singer(elvis)

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 71: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

76

Fact Assertions(XY) R X and Y stand in relationship R

(elvislisa) hasChild

This corresponds to hasChild(elvislisa)

(elvispriscilla) marriedTo

This corresponds to marriedTo(elvispriscilla)

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 72: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

77

Exercise

RC The class of things where all R-links lead to a CRC The class of things where there is a R-link to a C

EA

Class constructors

X | | YX | | Y~X

The class of things that are in both X and YThe class of things that are in X or in YThe class of things that are not in X

X | Y

Assertions

X is a subclass of Y (everything in X is also in Y)aC a is a thing in the class C

(ab)R a and b stand in the relation R ie R(ab)

Assume the classes male person happyPerson and the predicates marriedTo hasChild

bull build the class of married peoplebull build the class of people married to at least 1 happy persbull build the class of happy male married peoplebull say that married people are happy

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 73: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

79

Cardinality Restrictionsge n R The class of those who have more than n outgoing R linksle n R The class of those who have less than n outgoing R linkssingers with more than 10 children

singer| | ge 10 hasChild

people with exactly 10 children

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 74: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

80

Entity SetT The class of all things The empty classT

everybody has more than 10 children

ge 10 hasChild | T

nobody has more than 10 children

ge 10 hasChild |

T

People with more than 10 children are not happyPeople whose children are all male are not happy

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 75: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

82

OWL-DLOWL-DL basically reasons about properties such as

bull having a link to an element of a class

ldquoThose that have a female childrdquo

EhasChildfemale

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 76: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

83

OWL-DL

bull having all links of one type leading to a certain class

ldquoThose thathave only femalechildrenrdquo

AhasChildfemale

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 77: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

84

OWL-DL

bull having at most or at least n links of a certain type

ldquoThose thathave more than1 childrdquo

ge 2 hasChild

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 78: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

85

OWL-DL

bull being in two classes at the same time

ldquoThose thathave more than1 child and have only femalechildrenrdquo

ge 2 hasChild AhasChildfemale

X | |Y

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 79: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

86

OWL-DL

elvis hasChildfemale

AhasChildfemale

A

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class

OWL-DL basically reasons about properties such as

bull having a link to an element of a class

bull belonging to such a class

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 80: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

87

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same time

bull having at most or at least n links of a certain type

bull having all links of one type leading to a certain class bull having a link to an element of a class

bull belonging to such a class

OWL-DL basically reasons about properties such as

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 81: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

88

OWL-DLOWL-DL infer properties to make the knowledge baseconsistent

Whatever other children Priscilla has will become girls

AhasChildfemale

(priscilla navarone)hasChildpriscilla hasChildfemale

=gt navaronefemale

This may fail of course

navaronemalemale | | female |

T

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 82: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

89

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 83: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

90

Reasoning Tasks

bull Is one class a subclass of another class

hasChildLisa| singer

E

(Are all parents of Lisa singers)

can be reduced to the consistency problem

(bobLisa) hasChildbob~singer

More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 84: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

91

Reasoning Tasks

bull Is an individual an instance of a class

elvissinger can be reduced to the consistency problem

elvis~singer

More precisely we ask Does it follow necessarily from the KB that Elvis is a singer If so this assertion will cause a contradiction

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 85: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

92

OWL OWL-DL

bull Does an individual have a certain property

elvis singsgoodSongE

can be reduced to the consistency problemelvis ~ singsgoodSong

E

More precisely we ask Does it follow necessarily from the KB that Elvis sings at least one good song If so this assertion will cause a contradiction

bull Is an individual an instance of a class

bull Is one class a subclass of another class

Classical reasoning tasks in OWL-DLbull Is the knowledge base consistent

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 86: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

93

OWL-DL SummaryOWL-DL is a decidable subset of OWL

It is based on the description logic SHOIN(D) a formalism that allows describing properties of objectsin a manner inspired by set theory

A

hasChildfemale

There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 87: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

94

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 88: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

95

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

Find me all the values for loc such that the triple is true

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 89: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

96

SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoonSPARQL queries can be seenas sub-graph matching

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 90: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

97

SPARQL MatchingPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT loc xWHERE x elivesIn loc x rdftype esinger

elivesIn loc

loc = emoonx = eElvis

eGraceland

elivesIn

esinger

rdftype

x

esinger

rdftype

elivesInmoon

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 91: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

99

SPARQL Result SetsPREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt

SELECT xWHERE x elivesIn loc

elivesIn loc

x = ePriscillax = eElvis

eGraceland

elivesIn

esinger

rdftype

xelivesIn

moon

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 92: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

103

SPARQL EndpointsMany ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

httpesww3orgSparqlEndpoints

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 93: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

104

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 94: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

105

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt

SELECT xWHERE x ewon gGrammy

SPARQL borrows concepts from SQL but is specially adapted to distributed RDF graphs

Many ontologies provide ldquoSPARQL endpointsrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 95: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

106

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 96: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

107

Linked Data Problem

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

Many ontologies talk about the same entity with different URIs

This is bad because we cannot join the information

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 97: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

108

Linked Data Solution

1935

guitar

born

DBpedia(httpdbpediaorg )

rdftype

Elvisopedia(httpelvisopediaorg )

singerplays

OWL provides vocabulary to link equivalent entities

httpelvisopediaorgElvis owlsameAs httpdpbediaorgElvis

owlsameAs

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 98: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

109

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 99: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

110

The Linked Data Cloud

Currently (2011) bull 200 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 100: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

111

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 101: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

112

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 102: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

113

And the rest of the Web

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 103: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

114

RDFaRDFa is a W3C standard to annotate HTML pages with RDF data

ltdivgt

Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 104: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

115

RDFa

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Namespace declaration (here a namespace provided by Google)

Everything inside this ltdivgt becomes a node of type vPerson

vPerson

rdftype

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 105: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

116

Naming a node

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

We can also give the URI of the node

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 106: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

117

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

vPerson

rdftype

ldquoMartin Thunderbirdrdquo

vname

Statements are constructed with ldquoproperty=ldquo

Text becomes a string node in RDF

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 107: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

118

RDFa Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorelrdquo + ldquoresourcerdquo become a URI node in RDF

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 108: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

119

RDFa Inverse Statements

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rev=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangtltdivgt

httpmartin

vPerson

rdftype

httpbob-millerorgme vfriend

Links given by ldquorevrdquo become statements in the other direction

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 109: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

120

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt

ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquorelrdquo creates a link between the outer node and the inner node As before typeof

creates a new node

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 110: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

121

Inner Nodes

ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo ltspan rel=vaddressrdquogt ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangt ltspangt ltspangt ltdivgt

httpmartin

vPerson

rdftype

vaddress

vAddress

rdftype

ldquoMemphisrdquo

vlocality

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 111: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

122

RDFa Vocabulary

lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node

which is isomorphic to an RDF graph

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 112: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

123

RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data

bull Grass root appeal(everybody can start annotating pages)

bull No data duplication(all data in one file)

bull Publisher independence (everybody can use his own attributes)

Advantages

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 113: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

124

RDFa ExampleExample with the Ubiquity RDFa parser on this page

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 114: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Facebook amp RDFa

125

ogp Open Graph Protocol httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own namespace

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 115: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

Google amp RDFa

126

Google has defined its own namespace which allows annotating HTML pages with meta-information that will show up in ldquorich snippetsrdquo

Try it out

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 116: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

127

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scraped RDFa and follows owlsameAs(httpsigma)

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 117: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

128

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 118: The Semantic Web 2 sessions in the Module INF347 at the École nationale supérieure des Télécommunications in Paris/France in Summer 2011 by Fabian M. Suchanek.

129

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

  • The Semantic Web
  • Organisation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Motivation (4)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • URIs
  • URIs (2)
  • URIs and URLs
  • Namespaces
  • URI Use Cases
  • URNs
  • Example URNs
  • Example URNs (2)
  • UUIDs
  • URIs Summary
  • The Semantic Web (6)
  • RDF
  • RDF (2)
  • RDF Graphs
  • Sample RDF Graph
  • Namespace Prefixes
  • Default Prefix
  • Tabular Data in RDF
  • Tabular Data in RDF (2)
  • Event Entities
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF Concrete Syntax
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • SubclassOf Semantics
  • RDFS Semantics
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • Cool URIs
  • Cool URIs (2)
  • Wersquore all one Graph
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Sharing FOAF
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • Intersection
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Type Assertions
  • Fact Assertions
  • Exercise
  • Cardinality Restrictions
  • Entity Set
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • OWL-DL (7)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Matching
  • SPARQL Matching (2)
  • SPARQL Result Sets
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • RDFa
  • RDFa (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • RDFa Inverse Statements
  • Inner Nodes
  • Inner Nodes (2)
  • RDFa Vocabulary
  • RDFa Summary
  • RDFa Example
  • Facebook amp RDFa
  • Google amp RDFa
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)