Upload
geraldine-nelson
View
217
Download
0
Tags:
Embed Size (px)
Citation preview
The Semantic Web
2 sessions in the section ldquoWeb Searchrdquo of the course ldquoWeb Miningrdquo
at the Eacutecole nationale supeacuterieure des Teacuteleacutecommunicationsin ParisFrance in fall 2010
by Fabian M SuchanekThis document is available under aCreative Commons Attribution Non-Commercial License
2
Organisationbull 4h class on the Semantic Web
2 sessions with 2h each
bull Small home-work given at the end of each session to be handed in for the next session
(on paper or by email)
bull Web-site httpsuchanekname Teaching
3
MotivationIn the last class on Information Extraction we saw how to move from unstructured data to structured data
Person Job
Elvis singer
But even between structured data interaction is difficult
Person
Occupation
Elvis P
singer
ltxmlgt ltpersongt ltoccupationgt singer
4
Motivation
Person Job
Elvis singer
But even between structured data interaction is difficult in particularif the data is in different formats
Person
Occupation
Elvis P
singer
ltxmlgt ltpersongt ltoccupationgt singer
5
Motivation
Person Job
Elvis singer
But even between structured data interaction is difficult in particularif the data is in different formats on different machines or devices
Person
Occupation
Elvis P
singer
ltxmlgt ltpersongt ltoccupationgt singer
6
Motivation
Person Job
Elvis singer
But even between structured data interaction is difficult in particularif the data is in different formats on different machines or devices or in different companies
Person
Occupation
Elvis P
singer
ltxmlgt ltpersongt ltoccupationgt singer
7
Motivation 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
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
8
Motivation 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)
9
Motivation 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
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
10
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
11
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data
bull Define Literals
and it even works
Standards produced byor endorsed by theWord Wide Web Consortium(W3C)
represented in Europeby the European Research Consortiumfor Informatics and Mathematics(ERCIM) with INRIA being a member
12
URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity
Elvis
Elvis
Elvis Presley
13
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
httpimitatorsorgElvisFG17
httpelvisorgme
Elvis Presley
httpontocompeoplesingersEP
Two main approaches1 URL-like identifiers
14
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers (not necessarily Internet-accessible)
httpelvisorgme Identifies the person not Internet-accessible
httpelvisorgindexhtml Identifies a fileInternet-accessible
Age
75
5
15
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers
httpimitatorsorgElvisFG17
World-wide uniquemapping to domain owner
in the responsibilityof the domain owner
There should be no URI with two meanings
People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs
16
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs) ie URIs that are globally assigned
ldquournrdquo + Namespace + ldquordquo + Identifier
The IANA (Internet Assigned Numbers Authority) operated by ICANNassigns namespaces to specific organizations
The organization then specifies the identifier
17
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840
examples arehypothetical
Example
Object IDs identifiers from one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies
bull UUID uuid6e8bc430-9c3a-11d9-9669-0800200c9a66
A Universally Unique ID (UUID) is a software-generated string that is globally uniqueComputed eg by MAC address + timestamp
Example run ifconfig
18
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
URNs URLs
URIs
19
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
2
Organisationbull 4h class on the Semantic Web
2 sessions with 2h each
bull Small home-work given at the end of each session to be handed in for the next session
(on paper or by email)
bull Web-site httpsuchanekname Teaching
3
MotivationIn the last class on Information Extraction we saw how to move from unstructured data to structured data
Person Job
Elvis singer
But even between structured data interaction is difficult
Person
Occupation
Elvis P
singer
ltxmlgt ltpersongt ltoccupationgt singer
4
Motivation
Person Job
Elvis singer
But even between structured data interaction is difficult in particularif the data is in different formats
Person
Occupation
Elvis P
singer
ltxmlgt ltpersongt ltoccupationgt singer
5
Motivation
Person Job
Elvis singer
But even between structured data interaction is difficult in particularif the data is in different formats on different machines or devices
Person
Occupation
Elvis P
singer
ltxmlgt ltpersongt ltoccupationgt singer
6
Motivation
Person Job
Elvis singer
But even between structured data interaction is difficult in particularif the data is in different formats on different machines or devices or in different companies
Person
Occupation
Elvis P
singer
ltxmlgt ltpersongt ltoccupationgt singer
7
Motivation 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
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
8
Motivation 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)
9
Motivation 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
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
10
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
11
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data
bull Define Literals
and it even works
Standards produced byor endorsed by theWord Wide Web Consortium(W3C)
represented in Europeby the European Research Consortiumfor Informatics and Mathematics(ERCIM) with INRIA being a member
12
URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity
Elvis
Elvis
Elvis Presley
13
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
httpimitatorsorgElvisFG17
httpelvisorgme
Elvis Presley
httpontocompeoplesingersEP
Two main approaches1 URL-like identifiers
14
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers (not necessarily Internet-accessible)
httpelvisorgme Identifies the person not Internet-accessible
httpelvisorgindexhtml Identifies a fileInternet-accessible
Age
75
5
15
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers
httpimitatorsorgElvisFG17
World-wide uniquemapping to domain owner
in the responsibilityof the domain owner
There should be no URI with two meanings
People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs
16
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs) ie URIs that are globally assigned
ldquournrdquo + Namespace + ldquordquo + Identifier
The IANA (Internet Assigned Numbers Authority) operated by ICANNassigns namespaces to specific organizations
The organization then specifies the identifier
17
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840
examples arehypothetical
Example
Object IDs identifiers from one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies
bull UUID uuid6e8bc430-9c3a-11d9-9669-0800200c9a66
A Universally Unique ID (UUID) is a software-generated string that is globally uniqueComputed eg by MAC address + timestamp
Example run ifconfig
18
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
URNs URLs
URIs
19
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
3
MotivationIn the last class on Information Extraction we saw how to move from unstructured data to structured data
Person Job
Elvis singer
But even between structured data interaction is difficult
Person
Occupation
Elvis P
singer
ltxmlgt ltpersongt ltoccupationgt singer
4
Motivation
Person Job
Elvis singer
But even between structured data interaction is difficult in particularif the data is in different formats
Person
Occupation
Elvis P
singer
ltxmlgt ltpersongt ltoccupationgt singer
5
Motivation
Person Job
Elvis singer
But even between structured data interaction is difficult in particularif the data is in different formats on different machines or devices
Person
Occupation
Elvis P
singer
ltxmlgt ltpersongt ltoccupationgt singer
6
Motivation
Person Job
Elvis singer
But even between structured data interaction is difficult in particularif the data is in different formats on different machines or devices or in different companies
Person
Occupation
Elvis P
singer
ltxmlgt ltpersongt ltoccupationgt singer
7
Motivation 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
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
8
Motivation 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)
9
Motivation 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
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
10
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
11
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data
bull Define Literals
and it even works
Standards produced byor endorsed by theWord Wide Web Consortium(W3C)
represented in Europeby the European Research Consortiumfor Informatics and Mathematics(ERCIM) with INRIA being a member
12
URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity
Elvis
Elvis
Elvis Presley
13
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
httpimitatorsorgElvisFG17
httpelvisorgme
Elvis Presley
httpontocompeoplesingersEP
Two main approaches1 URL-like identifiers
14
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers (not necessarily Internet-accessible)
httpelvisorgme Identifies the person not Internet-accessible
httpelvisorgindexhtml Identifies a fileInternet-accessible
Age
75
5
15
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers
httpimitatorsorgElvisFG17
World-wide uniquemapping to domain owner
in the responsibilityof the domain owner
There should be no URI with two meanings
People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs
16
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs) ie URIs that are globally assigned
ldquournrdquo + Namespace + ldquordquo + Identifier
The IANA (Internet Assigned Numbers Authority) operated by ICANNassigns namespaces to specific organizations
The organization then specifies the identifier
17
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840
examples arehypothetical
Example
Object IDs identifiers from one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies
bull UUID uuid6e8bc430-9c3a-11d9-9669-0800200c9a66
A Universally Unique ID (UUID) is a software-generated string that is globally uniqueComputed eg by MAC address + timestamp
Example run ifconfig
18
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
URNs URLs
URIs
19
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
4
Motivation
Person Job
Elvis singer
But even between structured data interaction is difficult in particularif the data is in different formats
Person
Occupation
Elvis P
singer
ltxmlgt ltpersongt ltoccupationgt singer
5
Motivation
Person Job
Elvis singer
But even between structured data interaction is difficult in particularif the data is in different formats on different machines or devices
Person
Occupation
Elvis P
singer
ltxmlgt ltpersongt ltoccupationgt singer
6
Motivation
Person Job
Elvis singer
But even between structured data interaction is difficult in particularif the data is in different formats on different machines or devices or in different companies
Person
Occupation
Elvis P
singer
ltxmlgt ltpersongt ltoccupationgt singer
7
Motivation 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
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
8
Motivation 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)
9
Motivation 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
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
10
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
11
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data
bull Define Literals
and it even works
Standards produced byor endorsed by theWord Wide Web Consortium(W3C)
represented in Europeby the European Research Consortiumfor Informatics and Mathematics(ERCIM) with INRIA being a member
12
URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity
Elvis
Elvis
Elvis Presley
13
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
httpimitatorsorgElvisFG17
httpelvisorgme
Elvis Presley
httpontocompeoplesingersEP
Two main approaches1 URL-like identifiers
14
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers (not necessarily Internet-accessible)
httpelvisorgme Identifies the person not Internet-accessible
httpelvisorgindexhtml Identifies a fileInternet-accessible
Age
75
5
15
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers
httpimitatorsorgElvisFG17
World-wide uniquemapping to domain owner
in the responsibilityof the domain owner
There should be no URI with two meanings
People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs
16
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs) ie URIs that are globally assigned
ldquournrdquo + Namespace + ldquordquo + Identifier
The IANA (Internet Assigned Numbers Authority) operated by ICANNassigns namespaces to specific organizations
The organization then specifies the identifier
17
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840
examples arehypothetical
Example
Object IDs identifiers from one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies
bull UUID uuid6e8bc430-9c3a-11d9-9669-0800200c9a66
A Universally Unique ID (UUID) is a software-generated string that is globally uniqueComputed eg by MAC address + timestamp
Example run ifconfig
18
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
URNs URLs
URIs
19
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
5
Motivation
Person Job
Elvis singer
But even between structured data interaction is difficult in particularif the data is in different formats on different machines or devices
Person
Occupation
Elvis P
singer
ltxmlgt ltpersongt ltoccupationgt singer
6
Motivation
Person Job
Elvis singer
But even between structured data interaction is difficult in particularif the data is in different formats on different machines or devices or in different companies
Person
Occupation
Elvis P
singer
ltxmlgt ltpersongt ltoccupationgt singer
7
Motivation 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
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
8
Motivation 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)
9
Motivation 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
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
10
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
11
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data
bull Define Literals
and it even works
Standards produced byor endorsed by theWord Wide Web Consortium(W3C)
represented in Europeby the European Research Consortiumfor Informatics and Mathematics(ERCIM) with INRIA being a member
12
URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity
Elvis
Elvis
Elvis Presley
13
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
httpimitatorsorgElvisFG17
httpelvisorgme
Elvis Presley
httpontocompeoplesingersEP
Two main approaches1 URL-like identifiers
14
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers (not necessarily Internet-accessible)
httpelvisorgme Identifies the person not Internet-accessible
httpelvisorgindexhtml Identifies a fileInternet-accessible
Age
75
5
15
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers
httpimitatorsorgElvisFG17
World-wide uniquemapping to domain owner
in the responsibilityof the domain owner
There should be no URI with two meanings
People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs
16
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs) ie URIs that are globally assigned
ldquournrdquo + Namespace + ldquordquo + Identifier
The IANA (Internet Assigned Numbers Authority) operated by ICANNassigns namespaces to specific organizations
The organization then specifies the identifier
17
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840
examples arehypothetical
Example
Object IDs identifiers from one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies
bull UUID uuid6e8bc430-9c3a-11d9-9669-0800200c9a66
A Universally Unique ID (UUID) is a software-generated string that is globally uniqueComputed eg by MAC address + timestamp
Example run ifconfig
18
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
URNs URLs
URIs
19
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
6
Motivation
Person Job
Elvis singer
But even between structured data interaction is difficult in particularif the data is in different formats on different machines or devices or in different companies
Person
Occupation
Elvis P
singer
ltxmlgt ltpersongt ltoccupationgt singer
7
Motivation 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
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
8
Motivation 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)
9
Motivation 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
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
10
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
11
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data
bull Define Literals
and it even works
Standards produced byor endorsed by theWord Wide Web Consortium(W3C)
represented in Europeby the European Research Consortiumfor Informatics and Mathematics(ERCIM) with INRIA being a member
12
URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity
Elvis
Elvis
Elvis Presley
13
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
httpimitatorsorgElvisFG17
httpelvisorgme
Elvis Presley
httpontocompeoplesingersEP
Two main approaches1 URL-like identifiers
14
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers (not necessarily Internet-accessible)
httpelvisorgme Identifies the person not Internet-accessible
httpelvisorgindexhtml Identifies a fileInternet-accessible
Age
75
5
15
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers
httpimitatorsorgElvisFG17
World-wide uniquemapping to domain owner
in the responsibilityof the domain owner
There should be no URI with two meanings
People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs
16
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs) ie URIs that are globally assigned
ldquournrdquo + Namespace + ldquordquo + Identifier
The IANA (Internet Assigned Numbers Authority) operated by ICANNassigns namespaces to specific organizations
The organization then specifies the identifier
17
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840
examples arehypothetical
Example
Object IDs identifiers from one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies
bull UUID uuid6e8bc430-9c3a-11d9-9669-0800200c9a66
A Universally Unique ID (UUID) is a software-generated string that is globally uniqueComputed eg by MAC address + timestamp
Example run ifconfig
18
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
URNs URLs
URIs
19
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
7
Motivation 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
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
8
Motivation 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)
9
Motivation 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
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
10
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
11
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data
bull Define Literals
and it even works
Standards produced byor endorsed by theWord Wide Web Consortium(W3C)
represented in Europeby the European Research Consortiumfor Informatics and Mathematics(ERCIM) with INRIA being a member
12
URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity
Elvis
Elvis
Elvis Presley
13
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
httpimitatorsorgElvisFG17
httpelvisorgme
Elvis Presley
httpontocompeoplesingersEP
Two main approaches1 URL-like identifiers
14
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers (not necessarily Internet-accessible)
httpelvisorgme Identifies the person not Internet-accessible
httpelvisorgindexhtml Identifies a fileInternet-accessible
Age
75
5
15
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers
httpimitatorsorgElvisFG17
World-wide uniquemapping to domain owner
in the responsibilityof the domain owner
There should be no URI with two meanings
People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs
16
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs) ie URIs that are globally assigned
ldquournrdquo + Namespace + ldquordquo + Identifier
The IANA (Internet Assigned Numbers Authority) operated by ICANNassigns namespaces to specific organizations
The organization then specifies the identifier
17
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840
examples arehypothetical
Example
Object IDs identifiers from one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies
bull UUID uuid6e8bc430-9c3a-11d9-9669-0800200c9a66
A Universally Unique ID (UUID) is a software-generated string that is globally uniqueComputed eg by MAC address + timestamp
Example run ifconfig
18
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
URNs URLs
URIs
19
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
8
Motivation 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)
9
Motivation 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
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
10
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
11
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data
bull Define Literals
and it even works
Standards produced byor endorsed by theWord Wide Web Consortium(W3C)
represented in Europeby the European Research Consortiumfor Informatics and Mathematics(ERCIM) with INRIA being a member
12
URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity
Elvis
Elvis
Elvis Presley
13
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
httpimitatorsorgElvisFG17
httpelvisorgme
Elvis Presley
httpontocompeoplesingersEP
Two main approaches1 URL-like identifiers
14
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers (not necessarily Internet-accessible)
httpelvisorgme Identifies the person not Internet-accessible
httpelvisorgindexhtml Identifies a fileInternet-accessible
Age
75
5
15
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers
httpimitatorsorgElvisFG17
World-wide uniquemapping to domain owner
in the responsibilityof the domain owner
There should be no URI with two meanings
People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs
16
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs) ie URIs that are globally assigned
ldquournrdquo + Namespace + ldquordquo + Identifier
The IANA (Internet Assigned Numbers Authority) operated by ICANNassigns namespaces to specific organizations
The organization then specifies the identifier
17
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840
examples arehypothetical
Example
Object IDs identifiers from one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies
bull UUID uuid6e8bc430-9c3a-11d9-9669-0800200c9a66
A Universally Unique ID (UUID) is a software-generated string that is globally uniqueComputed eg by MAC address + timestamp
Example run ifconfig
18
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
URNs URLs
URIs
19
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
9
Motivation 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
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
10
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
11
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data
bull Define Literals
and it even works
Standards produced byor endorsed by theWord Wide Web Consortium(W3C)
represented in Europeby the European Research Consortiumfor Informatics and Mathematics(ERCIM) with INRIA being a member
12
URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity
Elvis
Elvis
Elvis Presley
13
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
httpimitatorsorgElvisFG17
httpelvisorgme
Elvis Presley
httpontocompeoplesingersEP
Two main approaches1 URL-like identifiers
14
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers (not necessarily Internet-accessible)
httpelvisorgme Identifies the person not Internet-accessible
httpelvisorgindexhtml Identifies a fileInternet-accessible
Age
75
5
15
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers
httpimitatorsorgElvisFG17
World-wide uniquemapping to domain owner
in the responsibilityof the domain owner
There should be no URI with two meanings
People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs
16
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs) ie URIs that are globally assigned
ldquournrdquo + Namespace + ldquordquo + Identifier
The IANA (Internet Assigned Numbers Authority) operated by ICANNassigns namespaces to specific organizations
The organization then specifies the identifier
17
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840
examples arehypothetical
Example
Object IDs identifiers from one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies
bull UUID uuid6e8bc430-9c3a-11d9-9669-0800200c9a66
A Universally Unique ID (UUID) is a software-generated string that is globally uniqueComputed eg by MAC address + timestamp
Example run ifconfig
18
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
URNs URLs
URIs
19
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
10
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
11
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data
bull Define Literals
and it even works
Standards produced byor endorsed by theWord Wide Web Consortium(W3C)
represented in Europeby the European Research Consortiumfor Informatics and Mathematics(ERCIM) with INRIA being a member
12
URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity
Elvis
Elvis
Elvis Presley
13
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
httpimitatorsorgElvisFG17
httpelvisorgme
Elvis Presley
httpontocompeoplesingersEP
Two main approaches1 URL-like identifiers
14
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers (not necessarily Internet-accessible)
httpelvisorgme Identifies the person not Internet-accessible
httpelvisorgindexhtml Identifies a fileInternet-accessible
Age
75
5
15
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers
httpimitatorsorgElvisFG17
World-wide uniquemapping to domain owner
in the responsibilityof the domain owner
There should be no URI with two meanings
People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs
16
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs) ie URIs that are globally assigned
ldquournrdquo + Namespace + ldquordquo + Identifier
The IANA (Internet Assigned Numbers Authority) operated by ICANNassigns namespaces to specific organizations
The organization then specifies the identifier
17
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840
examples arehypothetical
Example
Object IDs identifiers from one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies
bull UUID uuid6e8bc430-9c3a-11d9-9669-0800200c9a66
A Universally Unique ID (UUID) is a software-generated string that is globally uniqueComputed eg by MAC address + timestamp
Example run ifconfig
18
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
URNs URLs
URIs
19
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
11
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data
bull Define Literals
and it even works
Standards produced byor endorsed by theWord Wide Web Consortium(W3C)
represented in Europeby the European Research Consortiumfor Informatics and Mathematics(ERCIM) with INRIA being a member
12
URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity
Elvis
Elvis
Elvis Presley
13
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
httpimitatorsorgElvisFG17
httpelvisorgme
Elvis Presley
httpontocompeoplesingersEP
Two main approaches1 URL-like identifiers
14
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers (not necessarily Internet-accessible)
httpelvisorgme Identifies the person not Internet-accessible
httpelvisorgindexhtml Identifies a fileInternet-accessible
Age
75
5
15
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers
httpimitatorsorgElvisFG17
World-wide uniquemapping to domain owner
in the responsibilityof the domain owner
There should be no URI with two meanings
People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs
16
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs) ie URIs that are globally assigned
ldquournrdquo + Namespace + ldquordquo + Identifier
The IANA (Internet Assigned Numbers Authority) operated by ICANNassigns namespaces to specific organizations
The organization then specifies the identifier
17
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840
examples arehypothetical
Example
Object IDs identifiers from one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies
bull UUID uuid6e8bc430-9c3a-11d9-9669-0800200c9a66
A Universally Unique ID (UUID) is a software-generated string that is globally uniqueComputed eg by MAC address + timestamp
Example run ifconfig
18
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
URNs URLs
URIs
19
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
12
URIsGoal Identify entities uniquely worldwideThe same entity can have multiple identifiers but the same identifier shall always mean the same entity
Elvis
Elvis
Elvis Presley
13
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
httpimitatorsorgElvisFG17
httpelvisorgme
Elvis Presley
httpontocompeoplesingersEP
Two main approaches1 URL-like identifiers
14
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers (not necessarily Internet-accessible)
httpelvisorgme Identifies the person not Internet-accessible
httpelvisorgindexhtml Identifies a fileInternet-accessible
Age
75
5
15
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers
httpimitatorsorgElvisFG17
World-wide uniquemapping to domain owner
in the responsibilityof the domain owner
There should be no URI with two meanings
People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs
16
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs) ie URIs that are globally assigned
ldquournrdquo + Namespace + ldquordquo + Identifier
The IANA (Internet Assigned Numbers Authority) operated by ICANNassigns namespaces to specific organizations
The organization then specifies the identifier
17
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840
examples arehypothetical
Example
Object IDs identifiers from one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies
bull UUID uuid6e8bc430-9c3a-11d9-9669-0800200c9a66
A Universally Unique ID (UUID) is a software-generated string that is globally uniqueComputed eg by MAC address + timestamp
Example run ifconfig
18
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
URNs URLs
URIs
19
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
13
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
httpimitatorsorgElvisFG17
httpelvisorgme
Elvis Presley
httpontocompeoplesingersEP
Two main approaches1 URL-like identifiers
14
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers (not necessarily Internet-accessible)
httpelvisorgme Identifies the person not Internet-accessible
httpelvisorgindexhtml Identifies a fileInternet-accessible
Age
75
5
15
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers
httpimitatorsorgElvisFG17
World-wide uniquemapping to domain owner
in the responsibilityof the domain owner
There should be no URI with two meanings
People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs
16
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs) ie URIs that are globally assigned
ldquournrdquo + Namespace + ldquordquo + Identifier
The IANA (Internet Assigned Numbers Authority) operated by ICANNassigns namespaces to specific organizations
The organization then specifies the identifier
17
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840
examples arehypothetical
Example
Object IDs identifiers from one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies
bull UUID uuid6e8bc430-9c3a-11d9-9669-0800200c9a66
A Universally Unique ID (UUID) is a software-generated string that is globally uniqueComputed eg by MAC address + timestamp
Example run ifconfig
18
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
URNs URLs
URIs
19
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
14
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers (not necessarily Internet-accessible)
httpelvisorgme Identifies the person not Internet-accessible
httpelvisorgindexhtml Identifies a fileInternet-accessible
Age
75
5
15
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers
httpimitatorsorgElvisFG17
World-wide uniquemapping to domain owner
in the responsibilityof the domain owner
There should be no URI with two meanings
People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs
16
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs) ie URIs that are globally assigned
ldquournrdquo + Namespace + ldquordquo + Identifier
The IANA (Internet Assigned Numbers Authority) operated by ICANNassigns namespaces to specific organizations
The organization then specifies the identifier
17
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840
examples arehypothetical
Example
Object IDs identifiers from one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies
bull UUID uuid6e8bc430-9c3a-11d9-9669-0800200c9a66
A Universally Unique ID (UUID) is a software-generated string that is globally uniqueComputed eg by MAC address + timestamp
Example run ifconfig
18
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
URNs URLs
URIs
19
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
15
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers
httpimitatorsorgElvisFG17
World-wide uniquemapping to domain owner
in the responsibilityof the domain owner
There should be no URI with two meanings
People can invent all kinds of URIsbull a company can create URIs to identify its productsbull an organization can assign sub-domains and each sub-domain can define URIsbull individual people can create URIs from their homepagebull people can create URIs from any URL for which they have exclusive rights to create URIs
16
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs) ie URIs that are globally assigned
ldquournrdquo + Namespace + ldquordquo + Identifier
The IANA (Internet Assigned Numbers Authority) operated by ICANNassigns namespaces to specific organizations
The organization then specifies the identifier
17
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840
examples arehypothetical
Example
Object IDs identifiers from one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies
bull UUID uuid6e8bc430-9c3a-11d9-9669-0800200c9a66
A Universally Unique ID (UUID) is a software-generated string that is globally uniqueComputed eg by MAC address + timestamp
Example run ifconfig
18
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
URNs URLs
URIs
19
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
16
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs) ie URIs that are globally assigned
ldquournrdquo + Namespace + ldquordquo + Identifier
The IANA (Internet Assigned Numbers Authority) operated by ICANNassigns namespaces to specific organizations
The organization then specifies the identifier
17
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840
examples arehypothetical
Example
Object IDs identifiers from one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies
bull UUID uuid6e8bc430-9c3a-11d9-9669-0800200c9a66
A Universally Unique ID (UUID) is a software-generated string that is globally uniqueComputed eg by MAC address + timestamp
Example run ifconfig
18
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
URNs URLs
URIs
19
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
17
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
bull ISBN urnisbn1234567bull ISAN urnisan0000-1111-2222-3333-4444bull SWIFT urnswiftbicBYLADEM1000bull OID urnoid216840
examples arehypothetical
Example
Object IDs identifiers from one global tree of identifiers where sub-trees are administrated by authoritiesFor example the IANA administrates ids for companies
bull UUID uuid6e8bc430-9c3a-11d9-9669-0800200c9a66
A Universally Unique ID (UUID) is a software-generated string that is globally uniqueComputed eg by MAC address + timestamp
Example run ifconfig
18
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
URNs URLs
URIs
19
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
18
URIsA Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet
Two main approaches1 URL-like identifiers2 Uniform Resource Names (URNs)
URNs URLs
URIs
19
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
19
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
20
RDF
Grammy Award
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
An RDF statement is a triple of 3 URIs The subject the predicate and the object
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
A set of triples 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 objectwith a label given by the predicate
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
21
RDF NamespacesA namespace is an abbreviation for the prefix of a URI
An RDF statement is a triple of 3 URIs The subject the predicate and the object
elvishimself inriawon grammyprize
prefix elvis httpelvisorgprefix inria httpinriafrrdfdtaprefix grammy httpg-acom
The default name space is indicated by ldquordquo
himself inriawon grammyprize
with the above namespaces this becomes
httpelvisorghimself httpinriafrrdfdtawon httpg-acomprize
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
22
RDF Event entities
GrammyAward
The Resource Description Framework (RDF) is a standardizedknowledge representation model that resembles the entity-relationship model
won
All tabular data can be expressed this way
Person
Prize
Elvis Grammy Award
Person
Prize Year
Elvis Grammy Award
196742
GrammyAward
1967
Row42 year
prize
person
Elvis-won-Grammy-event
possibly with event entities ie artificial entities that representa complex constellation
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
RDF Semantics
GrammyAward
A blank node is an RDF node that has no name
wonNatAcademy
presents
bornInlocatedIn
Semantics
A triple ltspogt is interpreted as a First Order Logic fact p(so)
A blank node is interpreted as an existential variable
won(Elvis GrammyAward)presents(NatAcademy GrammyAward)
xy bornIn(Elvis x) locatedIn(x y) stateOf(yUSA)
E
USAstateOf
23
A blank node can be unified with another node so that a blank node does not violate uniqueness constraints
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
RDF Concrete Syntax
24
Notation 3 (N3) is a concrete syntax for RDF which is human-readable
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
prefix ltgt prefix elvis httpelvisorg
NatAcademy presents lthttpg-acomprizegt
elvishimself bornIn [ locatedIn [ stateOf USA ] ]
elvishimself won lthttpg-acomprizegt plays ltguitargt
Components are qnames or URIs
Same subject can be
abbreviated
Blank nodes can be written as []
Local namespace is ltgt or
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
RDF Concrete Syntax
25
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsi=ldquohttpinriafrrdfdtardquogt
ltrdfDescription rdfabout=httpelvisorghimselfgt ltiwon rdfresource=ldquohttpg-acomprizeldquo gt ltrdfDescriptiongt
Namespaces become XML namespaces
Properties of X are listed inside an rdfDescription
about X
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
RDF Concrete Syntax
26
RDF can also be stored in XML format
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
ltrdfDescription rdfNodeId=ldquo_srdquogt ltstateOf rdfresource=ldquoUSAldquo gt ltrdfDescriptiongt
ltrdfDescription rdfNodeId=ldquo_prdquogt ltlocatedIn rdfNodeId=ldquo_sldquo gt ltrdfDescriptiongtltrdfRDFgt
Blank nodes get node ids
which can be used elsewhere
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
RDF Concrete Syntax
27
RDF can also be stored in XML format or in a database
GrammyAwardwon
bornInlocatedIn
USAstateOf
NatAcademy
presents
Subject Predicate
Object
httpelvisorghimself
won httpg-acomprize
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
28
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
29
Literals
1935born
A literal in RDF is a string followed by a URI that defines the data type of the literal
A data type is a mapping from a lexical space (set of strings) to a value space
elvishimself bornIn ldquo1935rdquo^^httpwwww3org2001XMLSchemagYear
RDF mostly uses the data types defined for XML
ltrdfDescription about=ldquohttpelvisorghimselfldquogt ltbornIn rdfdatatype=ldquohttpwwww3org2001XMLSchemagYearrdquogt 1935 ltbornIngt ltrdfDescriptiongt
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
30
LiteralsA literal in RDF is a string followed by a URI that defines the data type of the literal
httpwwww3org2001XMLSchema
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
31
Labels
ldquoElvisrdquo ldquoThe Kingrdquo
rdflabelrdflabel
A label is a human-readable name for an entity
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
32
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype
rdffirst
rdftyperdftype
rdfrest rdfrest rdfrest
rdffirst rdffirst
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
33
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
Alice likes (Elvis Madonna JohnLennon)
Alice likes [ rdffirst Elvis rdfrest [ rdffirst Madonna rdfrest [ rdffirst JohnLennon rdfrest rdfnil]]]
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
34
CollectionsA collection in RDF is either rdfnil or an object followed by a collection
rdfList
L1 L2
L3 rdfnil
rdftype rdftyperdftype
rdfrest rdfrest rdfrest
ltrdfDescription about=ldquoAlicerdquogt ltlikes rdfparseType=ldquoCollectionrdquogt ltrdfDescription about=ldquoElvisrdquo gt ltrdfDescription about=ldquoMadonnardquo gt ltrdfDescription about=ldquoJohnLennonrdquo gt ltlikesgtltrdfDescriptiongt
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
35
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
36
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A super-class of a class is a class that is more general than the first class(a super-set in the set-theoretic interpretation)
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
taxonomy
singerspeople
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
37
RDFS Classes
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
The fact that an entity belongs to a class is expressed by the type predicate from the standard namespace rdf (httpw3corg )
The fact that a class is a sub-class of another class is expressed by thesubclassOf predicate from the standard namespace rdfs (httpw3corg )
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
38
RDFS Semantics
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
A
person
entity
rdfssubclassOf
rdfssubclassOf
unemployed
rdftype
theory
abstraction
rdftype
rdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
39
RDFS Entailment
singer
rdftype
RDFS defines a set of 44 entailment rules
A
personrdfssubclassOf
x y z subclassOf(xy) subclassOf(yz) =gt subclassOf(xz)
x y z type(xy) subclassOf(yz) =gt type(xz)
A
Each entailment rule is of the form
If the ontology contains such andsuch triplesthen add this triple
The entailment rules are appliedrecursively until the graph doesnot change any more
This can be done in polynomial timeWhether this is done physically ordeduced at query time is an implementation issue
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
40
RDFS ldquoMeta Factsrdquo
singer
rdftype
A class (also called concept) can be understood as a set of similar entities
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
rdfsClass
rdfssubclassOfrdftype
rdftyperdftype
type x belongs to the group of y
subclassOf every x is a y
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
41
RDFS Properties
singer
rdftype
Properties (predicates) are instances of rdfProperty and have domain and range
person
rdfsResource
rdfssubclassOf
rdfssubclassOf
won
rdfProperty
rdftype
rdfssubclassOfrdftype
rdfsdomainrdfsrange
Prize
pcxy domain(pc) p(xy) =gt type(xc)pcxy range (pc) p(xy) =gt type(yc)pqxy subpropertyOf(pq) p(xy) =gt q(xy)
AA
wonAlone
rdfsubpropertyOf
A
Looks higher-order but is notintroduce a predicate fact(predsubjobj)
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
RDFS ReificationA reified statement is an entity that represents a statement
s42
The reified statement can be part of the ontology or not
ie it does not have to be true
rdftype
42
rdftype
singer
singer
rdfsubject
rdfpredicate
rdfobject
god
Alicebelieves
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
43
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
44
SharingIf two RDF graphs share one node they are actually one RDF graph
gGrammy Award 1935
esinger
born
gPrize
ewon
rdftype
gNatAcademy
gpresents
Namespacee = httpexampleorg Namespace
g = httpg-acom
A machine can follow the linksand retrieve more informationin the neighboring ontology
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
45
Sharing Cool URIsIf two RDF graphs share one node they are actually one RDF graph
A URI is not necessarily dereferenceable (ie it cannot be accessed online)
gGrammyAward
httpg-acomGrammyAward
but it can be dereferenceable This means that the server responds with an RDF snippet
ltxml version=10gtltrdfRDF xmlnsrdf=ldquohttpwwww3org19990222-rdf-syntax-nsrdquo xmlnsg=ldquohttpg-acomrdquogt
ltrdfDescription rdfabout=ldquohttpg-acomGrammyAwardrdquogt ltgpresentedBy rdfresource=ldquohttpg-acomNatAcademyldquogt ltrdfDescriptiongt
ltrdfRDFgt The RDF graph becomes traversable
=gt HTTP not found error
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
46
Sharing Standard VocabularyA number of standard vocabularies have evolved
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
cc Creative Commons (types of licences) httpcreativecommonsorgns
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
47
Sharing Standard Vocabulary
rdf The basic RDF vocabulary httpwwww3org19990222-rdf-syntax-ns (Try this in browser)
rdfs RDF Schema vocabulary httpwwww3org19990222-rdf-syntax-ns
Standard vocabulary provided by the W3Cbull type subclassOf Property Class subpropertyOfbull rdflabelbull rdfList
A number of standard vocabularies have evolved
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
48
Sharing Dublin Core
dc Dublin Core (predicates for describing documents) httppurlorgdcelements11
httpelvisorgbiohtml
ldquoA biography of ElvisrdquodcTitleFabiandcCreator
ldquoThis is the entire life ofrdquodcDescriptionldquoTextrdquo dcType
A number of standard vocabularies have evolved
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
49
Sharing Creative Commons
cc Creative Commons (types of licences) httpcreativecommonsorgns
ccBYcclicensehttpfabianorg
ccAttributionUrl
ccReproductionldquoFabianrdquo ccAttributionName
ccWork
ccpermits
Creative Commons is a non-profit organization which defines verypopular licenses notablybull CC-BY Free for reuse just give credit to the authorbull CC-BY-NC Free for reuse give credit non-commercial use onlybull CC-BY-ND Free for reuse give credit do not create derivative works
A number of standard vocabularies have evolved
rdftype
Try this
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
50
Sharing FOAF
foaf Friend Of A Friend (predicates for relationships between people) httpxmlnscomfoaf01
AllShookUpfoafmadefoafknows
ldquoElvis Presleyrdquofoafname
foafPerson
Google launched httprdfdata-vocabularyorg which provides vocabulary for addresses and other personal information
A number of standard vocabularies have evolved
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
51
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
52
OWL GoalRDFS just allows us to define classes and subclasses
Can we go further
1935
singer
born
Ontology
bull Reasoning If X is left of Y and Y is left of Z then X is left of Z
bull Class definitions The class of husbands is the class of married men
bull Class properties People and tables are two disjoint classes
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
53
OWL HistoryOWL (the Web Ontology Language) is an RDF vocabulary for reasoning
1935
singer
born
Ontology
bull American version DAML (DARPA Agent Markup Language)bull European version OIL (Ontology Interchange Language)
bull DAML+OIL
bull OWL
W3C
bull OWL 2
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
54
OWL ClassesOWL distinguishes classes and individuals
owlClass
owlThing
rdfsClass
rdfsubclassOf
rdftype
singeractor
table elephant
rdftype
rdftype
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
55
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAge
rdfsubclassOf rdfsubclassOf
hasName
hasPopulation
rdftype
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
56
OWL PropertiesOWL distinguishes data properties (properties that take a literal)and object properties (properties that take a URI)
rdfProperty
owlDataProperty owlObjectProperty
hasAgeisMarriedWith
rdfsubclassOf
Folks are you getting this
rdfsubclassOf
hasName
livesIn
hasChild
hasPopulation
rdftype rdftype
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
57
OWL PropertiesIn OWL data properties can have a data type as range
rdfProperty
owlDataProperty
hasAge
rdfsubclassOf
rdftype Person
rdfdomain
xsdnonNegativeInteger
rdfrange
No But I look good
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
58
OWL NegationsOWL can express negations
owlNegativePropertyAssertion
So how do I say The US is not at war with
Vietnam
Alice
loves loves
rdftype
owlsourceIndividual
owltargetIndividual
owlassertion-Property
For the first time we can express negation
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
59
OWL IntersectionOWL can create classes from other classes eg by intersection
Man
Father
owlClassParent
rdftypeowlIntersectionOf
This is a list (with rdffirst rdfrest and rdfnil)
rdftype
Semantics type(xc) intersectionOf(cc1c2) lt=gt type(xc1) type(xc2)
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
60
OWL UnionOWL can create classes from other classes eg by intersection union
HardRockSinger
RockSinger
owlClassSoftRockSinger
rdftypeowlUnionOf
rdftype
Semantics type(xc) unionOf(cc1c2) lt=gt type(xc1) type(xc2)
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
61
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
rdftype Contradiction
Semantics type(xc) complementOf(ccrsquo) =gt ~type(xcrsquo)
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
62
OWL ComplementOWL can create classes from other classes eg by intersection unionand complement
Parent
owlClass
NonParent
rdftypeowlComplementOf
rdftype
ChildlessPerson
Person
owlIntersectionOf
rdftype
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
63
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationship
Parent
owlClassowlRestriction
rdftyperdftype
rdftype
owlonProperty
Semantics type(xc) someValuesFrom(cpcrsquo) =gt y p(xy) type(ycrsquo)
hasChild
Person owlsomeValuesFrom
E
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
64
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint
YoungParent
owlRestriction rdftype
rdftype
owlonProperty
Semantics type(xc) allValuesFrom(cpcrsquo) =gt y p(xy) =gt type(ycrsquo)
hasChild
Baby owlallValuesFrom
A
Alright but that doesnrsquot mean that I have child
right
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
65
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictions
YoungParent
owlRestrictionrdftype
rdftype
hasChild
Baby allValues
owlRestrictionrdftype
hasChild
Person someValues
onProp
onProp
owlintersectionOf
See it is very complicated to
be a young parent
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
66
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
rdftype
owlRestriction
hasChild
rdftypeowlonProperty
owlh
asVa
lue
Lisa Maria Presley
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
67
OWL RestrictionsOWL can create classes from other classes eg by intersection unionand complementWe can also demand that instances have at least one relationshipor that all relationships fulfill a constraint or combine restrictionsor impose value restrictions
LisasParents
owlClass
rdftype
owloneOf
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
68
OWL PropertiesOWL can also express properties of properties
owlReflexiveProperty
hasParent
hasChild
owlinverseOf
hasSpouse
hasChild
owlproperty-DisjointWith
owlSymmetricProperty owlAsymmetricProperty
owlIrreflexiveProperty owlFunctionalProperty
owlInverseFunctionalPropertyhasSpouse
rdftype
Priscilla my love for you is a functional property
Well mine is a reflexive property
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
69
OWL OntologiesOWL can also express properties of ontologies
owlOntology
httpelvisorg
rdftype
owlinclu
des
httpwagnerorgfamilyHistory
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
70
OWL UndecideabilityIt should come as no surprise that the consistency of an OWL ontologyis undecideable
What do you mean we are undecideable
owloneOf
owltwoOf
owlreflexiveIntersectionOf
owlcomplicatedCombinationOfowlhyperSymmetricProperty
That means We mayencounter an ontology for which we cannot decide whether it contains a contradiction or not
OWL comes with the following decideable sub-sets (profiles)bull OWL-ELbull OWL-RLbull OWL-QLbull OWL-DL
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
71
OWL OWL-DLClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
Notation is called ldquoDescription Logicldquo
father = parent | | malePerson
= (parent | | man) | | (hardRockSinger | | softRockSinger) | | ~married
= person | | ~(hardRockSinger | | softRockSinger)
We have the other named classesas usual (ie unary predicates)
person parent hardRockSinger happyPerson marriedPersonmalePerson etc
The following sub-set of OWL (called OWL-DL) is decideable
unmarried-rock-singing-father
non-rock-singing-person
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
72
OWL OWL-DL
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
person-with-happy-child = person | | hasChildhappyPerson
person-with-only-happy-children= person | | hasChildhappyPersonA
E
The following sub-set of OWL (called OWL-DL) is decideableClass constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
73
OWL OWL-DL
owloneOf a b c
Those parents of Lisa who are rock singers
hasChildLisa | | (hardRockSinger | | softRockSinger)
E
The following sub-set of OWL (called OWL-DL) is decideable
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
74
OWL OWL-DL
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
people with more than 10 children person | | ge 10 hasChild
people with exactly 10 children
The following sub-set of OWL (called OWL-DL) is decideable
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Notation is called ldquoDescription Logicldquo
R A predicateroleC a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
75
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
All parents are happy parent | happyPerson
All rock singers have Lisa as child(hRockSinger | | srSinger) | hasChildLisa
E
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The domain of r is C (rdfsdomain) ge 1 R | C
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
76
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y Assertions say how classes relate to each other
owlxxxCardinality ge n R le n R (the class of those who have moreless than n outgoing R links)
owloneOf a b c
owlallValuesFromowlsomeValuesFrom
RC (the class where all R-links lead to a C)RC (the class where there is a R-link to a C)
EA
Class constructors describe a class
Class constructors
owlThingowlNothing
T (called ldquotoprdquo) (called ldquobottomrdquo)T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
The range of r is C (rdfsrange) T | rC
A
r is functional T | le 1 RX and Y are disjoint classes X | | Y |
T
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
77
OWL OWL-DLThe following sub-set of OWL (called OWL-DL) is decideable
owlsubclassOf X | Y
owlxxxCardinality ge n R le n RowloneOf a b c
owlallValuesFromowlsomeValuesFrom
RCRC
EA
Class constructors
owlThingowlNothing
T
T
owlunionOfowlintersectionOfowcomplementOf
X | | YX | | Y~X
owlsubpropertyOf R | S
owltransitive Tr(R)
rdftype aC
(ab)Ra and b stand in relation R
Everything aboutclasses and relationsTBox (ldquoTerminology boxrdquo)
Everything aboutinstancesABox (ldquoAssertion boxrdquo)
This is one specific rule set called ldquoDescription Logic SHOINrdquo There are other Description Logics
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
78
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a class
ldquoThose thathave a femalechildrdquo
EhasChildfemale
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
79
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class
ldquoThose thathave only femalechildrenrdquo
AhasChildfemale
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
80
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain type
ldquoThose thathave more than1 childrdquo
ge 2 hasChild
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
81
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same time
ldquoThose thathave more than1 child and have only femalechildrenrdquo
ge 2 hasChild AhasChildfemale
X | | Y
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
82
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a class
elvis hasChildfemale AhasChildfemale
A
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
83
OWL OWL-DLDescription Logics OWL-DL basically reason about properties such as
bull having a link to an element of a classbull having all links of one type leading to a certain class bull having at most or at least n links of a certain typebull being in two classes at the same timebull belonging to a classbull standing in a relationship
(elvis pricilla) marriedTo
marriedTo
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
84
OWL OWL-DLDescription Logics OWL-DL infer properties to make the knowledge baseconsistent
Whatever other children Priscilla has will become girls
AhasChildfemale
(priscilla navarone)hasChild
A
priscilla hasChildfemale
=gt navaronefemale
This may fail of course
navaronemalemale | | female |
T
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
85
OWL OWL-DLDescription Logics OWL-DL are based on the Open World Assumption
AhasChildfemale
ldquoIf the knowledge base does not contain a certainassertion and that assertion does not follow from the knowledge basethen that assertion can be either true or falserdquo
So for each assertion X one of these cases applies
bull X follows from the knowledge basebull ~X follows from the knowledge basebull nothing about X follows from the knowledge base
(This is differed from the Closed WorldAssumption as used in Prolog where ldquonothing followsrdquo means X is false)
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
86
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
singer | person
bellosingerbellodog
dog| ~person
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
87
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
hasChildLisa| singer
E
(Are all parents of Lisa singers)
can be reduced to the consistency problem
(bobLisa) hasChildbob~singer
More precisely we ask Does it follow necessarily from the KB that one class is a subclass of the otherIf so we get a contradiction here
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
88
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
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
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
89
OWL OWL-DLClassical reasoning tasks in Description Logic OWL-DL
bull Is the knowledge base consistent
bull Is one class a subclass of another class
bull Is an individual an instance of a class
bull Does an individual have a certain property
elvis singsgoodSongE
can be reduced to the consistency problem
elvis ~ 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
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
90
OWL OWL-DLOWL-DL is a decideable 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
AhasChildfemale
There are a number of free OWL DL reasonersavailable onlinebull Pelletbull FaCT++bull Prova
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
91
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL)
bull Link data1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
92
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Elvis where are you
elivesInmoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
Find me all the values for loc such that the triple is true
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
93
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt
SELECT locWHERE eelvis elivesIn loc
elivesInloc
loc = emoonSPARQL queries can be seenas sub-graph matching
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
94
SPARQL MatchingSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc x rdftype esinger
elivesInloc
loc = emoonx = eElvis
eGracelandelivesIn
esinger
rdftypex
esinger
rdftype
SPARQL queries can be seenas sub-graph matching
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
96
SPARQL Result setsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
elivesInemoon
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT loc xWHERE x elivesIn loc
elivesInloc
loc = eGraceland x=ePriscillaloc = emoon x=eElvis
A query can have multiple results
eGracelandelivesIn
esinger
rdftypex
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
98
SPARQL FiltersSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
rdflabelldquoElvisrdquo
PREFIX e lthttpelvisorggt PREFIX rdf lthttpw3corggt
SELECT xWHERE x rdflabel lab FILTER regex(labrdquoErdquo)
rdflabellab
x = eElvisResults can be filtered through externalboolean functions
ldquoPriscillardquordflabel
esinger
rdftypex
ldquoErdquo
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
99
SPARQL NamespacesSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
ewongGrammy
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
ewongGrammy
SPARQL queries should be able to spandifferent namespaces
x
x = eElvis
httpelvisorg httpg-acom
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
100
SPARQL EndpointsSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
Many ontologies provide a ldquoSPARQL endpointrdquo ie a service than canbull receive SPARQL queries sent by a machinebull receive SPARQL queries typed by a human in a Web interface
httpesww3orgSparqlEndpoints
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
101
SPARQL Example
select distinct x lthttpdbpediaorgresourceElvis_Presleygt lthttpwwww3org19990222-rdf-syntax-nstypegt xlimit 100
Example at httpdbpedia-liveopenlinkswcomsparql
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
102
SPARQLSPARQL (SPARQL Protocol and RDF Query Language) is the query languageof the Semantic Web
PREFIX e lthttpelvisorggt PREFIX rdf httpw3corgPREFIX glthttpg-acomgt
SELECT xWHERE x ewon gGrammy
SPARQL borrows concepts from SQLbut 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
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
103
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
104
Linking Data Idea
1935
guitar
born
DBpedia
manipulates
Elvisopedia
owlsameAs
GuitarowlequivalentClass
playsowequivalent
Property
How can we link equivalent entities
bull they share a similar identifierbull they share a similar rdflabel
bull they share many common propertiesbull they are equal to a third entity
=gt a challenging task
bull they share a key (ISBN etc)
The owl-predicates have the obvious semantics
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
105
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
106
Linking Data The ProjectThe Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
107
Linking Data The Cloud
Currently (2010) bull 200 ontologiesbull 25 billion triplesbull 400m linkshttprichardcyganiakde200710lodimagemaphtml
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
108
Linking Data Data sets
The data sets include ( httpwww4wiwissfu-berlindelodcloud )bull US census databull BBC music databasebull Gene ontologiesbull DBpedia general knowledge (and hub vocabulary) + YAGO + Cyc etcbull UK government databull geographical data in abundancebull national library catalogs (Hungary USA Germany etc)bull publications (DBLP)bull commercial productsbull all Pokemonsbull and many more
The Linking Open Data Project aims to interlink all open RDF data sources into one gigantic RF graph (link)
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
109
And the rest of the Web
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
110
RDFa Blank outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
Namespace declaration(here a namespace provided by Google)
Everything inside this ltdivgt becomes a blank node of type vPerson
Every ldquopropertyrdquo becomes a link in the RDF graph
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
111
RDFa Given outer nodeRDFa is a W3C standard to annotate HTML pages with RDF data
ltdivgt Martin Thunderbirdltbrgt Researcher in RockrsquoNrsquoRoll Music of 1935-1977ltbrgt 3764 Presley Boulevardltbrgt Memphis Tennesseeltdivgt
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=vnamegtMartin Thunderbirdltspangt ltdivgt
We can also make the node URI explicit
httpmartin
vPerson
ldquoMartin Thunderbirdrdquo
rdftypevname
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
113
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt
ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
As before typeof creates a blank node
rel creates a link between the outer node and the inner node
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
114
RDFa Inner nodesRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan rel=vaddressrdquogt
ltspan typeof=ldquovAddressrdquogt ltspan property=ldquovlocalityrdquogtMemphisltspangtltspangtltspangt ltspangt
ltspangtltdivgt
httpmartin
vPerson
rdftypevaddress
vAddress
rdftype
ldquoMemphisrdquovlocality
ldquoTennesseerdquo
vregion
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
115
RDFa Links to URIsRDFa is a W3C standard to annotate HTML pages with RDF data
ltdiv xmlnsv=httprdfdata-vocabularyorg typeof=vPersonrdquo about=ldquohttpmartin-thunderbirdcommerdquogt ltspan property=ldquovnamerdquogtMartin Thunderbirdltspangt ltspan rel=vfriendrdquo resource=ldquohttpbob-millerorgmerdquogt Bob Miller ltspangt
ltdivgt
httpmartin
vPerson
httpbob-millerorgme
rdftypevfriend
rel + resourcespecifies an RDF link to a URI (not a literal)
ldquoMartin Thunderbirdrdquo
vname
property + contentspecifies an RDF link to a literal
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
117
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
lttag xmlnsxxxx=httpgtlttaggt defines a namespacelttag typeof=classgt defines a new blank nodelttag about=urigt defines a new node with URIlttag property=predicategtvaluelttaggt defines a link of the outer node to a literallttag rel=predicate resource=uri gt defines a link of the outer node to a URIlttag rev=predicate resource=uri gt defines a link of the URI to the outer nodelttag rel=predicategt new node lttaggt defines a link of the outer node to the new node
which is isomorphic to an RDF graph
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
118
RDFa SummaryRDFa is a W3C standard to annotate HTML pages with RDF data
bull Grass root appeal (everybody can start annotating pages)bull No data duplication (all data in one file)bull Publisher independence (everybody can use his own attributes)
Advantages
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
119
RDFa ExampleExample with the Ubiquity RDFa parser
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
120
RDFa Example
Googlersquos ldquorich snippetsrdquoscrape the RDFa contentand can show them in search results
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
121
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
122
RDFa SigmaSigma is a Semantic Web search engine developed at the DERI Ireland(httpsigma)
Sigma also allows the user to correct factually wrong information (such as the urban legend that Elvis would be dead)
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
123
Motivation Semantic WebThe Semantic Web provides standards tobull Identify entities (URIs)
The Semantic Web is an evolving extension of the World Wide Web in which data is made available in one standardized semantic format
bull Express facts (RDF)
bull Express concepts (RDFS)
bull Describe constraints (OWL)
bull Share vocabularies
bull Query knowledge (SPARQL) bull Link data
1935
bull Define Literals
singer
born
Elvis where are you
born
and it even works
Ontology
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs
124
Homework
bull Make a small RDFS taxonomy with at least 5 nodes for a domain of your choice
bull Make a small RDFS graph (different from the previous one) with at least 5 nodes for a domain of your choice using standard vocabulary (Declare the namespaces)
bull Propose another real-world domain where we could establish URNs