154
The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

Embed Size (px)

Citation preview

Page 1: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

The Semantic Web

Teacuteleacutecom ParisTechSummer 2012

by Fabian M Suchanek

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

2

Organization

bull Lecture 1330-1500

bull Pause 1500-1515

bull Lecture 1515-1645

bull Web site httpsuchaneknameworkteaching

3

Knowledge RepresentationYou have seen different ways to represent knowledge

bull in PROLOG alive(Elvis) is(Elvis alive)

bull in Neural Networks

bull in natural language

ldquoElvis is aliverdquo

bull in XML ltalivegtElvisltalivegt

bull in first order logic x rocksinger(x) =gt alive(x)

A

bull in a mathematical notation elvis εAlive

bull in a database

bull in propositional logic elvis_alive Perso

nStatus

Elvis alive

Now how does it look in real life

4

MotivationIn reality knowledge is represented in many different ways This makes data interaction difficult

Person

Job

Elvis singer

Person

Occupation

Elvis P singer

ltxmlgt ltpersongt ltoccupationgt singer

5

Motivation

Person

Job

Elvis singer

The interaction is particularly difficult if the data resides on different machines or devices

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

6

Motivation

Person

Job

Elvis singer

and even more difficult if the data format stems from 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)

14

Identifying EntitiesWe want to find words for entities that are understoodglobally

Elvis Presley

The King

Le Roi du Rocher et Tourner

Elvis

very difficult

15

Identifying EntitiesEven if we agree for a name for an entitysomeone else may use the name for a different thing

Elvis Presley Elvis Presley

16

URIsA URI is a globally unique identifier for an entity

httpelvisorgElvis httpimitatorscomElvis

We can use eg a URL as a URI

17

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)

httpelvisorgElvis httpimitatorscomElvis

18

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)bull but possibly synonymous (same thing has multiple URIs)

httpelvisorgElvis httpmusiciansorgPresley

19

URIs

httpelvisorgElvis httpmusiciansorgPresley

If two people use different URIs they could be talking about the same thingIf two people use the same URI it is sure that they are talking about the same thing

httpimitatorscomElvis

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 2: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

2

Organization

bull Lecture 1330-1500

bull Pause 1500-1515

bull Lecture 1515-1645

bull Web site httpsuchaneknameworkteaching

3

Knowledge RepresentationYou have seen different ways to represent knowledge

bull in PROLOG alive(Elvis) is(Elvis alive)

bull in Neural Networks

bull in natural language

ldquoElvis is aliverdquo

bull in XML ltalivegtElvisltalivegt

bull in first order logic x rocksinger(x) =gt alive(x)

A

bull in a mathematical notation elvis εAlive

bull in a database

bull in propositional logic elvis_alive Perso

nStatus

Elvis alive

Now how does it look in real life

4

MotivationIn reality knowledge is represented in many different ways This makes data interaction difficult

Person

Job

Elvis singer

Person

Occupation

Elvis P singer

ltxmlgt ltpersongt ltoccupationgt singer

5

Motivation

Person

Job

Elvis singer

The interaction is particularly difficult if the data resides on different machines or devices

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

6

Motivation

Person

Job

Elvis singer

and even more difficult if the data format stems from 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)

14

Identifying EntitiesWe want to find words for entities that are understoodglobally

Elvis Presley

The King

Le Roi du Rocher et Tourner

Elvis

very difficult

15

Identifying EntitiesEven if we agree for a name for an entitysomeone else may use the name for a different thing

Elvis Presley Elvis Presley

16

URIsA URI is a globally unique identifier for an entity

httpelvisorgElvis httpimitatorscomElvis

We can use eg a URL as a URI

17

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)

httpelvisorgElvis httpimitatorscomElvis

18

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)bull but possibly synonymous (same thing has multiple URIs)

httpelvisorgElvis httpmusiciansorgPresley

19

URIs

httpelvisorgElvis httpmusiciansorgPresley

If two people use different URIs they could be talking about the same thingIf two people use the same URI it is sure that they are talking about the same thing

httpimitatorscomElvis

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 3: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

3

Knowledge RepresentationYou have seen different ways to represent knowledge

bull in PROLOG alive(Elvis) is(Elvis alive)

bull in Neural Networks

bull in natural language

ldquoElvis is aliverdquo

bull in XML ltalivegtElvisltalivegt

bull in first order logic x rocksinger(x) =gt alive(x)

A

bull in a mathematical notation elvis εAlive

bull in a database

bull in propositional logic elvis_alive Perso

nStatus

Elvis alive

Now how does it look in real life

4

MotivationIn reality knowledge is represented in many different ways This makes data interaction difficult

Person

Job

Elvis singer

Person

Occupation

Elvis P singer

ltxmlgt ltpersongt ltoccupationgt singer

5

Motivation

Person

Job

Elvis singer

The interaction is particularly difficult if the data resides on different machines or devices

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

6

Motivation

Person

Job

Elvis singer

and even more difficult if the data format stems from 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)

14

Identifying EntitiesWe want to find words for entities that are understoodglobally

Elvis Presley

The King

Le Roi du Rocher et Tourner

Elvis

very difficult

15

Identifying EntitiesEven if we agree for a name for an entitysomeone else may use the name for a different thing

Elvis Presley Elvis Presley

16

URIsA URI is a globally unique identifier for an entity

httpelvisorgElvis httpimitatorscomElvis

We can use eg a URL as a URI

17

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)

httpelvisorgElvis httpimitatorscomElvis

18

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)bull but possibly synonymous (same thing has multiple URIs)

httpelvisorgElvis httpmusiciansorgPresley

19

URIs

httpelvisorgElvis httpmusiciansorgPresley

If two people use different URIs they could be talking about the same thingIf two people use the same URI it is sure that they are talking about the same thing

httpimitatorscomElvis

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 4: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

4

MotivationIn reality knowledge is represented in many different ways This makes data interaction difficult

Person

Job

Elvis singer

Person

Occupation

Elvis P singer

ltxmlgt ltpersongt ltoccupationgt singer

5

Motivation

Person

Job

Elvis singer

The interaction is particularly difficult if the data resides on different machines or devices

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

6

Motivation

Person

Job

Elvis singer

and even more difficult if the data format stems from 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)

14

Identifying EntitiesWe want to find words for entities that are understoodglobally

Elvis Presley

The King

Le Roi du Rocher et Tourner

Elvis

very difficult

15

Identifying EntitiesEven if we agree for a name for an entitysomeone else may use the name for a different thing

Elvis Presley Elvis Presley

16

URIsA URI is a globally unique identifier for an entity

httpelvisorgElvis httpimitatorscomElvis

We can use eg a URL as a URI

17

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)

httpelvisorgElvis httpimitatorscomElvis

18

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)bull but possibly synonymous (same thing has multiple URIs)

httpelvisorgElvis httpmusiciansorgPresley

19

URIs

httpelvisorgElvis httpmusiciansorgPresley

If two people use different URIs they could be talking about the same thingIf two people use the same URI it is sure that they are talking about the same thing

httpimitatorscomElvis

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 5: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

5

Motivation

Person

Job

Elvis singer

The interaction is particularly difficult if the data resides on different machines or devices

ltxmlgt ltpersongt ltoccupationgt singer

Person

Occupation

Elvis P singer

6

Motivation

Person

Job

Elvis singer

and even more difficult if the data format stems from 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)

14

Identifying EntitiesWe want to find words for entities that are understoodglobally

Elvis Presley

The King

Le Roi du Rocher et Tourner

Elvis

very difficult

15

Identifying EntitiesEven if we agree for a name for an entitysomeone else may use the name for a different thing

Elvis Presley Elvis Presley

16

URIsA URI is a globally unique identifier for an entity

httpelvisorgElvis httpimitatorscomElvis

We can use eg a URL as a URI

17

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)

httpelvisorgElvis httpimitatorscomElvis

18

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)bull but possibly synonymous (same thing has multiple URIs)

httpelvisorgElvis httpmusiciansorgPresley

19

URIs

httpelvisorgElvis httpmusiciansorgPresley

If two people use different URIs they could be talking about the same thingIf two people use the same URI it is sure that they are talking about the same thing

httpimitatorscomElvis

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 6: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

6

Motivation

Person

Job

Elvis singer

and even more difficult if the data format stems from 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)

14

Identifying EntitiesWe want to find words for entities that are understoodglobally

Elvis Presley

The King

Le Roi du Rocher et Tourner

Elvis

very difficult

15

Identifying EntitiesEven if we agree for a name for an entitysomeone else may use the name for a different thing

Elvis Presley Elvis Presley

16

URIsA URI is a globally unique identifier for an entity

httpelvisorgElvis httpimitatorscomElvis

We can use eg a URL as a URI

17

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)

httpelvisorgElvis httpimitatorscomElvis

18

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)bull but possibly synonymous (same thing has multiple URIs)

httpelvisorgElvis httpmusiciansorgPresley

19

URIs

httpelvisorgElvis httpmusiciansorgPresley

If two people use different URIs they could be talking about the same thingIf two people use the same URI it is sure that they are talking about the same thing

httpimitatorscomElvis

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 7: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

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)

14

Identifying EntitiesWe want to find words for entities that are understoodglobally

Elvis Presley

The King

Le Roi du Rocher et Tourner

Elvis

very difficult

15

Identifying EntitiesEven if we agree for a name for an entitysomeone else may use the name for a different thing

Elvis Presley Elvis Presley

16

URIsA URI is a globally unique identifier for an entity

httpelvisorgElvis httpimitatorscomElvis

We can use eg a URL as a URI

17

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)

httpelvisorgElvis httpimitatorscomElvis

18

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)bull but possibly synonymous (same thing has multiple URIs)

httpelvisorgElvis httpmusiciansorgPresley

19

URIs

httpelvisorgElvis httpmusiciansorgPresley

If two people use different URIs they could be talking about the same thingIf two people use the same URI it is sure that they are talking about the same thing

httpimitatorscomElvis

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 8: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

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)

14

Identifying EntitiesWe want to find words for entities that are understoodglobally

Elvis Presley

The King

Le Roi du Rocher et Tourner

Elvis

very difficult

15

Identifying EntitiesEven if we agree for a name for an entitysomeone else may use the name for a different thing

Elvis Presley Elvis Presley

16

URIsA URI is a globally unique identifier for an entity

httpelvisorgElvis httpimitatorscomElvis

We can use eg a URL as a URI

17

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)

httpelvisorgElvis httpimitatorscomElvis

18

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)bull but possibly synonymous (same thing has multiple URIs)

httpelvisorgElvis httpmusiciansorgPresley

19

URIs

httpelvisorgElvis httpmusiciansorgPresley

If two people use different URIs they could be talking about the same thingIf two people use the same URI it is sure that they are talking about the same thing

httpimitatorscomElvis

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 9: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

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)

14

Identifying EntitiesWe want to find words for entities that are understoodglobally

Elvis Presley

The King

Le Roi du Rocher et Tourner

Elvis

very difficult

15

Identifying EntitiesEven if we agree for a name for an entitysomeone else may use the name for a different thing

Elvis Presley Elvis Presley

16

URIsA URI is a globally unique identifier for an entity

httpelvisorgElvis httpimitatorscomElvis

We can use eg a URL as a URI

17

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)

httpelvisorgElvis httpimitatorscomElvis

18

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)bull but possibly synonymous (same thing has multiple URIs)

httpelvisorgElvis httpmusiciansorgPresley

19

URIs

httpelvisorgElvis httpmusiciansorgPresley

If two people use different URIs they could be talking about the same thingIf two people use the same URI it is sure that they are talking about the same thing

httpimitatorscomElvis

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 10: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

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)

14

Identifying EntitiesWe want to find words for entities that are understoodglobally

Elvis Presley

The King

Le Roi du Rocher et Tourner

Elvis

very difficult

15

Identifying EntitiesEven if we agree for a name for an entitysomeone else may use the name for a different thing

Elvis Presley Elvis Presley

16

URIsA URI is a globally unique identifier for an entity

httpelvisorgElvis httpimitatorscomElvis

We can use eg a URL as a URI

17

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)

httpelvisorgElvis httpimitatorscomElvis

18

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)bull but possibly synonymous (same thing has multiple URIs)

httpelvisorgElvis httpmusiciansorgPresley

19

URIs

httpelvisorgElvis httpmusiciansorgPresley

If two people use different URIs they could be talking about the same thingIf two people use the same URI it is sure that they are talking about the same thing

httpimitatorscomElvis

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 11: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

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)

14

Identifying EntitiesWe want to find words for entities that are understoodglobally

Elvis Presley

The King

Le Roi du Rocher et Tourner

Elvis

very difficult

15

Identifying EntitiesEven if we agree for a name for an entitysomeone else may use the name for a different thing

Elvis Presley Elvis Presley

16

URIsA URI is a globally unique identifier for an entity

httpelvisorgElvis httpimitatorscomElvis

We can use eg a URL as a URI

17

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)

httpelvisorgElvis httpimitatorscomElvis

18

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)bull but possibly synonymous (same thing has multiple URIs)

httpelvisorgElvis httpmusiciansorgPresley

19

URIs

httpelvisorgElvis httpmusiciansorgPresley

If two people use different URIs they could be talking about the same thingIf two people use the same URI it is sure that they are talking about the same thing

httpimitatorscomElvis

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 12: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

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)

14

Identifying EntitiesWe want to find words for entities that are understoodglobally

Elvis Presley

The King

Le Roi du Rocher et Tourner

Elvis

very difficult

15

Identifying EntitiesEven if we agree for a name for an entitysomeone else may use the name for a different thing

Elvis Presley Elvis Presley

16

URIsA URI is a globally unique identifier for an entity

httpelvisorgElvis httpimitatorscomElvis

We can use eg a URL as a URI

17

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)

httpelvisorgElvis httpimitatorscomElvis

18

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)bull but possibly synonymous (same thing has multiple URIs)

httpelvisorgElvis httpmusiciansorgPresley

19

URIs

httpelvisorgElvis httpmusiciansorgPresley

If two people use different URIs they could be talking about the same thingIf two people use the same URI it is sure that they are talking about the same thing

httpimitatorscomElvis

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 13: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

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)

14

Identifying EntitiesWe want to find words for entities that are understoodglobally

Elvis Presley

The King

Le Roi du Rocher et Tourner

Elvis

very difficult

15

Identifying EntitiesEven if we agree for a name for an entitysomeone else may use the name for a different thing

Elvis Presley Elvis Presley

16

URIsA URI is a globally unique identifier for an entity

httpelvisorgElvis httpimitatorscomElvis

We can use eg a URL as a URI

17

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)

httpelvisorgElvis httpimitatorscomElvis

18

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)bull but possibly synonymous (same thing has multiple URIs)

httpelvisorgElvis httpmusiciansorgPresley

19

URIs

httpelvisorgElvis httpmusiciansorgPresley

If two people use different URIs they could be talking about the same thingIf two people use the same URI it is sure that they are talking about the same thing

httpimitatorscomElvis

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 14: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

14

Identifying EntitiesWe want to find words for entities that are understoodglobally

Elvis Presley

The King

Le Roi du Rocher et Tourner

Elvis

very difficult

15

Identifying EntitiesEven if we agree for a name for an entitysomeone else may use the name for a different thing

Elvis Presley Elvis Presley

16

URIsA URI is a globally unique identifier for an entity

httpelvisorgElvis httpimitatorscomElvis

We can use eg a URL as a URI

17

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)

httpelvisorgElvis httpimitatorscomElvis

18

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)bull but possibly synonymous (same thing has multiple URIs)

httpelvisorgElvis httpmusiciansorgPresley

19

URIs

httpelvisorgElvis httpmusiciansorgPresley

If two people use different URIs they could be talking about the same thingIf two people use the same URI it is sure that they are talking about the same thing

httpimitatorscomElvis

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 15: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

15

Identifying EntitiesEven if we agree for a name for an entitysomeone else may use the name for a different thing

Elvis Presley Elvis Presley

16

URIsA URI is a globally unique identifier for an entity

httpelvisorgElvis httpimitatorscomElvis

We can use eg a URL as a URI

17

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)

httpelvisorgElvis httpimitatorscomElvis

18

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)bull but possibly synonymous (same thing has multiple URIs)

httpelvisorgElvis httpmusiciansorgPresley

19

URIs

httpelvisorgElvis httpmusiciansorgPresley

If two people use different URIs they could be talking about the same thingIf two people use the same URI it is sure that they are talking about the same thing

httpimitatorscomElvis

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 16: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

16

URIsA URI is a globally unique identifier for an entity

httpelvisorgElvis httpimitatorscomElvis

We can use eg a URL as a URI

17

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)

httpelvisorgElvis httpimitatorscomElvis

18

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)bull but possibly synonymous (same thing has multiple URIs)

httpelvisorgElvis httpmusiciansorgPresley

19

URIs

httpelvisorgElvis httpmusiciansorgPresley

If two people use different URIs they could be talking about the same thingIf two people use the same URI it is sure that they are talking about the same thing

httpimitatorscomElvis

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 17: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

17

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)

httpelvisorgElvis httpimitatorscomElvis

18

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)bull but possibly synonymous (same thing has multiple URIs)

httpelvisorgElvis httpmusiciansorgPresley

19

URIs

httpelvisorgElvis httpmusiciansorgPresley

If two people use different URIs they could be talking about the same thingIf two people use the same URI it is sure that they are talking about the same thing

httpimitatorscomElvis

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 18: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

18

URIsA URIs arebull globally unique (the same string is the same identifier)bull unambiguous (the same URI stands for the same thing)bull but possibly synonymous (same thing has multiple URIs)

httpelvisorgElvis httpmusiciansorgPresley

19

URIs

httpelvisorgElvis httpmusiciansorgPresley

If two people use different URIs they could be talking about the same thingIf two people use the same URI it is sure that they are talking about the same thing

httpimitatorscomElvis

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 19: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

19

URIs

httpelvisorgElvis httpmusiciansorgPresley

If two people use different URIs they could be talking about the same thingIf two people use the same URI it is sure that they are talking about the same thing

httpimitatorscomElvis

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 20: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

20

URIs and URLs

httpelvisorgme Identifies the person not Internet-accessible

httpelvisorgindexhtml Identifies a fileInternet-accessible

Age

77

5

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 21: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

21

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

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 22: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

22

Namespaces

httpimitatorsorgElvis

httpelvisorgElvis httpelvisorgPriscilla

httpimitatorsorgMadonna

httpimitatorscom

httpelvisorg

Within his namespace everybody can use the names he wants

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

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

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

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

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

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

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

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

154

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 23: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

23

URI Use Cases

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

24

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

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

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

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

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

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

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

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

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

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

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

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

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

person

singer

49

Classes in RDF

singer

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

rdftype

50

Classes in RDF

rdftype

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

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

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

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

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

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

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

httpg-acomGrammyAward click

73

URIs can be followed

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

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

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

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

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

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

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

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

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

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

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

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

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

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

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

Example at httpdbpedia-liveopenlinkswcomsparql

124

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

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

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

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

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

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

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

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 24: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

24

URNsA Uniform Resource Name (URN) is a URI that is globally assigned

ldquournrdquo + Namespace + ldquordquo + Identifier

A URN takes the following form

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

Object IDs are identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 25: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

25

URN AssignmentStep 1 The IANA (Internet Assigned Numbers Authority)assigns namespaces to specific organizations

Step 2 The organization specifies identifiers for its entities in its namespace

IANA

InternationalStandards Organization

InternationalBankingOrganization

can uselsquoisbnrsquo

can use lsquoswiftrsquo

urnisbn42424242 urnswiftSAN1003

examples arehypothetical

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

Object IDs are identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 26: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

26

Syntax of URNs

urnisbn123456789

Example

Identifier assigned by ISO to a book

Namespace assigned by IANA to the International Standards Organization (ISO)

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

Object IDs are identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 27: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

27

Example URNs

ISBN (Books) urnisbn1234567

ISAN (Journals) urnisan0000-1111-2222-3333-4444

SWIFT (Banks) urnswiftbicBYLADEM1000

examples arehypothetical

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

Object IDs are identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 28: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

28

Example URNs OIDs

OID (Object Ids) urnoid216840

Example

Object IDs are identifiers form one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 29: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

29

Example URNs UUIDs

UUID (Universally unique ids) 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

30

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

31

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 30: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

30

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

31

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 31: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

31

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 32: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

32

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

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 33: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

33

RDF

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

Elvis Presley

identifies identifies

the relationship of winning something

identifies

Grammy Award

ldquoElvis won the Grammy Awardrdquo

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 34: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

34

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

35

Sample RDF Graph Example Elvis in YAGO

36

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 35: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

35

Sample RDF Graph Example Elvis in YAGO

36

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 36: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

36

Namespace PrefixesA namespace prefix is an abbreviation for the prefix of a URI

elvishimself inriawon grammyprize

prefix elvis lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

A URI abbreviated this way is called a qname

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 37: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

37

Default Prefix

himself inriawon grammyprize

prefix lthttpelvisorggtprefix inria lthttpinriafrrdfdtagtprefix grammy lthttpg-acomgt

httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize

The default namespace prefix is just a colon

In the following we assume such a prefix

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 38: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

38

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize

Elvis Grammy Award

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 39: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

39

Tabular Data in RDF

GrammyAward

All tabular data can be expressed in RDF

won

Person

Prize Country

Elvis Grammy Award USA

USA

isFrom

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 40: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

40

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

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 41: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

41

Exercise

Represent the following information in an RDF graph

Elvis was born in TupeloTupelo is located in MississippiElvis married Priscilla in 1967Priscilla likes Mississippi

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 42: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

RDF Semantics

GrammyAwardwon

NatAcademypresents

A triple ltspogt is interpreted as a First Order Logic fact p(so)

won(Elvis GrammyAward)presents(NatAcademy GrammyAward)

42

The triple of URIs ltspogt the graph and the First Order Logic fact are equivalent representations of the same statement

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 43: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

Notation 3

43

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

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 44: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

RDF XML Syntax

44

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 in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 45: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

RDF in a Database

45

RDF can also be stored in a database

Subject Predicate

Object

httpelvisorghimself

won httpg-acomprize

GrammyAwardwon

NatAcademypresents

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 46: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

46

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

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 47: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

47

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 48: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

48

ClassesA class (also called concept) can be understood as a set of similar entities

person

singer

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 49: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

49

Classes in RDF

singer

The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf

rdftype

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 50: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

50

Classes in RDF

rdftype

The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs

person

rdfssubclassOf

singer

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 51: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

51

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

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 52: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

52

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

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 53: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

53

Taxonomy

singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

taxo

nom

yin

stan

ces

X is a class if we can say ldquoI met an Xrdquo

X is a sub-class of Y if we can say ldquoEvery X is a Yrdquo

Everything with a proper name is an instance

Make a taxonomy of animals

Include at least 2 instances

rdfsResource

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 54: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

54

RDFS ldquoMeta Factsrdquo

rdfsClass

rdfssubclassOfrdftype

rdftype singer

rdftype

person

rdfssubclassOf

rdfssubclassOf

rdfsResource

rdftype

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 55: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

55

PropertiesProperties (predicates) themselves resources

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

won

Singer

rdftype

rdfsubclassOf

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 56: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

56

PropertiesIn triple format anyway everything is just triples

won

rdfProperty

rdftype

rdfssubclassOfrdftype

rdfsResource

Elvis won GrammyrdfProperty rdftype rdfsResourcewon rdftype rdfProperty

won

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 57: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

57

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

rdfsrangerdfsdomainPerson Prizewon

rdfProperty

rdftype

won

As first argument of won we expect persons

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 58: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

58

Domain amp RangeThe domain of a predicate is the class of the instances expected as first argument The range is the class of instances expected as second argument

Write down the domains and rangesof the following predicates

bull graduatedFrom (eg Elvis graduatedFrom ParisTech)bull bornIn (eg Elvis bornIn Tupelo)bull hunts (eg Tom hunts Jerry)bull rdftypebull rdfsubclassOf

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 59: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

59

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classes

rdftype

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 60: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

60

Semantics of rdftype

singer

rdftype

person

rdfssubclassOf

Every instance is an instance of all more general classesWe express this by a deduction rule

rdftype

X rdftype YY rdfssubclassOf Z

X rdftype Z

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 61: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

61

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule is of the form A Bwhere B is a literal and A is a set of literalsA literal is a triple that can contain variables

set of 2 literals A

single literal B

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 62: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

62

Deduction Rules

X rdftype YY rdfssubclassOf Z

X rdftype Z

A deduction rule A B meanswhenever there is a set of triples that match Aadd the triple B with the variables instantiated

Elvis rdftype SingerSinger rdfssubclassOf Person

Elvis rdftype Person

match

add

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 63: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

63

RDFS Deduction RulesRDFS specifies 44 deduction rules

The rules are applied recursively until the set of triples doesnot change any more

The result is called the deductive closure

A1

B1

A44

B44

s0 p0 o0s1 p1 o1s2 p2 o3s3 p3 o4s4 p4 o4

s5 p5 o5

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 64: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

64

SubclassOf Rule

singer

rdftype

person

rdfssubclassOf

rdfssubclassOfX rdfssubclassOf YY rdfssubclassOf Z

X rdfssubclassOf Z

Every class is a subclass of all more general classes

rdfssubclassOfrdfsResource

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 65: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

65

Domain amp Range Rules

singer

R rdfsrange CX R Y

Y rdftype C

won

Prize

rdftyperdftype

wonrdfsrangerdfsdomain

R rdfsdomain CX R Y

X rdftype C

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 66: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

66

Sub-Properties

won

wonAlone

ltPsubpropertyOfRgtltXPYgt

ltXRYgt

rdfssubpropertyOf

wonAlone

won

A sub-property of a predicate R is a more special variant of R

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 67: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

67

P rdfssubpropertyOf RX P YX R Y

R rdfsdomain DX R YX rdftype D

R rdfsrange CX R YY rdftype C

X rdftype YY rdfssubclassOf ZX rdftype Z

X rdfssubclassOf YY rdfssubclassOf ZX rdfssubclassOf Z

wonAlone

won

wonAlone

rdfssubpropertyOf

herordfsdomain

personrdfssubclassOf

Compute the deductive closure

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 68: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

68

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 69: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

69

Storing dataRDF data is usually stored on a server

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

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 70: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

70

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 httpyago-knowledgeorg

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 71: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

71

URIs

A URI is not necessarily dereferenceable (ie it cannot be accessed online)

httpg-acomGrammyAward =gt NOT FOUND

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 72: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

72

Cool URIs

But URIs 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

Try this out rdftype = httpwwww3org19990222-rdf-syntax-nstype

httpg-acomGrammyAward click

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 73: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

73

URIs can be followed

prefix g httpg-acom prefix rdf httpwwww3org19990222-rdf-syntax-ns

gGrammyAward rdftype gAwardhttpelviscomelvis gwon gGrammyAward

Server at httpg-acom replied

The RDF graph becomes traversable

prefix e httpelviscom prefix rdf httpwwww3org19990222-rdf-syntax-ns

eelvis rdftype esingereelvis eborn 1935

Server at httpelviscom replies

click

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 74: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

74

Wersquore all one Graph

If 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 URIs and retrieve more information in neighboring ontologies

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 75: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

75

Shared VocabularyOntologies can share the same nodes

httpelviscomelvis

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 76: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

76

Shared VocabularyOntologies can share the same predicates

httpelviscomwon

httpelviscomwon

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 77: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

77

Shared VocabularyOntologies can share the same nodes and predicates

Sharing nodes = sharing a vocabulary talking the same language

This has several advantagesbull Reuse of data (modeling work is done only once)bull Higher interoperability (systems use the same vocabulary)bull Distribution of responsibilities (domains modeled by experts)

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 78: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

78

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

s Schemaorg (predicates for Web content) httpschemaorg

cc Creative Commons (types of licences) httpcreativecommonsorgns

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 79: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

79

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

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 80: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

80

Dublin Coredc Dublin Core (predicates for describing documents) httppurlorgdcelements11

httpelvisorgbiohtml ldquoA biography of Elvisrdquo

dcTitleFabiandcCreator

ldquoThis is the entire life ofrdquo

dcDescriptionldquoTextrdquo

dcType

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 81: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

81

Creative Commonscc Creative Commons (types of licences) httpcreativecommonsorgns

ccBYcclicense

httpfabianorg

ccAttributionUrl

ccReproductionldquoFabianrdquoccAttributionName

ccWork

ccpermitsrdftype

Try this

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 82: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

82

Schemaorgs schemaorg (vocabulary for things on the Web) An alliance of Microsoft Google and Yahoo () httpschemaorg

sPriscillasspouse

ldquoElvis Presleyrdquosname

sPerson

Schemaorg defines vocabulary for people movies events restaurants etc

Similar Googlersquos data vocabulary Facebookrsquos open graph

Try it out

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 83: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

83

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 84: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

84

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)

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 85: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

85

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

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 86: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

86

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

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 87: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

87

OWL-DL GoalOWL-DL is a subset of OWL that is decidable

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

owlinverseowlcardinality

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 88: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

88

OWL-DL Notation

Man

Father

Parent

listowlIntersectionOf

rdftype

hasElementhasElement

father = parent | | man

This notation is equivalent to the RDF graph representation

OWL-DL comes with a simplified notation called Description Logic

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 89: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

Intersection

89

X | | Y = the class of things that are in both X and Y

father = parent | | malePerson

If X and Y are classes then we define

Example

The class of fathers is the intersection of the classes parent and malePerson

OWL-DL is primarily concerned with describing sets of entities fathers mothers birds universities

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 90: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

Intersection

90

father = parent | | malePerson

malePerson parentfa

ther

Class intersection has a set-theoretic interpretation

Class intersection also has a first order logic interpretation

x father(x) lt= gt parent(x) malePerson(x)

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 91: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

Union

91

X | | Y

person = man | | woman

= the class of things that are in X or in Y

If X and Y are classes then we define

Class union also has a set-theoretic interpretation

woman man

person

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 92: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

Union Intersection Negation

92

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

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 93: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

93

RestrictionsRC The class of things where there is at least one R-link to an instance of C

E

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

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 94: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

94

RestrictionsRC The class of things where all R-links lead to a C

A

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

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 95: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

95

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

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 96: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

96

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)

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 97: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

97

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

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 X is a subclass of Y (everything in X is also in Y)

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

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 98: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

98

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)

The set-theoretic interpretation is ldquois an element ofrdquo

happyPerson

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 99: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

99

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)

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 100: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

100

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

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 101: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

101

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

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 102: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

102

OWL-DL

bull being in two classes at the same time

ldquoThose thathave a child and have only femalechildrenrdquo

hasChildperson AhasChildfemale

X | |Y

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

E

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 103: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

103

OWL-DL

elvis hasChildfemale

AhasChildfemale

Abull being in two classes at the same timebull 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

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 104: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

104

OWL-DL

bull standing in a relationship

(elvis pricilla) marriedTo

marriedTo

bull being in two classes at the same timebull 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

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 105: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

105

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

Empty class

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 106: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

106

Reasoning TasksClassical reasoning tasks in OWL-DLbull Is the knowledge base consistent

singer | person

bellosingerbellodog

dog| ~person

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 107: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

107

Reasoning Tasks

bull Is one class a subclass of another class

hasChildfemale| singer

E

(Are all parents of girls singers)

can be reduced to the consistency problem

(bobLisa) hasChildLisa femalebob~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

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 108: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

108

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

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 109: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

109

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

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 110: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

110

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

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 111: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

111

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 112: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

112

SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

SELECT locWHERE lthttpelvisorgelvisgt lthttpelvisorglivesIngt loc

Find me all the values for loc such that the triple is true

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 113: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

113

SPARQL Syntax

SELECT variable variable WHERE literal literal

Note the dot

No comma between variables

variable a name with preceding question mark x y z these are variables

literal an RDF triple that can contain variables Elvis livesIn x

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 114: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

114

SPARQL Prefix

SELECT variable variable WHERE literal literal

PREFIX name lturigt

note the colon and the lt gt

SPARQL queries can define and use namespace prefixes

PREFIX e lthttpelvisorggtSELECT locWHERE eElvis elivesIn loc

Example

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 115: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

115

SPARQL AnswersAn answer to a SPARQL query on an ontology is an instantiation of the variables so that the query triplesappear in the ontology

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo Priscilla

Answer

loc = Memphis

loc = Memphis

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 116: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

116

SPARQL Answers

PREFIX lthttpelvisorggtSELECT locWHERE Elvis livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaElvis livesIn moon

Answer 1

loc = Memphis

loc = Memphis

A SPARQL query can have multiple answers

Answer 2

loc = moon

loc = moon

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 117: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

117

SPARQL Answers

PREFIX lthttpelvisorggtSELECT x locWHERE x livesIn loc

Query

Ontology

Elvis livesIn MemphisElvis marriedTo PriscillaPriscilla livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

Answer 2x = Priscillaloc = moon

x = Priscillaloc = moon

A SPARQL query can have multiple variables

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 118: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

118

SPARQL Answers

PREFIX SELECT xWHERE x livesIn Memphis x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerPriscilla livesIn MemphisPriscilla rdftype Actress

Answer

x = Elvis

x = Elvis

A SPARQL query can have multiple triples

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 119: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

119

SPARQL Answers

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = Memphis

A SPARQL query with multiple triples variables and answers

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 120: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

120

SPARQL Answers

Query

Ontology

Elvis livesIn MemphisElvis rdftype SingerElvis livesIn moon

Answer 1

x = Elvisloc = Memphis

x = Elvisloc = moon

A SPARQL query with multiple triples variables and answers

Answer 2

x = Elvisloc = moon

PREFIX SELECT x locWHERE x livesIn loc x rdftype Singer

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 121: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

121

SPARQL MatchingAnswering SPARQL queries can be seen as matching sub-graphs

Elvis where are you

elivesInmoon

PREFIX e lthttpelvisorggt

SELECT locWHERE eelvis elivesIn loc

elivesIn loc

loc = emoon

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 122: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

122

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

httpwwww3orgwikiSparqlEndpoints

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 123: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

123

SPARQL Example

select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100

Example at httpdbpedia-liveopenlinkswcomsparql

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 124: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

124

SPARQL SummarySPARQL (SPARQL Protocol and RDF Query Language) is the query language of the Semantic Web

PREFIX e lthttpelvisorggt SELECT xWHERE x ewon eGrammy

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

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 125: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

125

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFa)

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 126: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

126

Linked Data Problem

singerMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

rdftype

Ontologies can talk about the same thing with different URIs

httpeporgElvis

httpmporgTheKing

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 127: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

127

Linked Data Problem

guitarMusiPedia(httpmporg )

rdftypeElvisopedia(httpeporg )

singer

plays

Ontologies can contain complementary information aboutthe same entity with different URIs

httpeporgElvis

httpmporgTheKing

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 128: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

128

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be used

httpeporgElvis

httpmporgTheKing

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 129: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

129

Linked Data Problem

guitar

rdftype

SELECT xWHERE x rdftype singer x plays guitar

singer

plays

Different URIs for the same thing are a problem becausecomplementary information cannot be usedeven if the data is merged

httpeporgElvis

httpmporgTheKing

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 130: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

130

Linked Data Solution

guitar

rdftypesinger

plays

httpeporgElvis

httpmporgTheKing

OWL provides vocabulary to link equivalent entitieswith different URIs

owlsameAs

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 131: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

131

The Linking Data ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RDF graph (link)

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 132: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

132

The Linked Data Cloud

Currently (2012) bull 295 ontologiesbull 25 billion triplesbull 400m links httprichardcyganiakde200710lodimagemaphtml

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 133: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

133

Existing OntologiesThe existing ontologies in the Linked Data Cloud include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull general knowledge YAGO DBpedia Cyc bull US and UK government databull geographical data in abundancebull national library catalogs (USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 134: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

134

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (RDFaMicroformatsMicrodata)

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 135: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

135

And the rest of the Web

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 136: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

136

MicrodataMicrodata is the upcoming W3C standard to annotate HTML pages with RDF data

Similar standards arebull RDFabull Microformats (now becoming obsolete)

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 137: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

137

Microdata ExampleSuppose we have a page about a researcher

ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 138: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

138

Microdata

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

Everything inside this ltdivgt becomes a node

httpschemaorgPerson

rdftype

We are using schemaorg vocabulary

The node is of type Person

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 139: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

139

Naming a node

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

rdftype

We can also give the URI of the node

httpschemaorgPerson

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 140: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

140

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemprop=ldquonamerdquogtMartin Thunderbirdltspangt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt

httpmartin

hellipPerson

rdftype

ldquoMartin Thunderbirdrdquo

name

Statements are constructed with ldquoitemprop=ldquo

Text becomes a string node in RDF

Problem The W3C has not yet agreed on the URI prefix

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 141: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

141

RDFa Statements

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt lta itemprop=ldquoworksForrdquo href=ldquohttprrrcomrdquogt Rockrsquon Roll Reseach Institute ltagtltdivgt

httpmartin

hellipPerson

rdftype

httprrrcom worksFor

If the tag contains a ldquohrefrdquo the href target becomes the object

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 142: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

142

Inner Nodes

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt

ltspangt ltdivgt

httpmartin

hellipPerson

rdftype

address

itemscope makes a new node

itemprop relates the outer node to the inner node

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 143: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

143

Inner Nodes

httpmartin

hellipPerson

rdftype

address

ldquoFrancerdquo

addressCountry

ltdiv itemscope itemtype=ldquohttpschemaorgPersonrdquo itemid=ldquohttpmartin-thunderbirdcommerdquogt ltspan itemscope itemprop=addressrdquogt ltspan itemprop=ldquoaddressCountryrdquogtFranceltspangt ltspangt ltdivgt

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 144: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

144

Microdata Vocabulary

lttag itemscopegt defines a new nodelttag itemscope itemtype=urigt defines a new node with rdftypelttag itemscope itemid=urigt defines a new node with URIlttag itemprop=predicategtvaluelttaggt defines a link of the outer node to a literallttag itemprop=predicate href=urlgt defines a link of the outer node to a URI

which is isomorphic to an RDF graph

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 145: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

145

Microdata SummaryMicrodata is the upcoming W3C standard to annotate HTML 5 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

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 146: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

146

Semantic Web in Action 1

With the Linter parser

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 147: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

RDF data following the Open Graph Protocol is often embedded in HTML pagesthus allowing the Facebook LIKE button to work

Semantic Web in Action 2

147

bdquoOpen Graph Protocolldquo httpogporgns

Beautiful mind IMDb

ogpsiteName

ogpMovie

Facebook has developed its own vocabulary the

ogptype

wwwimdbcomtitlett0268978 lthtml xmlnsog=httpogpmens gt hellip ltmeta property=ogtype content=movie gt ltmeta property=fbapp_id content=lsquo123 gt helliplthtmlgt

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 148: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

Semantic Web in Action 3

148

The major search engines (Google Bing Yahoo) understand (or will understand) RDF data embedded in HTML pages

Try it out

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 149: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

Semantic Web in Action 4

149

The UK government makes much of its data available online in RDF ndash by law

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 150: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

Semantic Web in Action 5

150

The DBpedia Mobile App retrieves data from the Linked Open Data Cloud to show places of interest around you

Try it out

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 151: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

Semantic Web in Action 6

151

Google launched its ldquoKnowledge Graphrdquo an ontology from Wikipedia that enhances search results

Try it out

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 152: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

152

SigmaSigma is a Semantic Web search engine developed at the DERI Ireland It scrapes Embedded RDF and follows owlsameAs (httpsigma)

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 153: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

153

SigmaSigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)
Page 154: The Semantic Web Télécom ParisTech Summer 2012 by Fabian M. Suchanek This document is available under a Creative Commons Attribution Non-Commercial License

154

The Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)bull Express facts (RDF)bull Express concepts (RDFS)

bull Describe constraints (OWL)

bull Share vocabularies

bull Query knowledge (SPARQL)

bull Link data

bull Publish data (Embedded RDF)

  • The Semantic Web
  • Organization
  • Knowledge Representation
  • Motivation
  • Motivation (2)
  • Motivation (3)
  • Use cases
  • Use cases (2)
  • Merging
  • The Semantic Web (2)
  • The Semantic Web (3)
  • The Semantic Web (4)
  • The Semantic Web (5)
  • Identifying Entities
  • Identifying Entities (2)
  • URIs
  • URIs (2)
  • URIs (3)
  • URIs (4)
  • URIs and URLs
  • Namespaces
  • Namespaces (2)
  • URI Use Cases
  • URNs
  • URN Assignment
  • Syntax of URNs
  • Example URNs
  • Example URNs OIDs
  • Example URNs 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
  • Exercise
  • RDF Semantics
  • Notation 3
  • RDF XML Syntax
  • RDF in a Database
  • Labels
  • The Semantic Web (7)
  • Classes
  • Classes in RDF
  • Classes in RDF (2)
  • Taxonomy
  • Taxonomy (2)
  • Taxonomy (3)
  • RDFS ldquoMeta Factsrdquo
  • Properties
  • Properties (2)
  • Domain amp Range
  • Domain amp Range (2)
  • Semantics of rdftype
  • Semantics of rdftype (2)
  • Deduction Rules
  • Deduction Rules (2)
  • RDFS Deduction Rules
  • SubclassOf Rule
  • Domain amp Range Rules
  • Sub-Properties
  • Slide 67
  • The Semantic Web (8)
  • Storing data
  • Storing data (2)
  • URIs (5)
  • Cool URIs
  • URIs can be followed
  • Wersquore all one Graph
  • Shared Vocabulary
  • Shared Vocabulary (2)
  • Shared Vocabulary (3)
  • Standard Vocabulary
  • Standard Vocabulary (2)
  • Dublin Core
  • Creative Commons
  • Schemaorg
  • The Semantic Web (9)
  • The Goal of OWL
  • OWL Vocabulary
  • OWL Undecidability
  • OWL-DL Goal
  • OWL-DL Notation
  • Intersection
  • Intersection (2)
  • Union
  • Union Intersection Negation
  • Restrictions
  • Restrictions (2)
  • Restrictions (3)
  • Subclass Assertions
  • Exercise (2)
  • Type Assertions
  • Fact Assertions
  • OWL-DL
  • OWL-DL (2)
  • OWL-DL (3)
  • OWL-DL (4)
  • OWL-DL (5)
  • OWL-DL (6)
  • Reasoning Tasks
  • Reasoning Tasks (2)
  • Reasoning Tasks (3)
  • OWL OWL-DL
  • OWL-DL Summary
  • The Semantic Web (10)
  • SPARQL
  • SPARQL Syntax
  • SPARQL Prefix
  • SPARQL Answers
  • SPARQL Answers (2)
  • SPARQL Answers (3)
  • SPARQL Answers (4)
  • SPARQL Answers (5)
  • SPARQL Answers (6)
  • SPARQL Matching
  • SPARQL Endpoints
  • SPARQL Example
  • SPARQL Summary
  • The Semantic Web (11)
  • Linked Data Problem
  • Linked Data Problem (2)
  • Linked Data Problem (3)
  • Linked Data Problem (4)
  • Linked Data Solution
  • The Linking Data Project
  • The Linked Data Cloud
  • Existing Ontologies
  • The Semantic Web (12)
  • And the rest of the Web
  • Microdata
  • Microdata Example
  • Microdata (2)
  • Naming a node
  • RDFa Statements
  • RDFa Statements (2)
  • Inner Nodes
  • Inner Nodes (2)
  • Microdata Vocabulary
  • Microdata Summary
  • Semantic Web in Action 1
  • Semantic Web in Action 2
  • Semantic Web in Action 3
  • Semantic Web in Action 4
  • Semantic Web in Action 5
  • Semantic Web in Action 6
  • Sigma
  • Sigma (2)
  • The Semantic Web (13)