SlideShare a Scribd company logo
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDF, linked data and semantic web
Departamento de Informática
Universidad de Oviedo
Jose Emilio Labra Gayo
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
About me
Main researcher WESO research group (WEb Semántics Oviedo)
Author of the following books:
http://www.di.uniovi.es/~labra
Web Semántica (2012) Validating RDF Data (2017)
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Structure of presentation
Why RDF?
RDF data model
RDF ecosystem
RDF applications
Inference systems: RDFS, OWL
SPARQL
Challenges
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Why RDF?
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
The flood of data
Producing data is more and more easy
Open trends
Open Software
Open Content
Open Data
Open Science
Open Government
Old models are affected
Músic, Films, finance,...
Education
Government ...
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Why?
Reasons for governments
Transparency
Leadership
Government as catalyzer
Promote participation
New initiatives and apps
Reasons for citizens
Data belong to us
Created with public money
We want better services
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
OK, long live to data!
but…
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Problems of current web
It is not enough to publish data
It must be found
If not found, as if it doesn't exist
It must be usable
If not usable, it is worthless
Reuse data in unexpected contexts
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Semantic loss
When publishing data, some semantics is lost
The person that wants to publish has more info about the data
Some info is lost during the publication process
publisher
party next
saturday
Formats:
HTML, PDF, JPG,
...
consumer
(person)
consumer
(agent)
party next
saturday
Semantics
9/Dec/2017
Data
published
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
HTML doesn't have enough semantics
HTML is intended to publish hypertext
HTML tags are understood by browsers
Information inside tags = natural language
Machines don't understand natural language yet
<p>Event:
<ul>
<li>Name: Concert</li>
<li>Date: Next saturday</li>
</ul>
</p>
<p>իրադարձություն:
<ul>
<li>տիպ: համերգ</li>
<li>ամսաթիվ: հաջորդ շաբաթ/li>
</ul>
</p>
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
XML problem
XML goes a step forward
Specific vocabularies have meaning in some specific context
Specific applications can process XML documents
XML documents are difficult to integrate if they are from different domains
<event>
<name>համերգ</name>
<date>հաջորդ շաբաթ</date>
</event>
<event>
<name>Concert</name>
<date>Next saturday</date>
</event>
<իրադարձություն>
<տիպ>համերգ</տիպ>
<ամսաթիվ>հաջորդ շաբաթ</ամսաթիվ>
</իրադարձություն>
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Json problem
JSON is almost the same as XML
It may be easier to parse and processby developers
But the meaning depends on each domain
It is even worse as there are no namespaces or validation
{
"event": {
"name": "Party" ,
"date": "Next saturday"
}
}
{
"event": {
"name": "համերգ" ,
"date": "հաջորդ շաբաթ"
}
}{
"իրադարձություն": {
"տիպ": "համերգ" ,
"ամսաթիվ": "հաջորդ շաբաթ"
}
}
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Towards semantic web
Semantic web = vision of the data web
Tim Berners Lee
Source: Wikipedia
Goal: Share and Reuse data between applications, and communities
From a web of documents to a web of data
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Benefits
Accessible data
Avoid semantic loss
Facilitate task automation
Linked data
Data reuse
Application integration
The best way to use your data will be
found by other people
Jo Walsh, Rufus Pollock, http://www.okfn.org/files/talks/xtech_2007/
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Web features
Non centralized
Difficult to ensure data integrity and quality
Dynamic information
Information is constantly changing
Big amounts of information
Big data
3Vs: Volume, Velocity, Variety
Open system
AAA lemma: Anyone can say Anything about Any topic
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Biggest challenge = Integration
In general, the challenge is not to
computerize something
The challenge is integrate systems
Interoperability
It is not enough to publish data…
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Publish = make something accessible
Accessibility levels
Physical disability
Technical disability: other environments
Cultural and intellectual
Illiteracy
Knowledge barriers
Other languages…
Accessible to machines
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Star model*
★ Publish data
(any format)
★★ Use structured formats
(Excel instead of scanned pictures)
★★★ Non proprietary structured formats
(CSV instead of Excel)
★★★★ Use URIs to identify data
(other systems can link to our data)
★★★★★ Link to other data
(provide contextual information)
* Tim Berners-Lee, Gov 2.0 Expo 2010
http://www.youtube.com/watch?v=ga1aSJXCFe0
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Unstructured formats
Black box formats: Pictures, video, audio, etc.
Binary formats: PDF, PS, etc.
They require low level techniques, pattern
recognition, signal processing, etc
★
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Structured formats
Data have some structure
Example: Excel
Problem with proprietary formats
May require non-free tools
★ ★
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Non-proprietary formats
Use open-structured formats
Examples: CSV, HTML
Problem: Content depends on context
★ ★ ★
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
URIs identify data
Use URIs to identify data
Content negotiation can provide different representations
★ ★ ★ ★
Example
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Example: RDF ★ ★ ★ ★
<http://www.sepe.es/data/unemployment/Asturias/Allande/2013/10>
HTML?
@prefix sepe: <http://www.sepe.es/datos/>
sepe:obs1 sepe:municipality "Allande" ;
sepe:unemployees 18 .
RDF?
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Link with other data
Representations return links to other data
It allos to:
Reuse and find other data
Unforeseen applications
★ ★ ★ ★ ★
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Linked data example ★ ★ ★ ★ ★
<http://www.sepe.es/data/unemployment/Asturias/Allande/2013/10>
HTML?
@prefix sepe: <http://www.sepe.es/data/>
sepe:obs1 sepe:municipality dbo:allande;
sepe:unemployees 23 .
RDF?
dbo:allande dbo:areaTotal 342.24 ;
rdf:type <http:/.../municipalitiesInAsturias> ;
dbo:country <http:/.../Spain> ;
dbo:populationTotal 2106 ;
. . .
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Linked Open Data principles
1. Use URIs to denote things
2. Use HTTP URIs so that people can look up those names
3. When someone looks up a URI, provide useful information, using the
standards (RDF*, SPARQL)
4. Include links to other URIs. so that they can discover more things.
★ ★ ★ ★ ★
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Linked open data (2007)
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Linked open data (2008)
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Linked open data (2009)
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Linked open data (2014)
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Linked open data (2017)
Fuente: "Linking Open Data cloud diagram 2017, by Andrejs Abele, John P. McCrae, Paul Buitelaar, Anja Jentzsch and Richard Cyganiak. http://lod-cloud.net/"
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDF Data Model
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Short history of RDF
RDF: Resource Description Framework
Around 1997 - PICS, Dublin core, Meta Content Framework
1997 1st Working draft https://www.w3.org/TR/WD-rdf-syntax-971002
RDF/XML
1999 1st W3C Rec https://www.w3.org/TR/1999/REC-rdf-syntax-19990222/
XML Syntax, first applications RSS, EARL
2004 - RDF Revised https://www.w3.org/TR/2004/REC-rdf-concepts-20040210/
Emergence of SPARQL, Turtle, Linked Data
2014 - RDF 1.1 https://www.w3.org/TR/rdf11-concepts/
SPARQL 1.1, JSON-LD
2017 - RDF validation: SHACL/ShEx
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDF Data Model
RDF is made from statements
Statment = a triple (subject, predicate, object)
Example:
http://example.org/alice
http://example.org/bob
http://schema.org/knows
subject predicate object
<http://example.org/alice> <http://schema.org/knows> <http://example.org/bob> .
N-Triples representation
subject object
predicate
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Set of statements = RDF graph
RDF data model = directed graph
Example:
http://example.org/alice
ex:bob
http://example.org/carol
http://example.org/bob
http://schema.org/knows
http://schema.org/knows
http://schema.org/knows
http://schema.org/knows
N-triples representation
<http://example.org/alice> <http://schema.org/knows> <http://example.org/bob> .
<http://example.org/bob> <http://schema.org/knows> <http://example.org/carol> .
<http://example.org/carol> <http://schema.org/knows> <http://example.org/alice> .
<http://example.org/carol> <http://schema.org/knows> <http://example.org/bob> .
subject predicate object
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Turtle notation
Human readable notation that simplifies N-Triples
Allows namespace declarations
<http://example.org/alice> <http://schema.org/knows> <http://example.org/bob> .
<http://example.org/bob> <http://schema.org/knows> <http://example.org/carol> .
<http://example.org/carol> <http://schema.org/knows> <http://example.org/alice> .
<http://example.org/carol> <http://schema.org/knows> <http://example.org/bob> .
prefix : <http://example.org/>
prefix schema: <http://schema.org/>
:alice schema:knows :bob .
:bob schema:knows :carol .
:carol schema:knows :bob .
:carol schema:knows :alice .
Turtle
N-Triples
Note:
We will see later other Turtle simplifications
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Namespaces simplification
http://example.org/alice
ex:bob
http://example.org/carol
http://example.org/bob
http://schema.org/knows
http://schema.org/knows
http://schema.org/knows
http://schema.org/knows
:alice
ex:bob
:carol
:bob
schema:knows
schema:knows
schema:knows
schema:knows
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDF is compositional
RDF graphs can be merged to obtain a bigger graph
Automatic data integration
schema:knows
schema:knows
schema:knows
:alice
ex:bob
:carol
:bob
schema:knows
schema:birthPlace
:carol schema:birthPlace
dbr:Oviedo
:bob
graph 1 graph 2
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDF is compositional
RDF graphs can be merged to obtain a bigger graph
Automatic data integration
schema:birthPlaceschema:knows
schema:knows
schema:knows
:alice
ex:bob
:carol schema:birthPlace
dbr:Oviedo
:bob
schema:knows
graph 1 + graph 2
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Turtle syntax
Some simplifications
prefix declarations
; when triples share the subject
, when triples share subject and object
:alice schema:birthPlace dbr:Oviedo ;
schema:knows :bob .
:alice schema:birthPlace dbr:Oviedo .
:alice schema:knows :bob .
:alice schema:knows :alice .
:alice schema:knows :bob .
:carol schema:knows :alice , :bob .
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Turtle syntax
Exercise: simplify
prefix : <http://example.org/>
prefix schema: <http://schema.org/>
prefix dbr: <http://dbpedia.org/resource>
:alice schema:knows :bob .
:bob schema:knows :carol .
:carol schema:knows :bob .
:carol schema:knows :alice .
:bob schema:birthPlace dbr:Spain .
:carol schema:birthPlace dbr:Spain .
prefix ex: <http://example.org/>
prefix schema: <http://schema.org/>
prefix dbr: <http://dbpedia.org/resource>
:alice schema:knows :bob , :carol.
:bob schema:knows :carol ;
schema:birthPlace dbr:Spain .
:carol schema:knows :bob, :alice ;
schema:birthPlace dbr:Spain .
Try it: https://tinyurl.com/y9wbdycp
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDF Literals
Objects can also be literals
Literals contain a lexical form and a datatype
Typical datatypes = XML Schema primitive datatypes
If not specified, a literal has datatype xsd:string
:bob
Robert
schema:name
1980-03-10
schema:birthDate
xsd:date
xsd:string
:bob schema:name "Robert" ;
:bob schema:birthDate "1980-03-10"^^<xsd:date>.
Turtle notation
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Remember...RDF is compositional
Merging previous data
schema:birthPlaceschema:knows
schema:knows
schema:knows
:alice
ex:bob
:carol
dbr:Spain
schema:birthDate
:bob
Robert xsd:string
1980-03-10 xsd:date
schema:name
schema:knows
prefix : <http://example.org/>
prefix schema: <http://schema.org/>
prefix dbr: <http://dbpedia.org/resource>
:alice schema:knows :bob , :carol.
:bob schema:knows :carol ;
schema:birthPlace dbr:Spain;
schema:name "Robert";
schema:birthDate "1980-03-10"^^<xsd:date>.
:carol schema:knows :bob, :alice ;
schema:birthPlace dbr:Spain .
schema:birthPlace
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Blank nodes
Subjects and objects can also be Blank nodes
:carol
schema:knows
23
:age
"Carol knows someone whose age is 23"
:carol schema:knows _:x .
_:x :age 23 .
:carol schema:knows [ :age 23 ] .
Turtle notation with local identifier
Turtle notation with square brackets
x(schema:knows(:carol,x)  :age(x, 23)
Mathematical meaning:
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Blank nodes
ex:alice
ex:carol
schema:knows
schema:knows
schema:birthPlace
ex:dave
schema:birthPlace
:age
23 xsd:integer
schema:knows
Alice knows someone who
knows Dave
Carol knows someone whose
age is 23 that was born in the
same place as Dave
:alice schema:knows [ schema:knows :dave ] .
:carol schema:knows [ :age 23 ;
schema:birthPlace _:p ] .
:dave schema:birthPlace _:p .
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Language tagged strings
String literals can be qualified by a language tag
They have datatype rdfs:langString
ex:spain rdfs:label "Spain"@en .
ex:spain rdfs:label "España"@es .ex:spain
Spain
rdfs:label
España
rdfs:label
es
en
Turtle notation
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDF data model
schema:knows
schema:knows
schema:knows
ex:alice
ex:bob
ex:carol schema:birthPlace
dbr:Spain
schema:knows
schema:knows
schema:birthDate
ex:bob
Robert xsd:string
1980-03-10 xsd:date
schema:name
schema:birthPlace
schema:knows
ex:dave
schema:birthPlace
schema:age
23 xsd:integerschema:knows
Spain
rdfs:label
España
rdfs:label
es
en
3 types of nodes
URIs
Blank nodes
Literals
Subjects: URIs or Blank nodes
Objects: URIs, Blank nodes or literals
Predicates always URIs
schema:birthPlace
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
...and that's all about the RDF data model
The RDF Data model is very simple
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDF ecosystem
RDF Syntax
Shared entities and RDF vocabularies
Applications of RDF
Inference and ontologies
Query languages
RDF Validation
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDF syntax
First syntax based on XML: RDF/XML
N-Triples (enumerates all triples separated by dots)
Turtle (human readability)
JSON-LD
...other syntaxes...
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDF/XML
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://example.org/"
xmlns:schema="http://schema.org/">
<rdf:Description rdf:about="http://example.org/carol">
<schema:knows>
<rdf:Description rdf:about="http://example.org/bob">
<schema:knows rdf:resource="http://example.org/carol"/>
<schema:name>Robert</schema:name>
<schema:birthDate rdf:datatype="xsd:date">1980-03-10</schema:birthDate>
</rdf:Description>
</schema:knows>
<schema:knows>
<rdf:Description rdf:about="http://example.org/alice">
<schema:knows rdf:resource="http://example.org/bob"/>
<schema:knows rdf:resource="http://example.org/carol"/>
</rdf:Description>
</schema:knows>
<schema:knows rdf:parseType="Resource">
<age rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">23</age>
</schema:knows>
</rdf:Description>
</rdf:RDF>
First syntax
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
N-Triples
<http://example.org/carol> <http://schema.org/knows> <http://example.org/bob> .
<http://example.org/carol> <http://schema.org/knows> <http://example.org/alice> .
<http://example.org/carol> <http://schema.org/knows> _:x .
_:x <http://example.org/age> "23"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://example.org/alice> <http://schema.org/knows> <http://example.org/bob> .
<http://example.org/alice> <http://schema.org/knows> <http://example.org/carol> .
<http://example.org/bob> <http://schema.org/knows> <http://example.org/carol> .
<http://example.org/bob> <http://schema.org/name> "Robert" .
<http://example.org/bob> <http://schema.org/birthDate> "1980-03-10"^^<xsd:date> .
For testing and easy parsing
...just triples separated by dots
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Turtle
Designed to be human-readable
prefix : <http://example.org/>
prefix schema: <http://schema.org/>
:alice schema:knows :bob , :carol .
:bob schema:knows :carol ;
schema:name "Robert";
schema:birthDate "1980-03-10"^^<xsd:date>.
:carol schema:knows :bob, :alice ;
schema:knows [ :age 23 ] .
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
JSON-LD
Json for linked data
{
"@context" : {
"knows" : { "@id" : "http://schema.org/knows", "@type" : "@id" },
"age" : { "@id" : "http://example.org/age", "@type" : "http://www.w3.org/2001/XMLSchema#integer" },
"name" : { "@id" : "http://schema.org/name" },
"birthDate" : { "@id" : "http://schema.org/birthDate", "@type" : "xsd:date" },
"@vocab" : "http://example.org/",
"schema" : "http://schema.org/"
},
"@graph" : [
{ "@id" : "http://example.org/alice",
"knows" : [ "http://example.org/bob", "http://example.org/carol" ] },
{ "@id" : "http://example.org/bob",
"birthDate" : "1980-03-10",
"knows" : "http://example.org/carol",
"name" : "Robert" },
{ "@id" : "http://example.org/carol",
"knows" : [ "http://example.org/bob", "http://example.org/alice", "_:x" ] },
{ "@id" : "_:x",
"http://example.org/age" : 23 }
]
}
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Other Turtle simplifications
RDF type property
Numbers
Collections
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDF type property
The rdf:type property declares the type of a resource
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix schema: <http://schema.org/> .
e:alice rdf:type schema:Person .
e:bob rdf:type schema:Person .
@prefix schema: <http://schema.org/> .
:alice a schema:Person .
:bob a schema:Person .
rdf:type can be simplified as a
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Constants
Numbers and boolean values can be represented without quotes
They are parsed as XML Schema datatypes
Datatype Shorthand example Lexical example
xsd:integer 3 "3"^^xsd:integer
xsd:decimal -3.14 "true"^^xsd:decimal
xsd:double 3.14e2 "true"^^xsd:double
xsd:boolean true "true"^^xsd:boolean
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Collections
Ordered lists
rdf:first
rdf:rest
rdf:rest
rdf:rest
schema:name
:m23
:results
New York City Marathon
rdf:nil
:bob
rdf:first :alice
:dave
:m23 schema:name "New York City Marathon ";
:results ( :dave :alice :bob ) .
:m23 schema:name "New York City Marathon ";
:results _:1 .
_:1 rdf:first :dave ;
rdf:next _:2 .
_:2 rdf:first :alice ;
rdf:next _:3 .
_:3 rdf:first :bob ;
rdf:next rdf:nil .
Internally, represented as linked lists
rdf:first
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Shared entities and vocabularies
The use of URIs instead of plain strings facilitates:
Merging data from heterogeneous sources
Avoid ambiguity
Challenge: Agreeing on common entities and properties
Appearance of some popular vocabularies:
schema.org: Joint effort from Google, Yahoo, Microsoft, Yandex
Linked open vocabularies Project: http://lov.okfn.org/
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Some popular vocabularies and namespaces
Alias URL Name Some properties
rdf: http://www.w3.org/1999/02/22-rdf-syntax-
ns#
RDF type, subject,
predicate,
object,…
rdfs: http://www.w3.org/2000/01/rdf-schema# RDF Schema domain, range
Class, Property
subClassOf,…
owl: http://www.w3.org/2002/07/owl# OWL
Ontologías
sameAs,
intersectionOf
unionOf, …
dc: http://purl.org/dc/elements/1.1/ Dublin Core author, date,
creator, …
schema http://schema.org/ Schema.org name, knows, etc.
skos: http://www.w3.org/2008/05/skos# SKOS
Simple Knowledge
Organization System
broader,
narrower,
Service http://prefix.cc can be used to find the most popular prefix for some URI
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
Applications of RDF
First applications
RDF & HTML: RDFa, Microdata
RDF to represent knowledge
RDF as an internal database
Linked data
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
First RDF applications
Some initiatives proposed by W3C
RSS 1.0 was proposed with an RDF/XML based syntax
Other XML based versions were available
EARL: Evaluation and Reporting Language
RDF/XML adoption was not popular
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDF & HTML
Possibilities
One resource for HTML and another for metadata in RDF
RDFa: Use HTML attributes to encode RDF triples
Microdata: New HTML5 attributes can encode metadata
<p vocab="http://schema.org/"
typeof="Book"
about="http://example.org/book1">
The book
<span property="name">The Spring</span> by
<span property="author">Cervantes</span>
was published
<span property="datePublished"
content="2014-05-04">
last Saturday</span>.
</p>
<p itemscope
itemid="http://leer.com/libro123"
itemtype="http://schema.org/Book">
The book
<span itemprop="name">The Spring</span> by
<span itemprop="author">Cervantes</span>
was published
<time itemprop="datePublished"
content="2014-05-04">
last saturday</time>.
</p>
RDFa Microdata
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDF to represent knowledge
Freebase: developed by Metaweb (2005)
Open, shared database of world's knowledge
Acquired by Google in 2010. It is the basis of Google knowledge graph
DBpedia (http://dbpedia.org)
Extracts knowledge from Wikipedia and converts it to RDF
Wikidata (http://wikidata.org/)
Free knowledge base edited collaboratively
Developed by Wikimedia foundation
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDF as an internal database
Specialized RDF databases (triplestores)
RDF = very flexible, easy to adapt to domain changes
Several big companies are using RDF internally
Example: BBC, Europeana
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDF for Linked open data
Principles proposed by Tim Berners-Lee to publish data:
1. Use URIs to denote things
2. Use HTTP URIs so that people can look up those names
3. When someone looks up a URI, provide useful information, using the
standards (RDF*, SPARQL)
4. Include links to other URIs. so that they can discover more things.
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDF as the basis of Semantic Web
RDF = lingua franca of Semantic Web
Semantic web layer cake
URIUnicode
XML + Namespaces + XML Schema
Proof
RDF + RDF Schema
Ontologies
Logic
Trust
First version proposed by Tim Berners Lee, year 2000
http://www.w3.org/2000/Talks/1206-xml2k-tbl/slide10-0.html
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDF as the basis of Semantic Web
RDF = lingua franca of Semantic Web
Semantic web layer cake (revised)
URIUnicode
XML/JSON/...
RDF
Query:
SPARQL
RDFS
Ontologies
OWL
Trust
Unifying Logic
Rules
RIF
Proof
Validation
SHACL
ShEx
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDFS & inferences
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDFS
Originally RDF Schema (2000)
Defines a vocabulary for common concepts
Classes: rdfs:Class, rdfs:Property, rdfs:Literal
Properties: rdfs:domain, rdfs:range, rdfs:subClassOf, ...
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
RDFS
RDFS processors can infer new triples
RDFS defines several rules for inference:
IF x rdf:type A AND A rdfs:subClassOf B THEN x rdf:type B
:alice
:Lecturer
rdf:type
:Person
rdfs:subClassOf
rdf:type
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
OWL
Web Ontology Language.
First version (2004), OWL 2 (2009)
Based on description logics
Language to describe classes, individuals, relationships
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
OWL example
<> a owl:Ontology .
:Man a owl:Class ;
owl:equivalentClass [
owl:intersectionOf (:Person
[ a owl:Restriction ;
owl:onProperty schema:gender ; owl:hasValue schema:Male
] )
] .
:Woman a owl:Class ;
owl:equivalentClass [
owl:intersectionOf ( :Person
[ a owl:Restriction ;
owl:onProperty schema:gender ; owl:hasValue schema:Female
] )
] .
[ a owl:AllDisjointClasses ; owl:members ( :Woman :Man ) ] .
:Person owl:equivalentClass [ rdf:type owl:Class ;
owl:unionOf ( :Woman :Man )
] .
:alice a :Woman ;
schema:gender schema:Female .
:bob a :Man .
:alice a :Person .
:bob a :Person .
:bob schema:gender schema:Male .
Instance data
Inferred data
Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
OWL
OWL can been used to describe domain ontologies
Different kinds of ontologies:
Upper level ontologies (SUMO, WordNet, ...)
Domain specific (example: SNOMED)
Tools to edit ontologies: Protégé editor

More Related Content

What's hot (20)

PDF
An Introduction to SPARQL
Olaf Hartig
 
PPTX
Knowledge Graph Introduction
Sören Auer
 
PPTX
SPARQL introduction and training (130+ slides with exercices)
Thomas Francart
 
PPTX
Dspace 7 presentation
mohamed Elzalabany
 
PDF
Introduction to the Open Refine RDF tool
European Commission
 
PPTX
The Semantic Web #6 - RDF Schema
Myungjin Lee
 
PDF
Introduction of Knowledge Graphs
Jeff Z. Pan
 
PPTX
Introduction to RDF Data Model
Cesar Augusto Nogueira
 
PDF
Ontologies and semantic web
Stanley Wang
 
PPT
Understanding RDF: the Resource Description Framework in Context (1999)
Dan Brickley
 
PDF
DSpace 7 - The Power of Configurable Entities
Atmire
 
PPT
Introduction To RDF and RDFS
Nilesh Wagmare
 
PPTX
SPARQL Cheat Sheet
LeeFeigenbaum
 
PDF
Intro to Neo4j and Graph Databases
Neo4j
 
PDF
Knowledge Graphs & Graph Data Science, More Context, Better Predictions - Neo...
Neo4j
 
PPTX
Introduction to DSpace
Bharat Chaudhari
 
PPTX
Dspace software
Santosh Kumar Kori
 
PDF
Linked Data and Knowledge Graphs -- Constructing and Understanding Knowledge ...
Jeff Z. Pan
 
PPTX
FAIR data overview
Luiz Olavo Bonino da Silva Santos
 
PDF
Information retrieval concept, practice and challenge
Gan Keng Hoon
 
An Introduction to SPARQL
Olaf Hartig
 
Knowledge Graph Introduction
Sören Auer
 
SPARQL introduction and training (130+ slides with exercices)
Thomas Francart
 
Dspace 7 presentation
mohamed Elzalabany
 
Introduction to the Open Refine RDF tool
European Commission
 
The Semantic Web #6 - RDF Schema
Myungjin Lee
 
Introduction of Knowledge Graphs
Jeff Z. Pan
 
Introduction to RDF Data Model
Cesar Augusto Nogueira
 
Ontologies and semantic web
Stanley Wang
 
Understanding RDF: the Resource Description Framework in Context (1999)
Dan Brickley
 
DSpace 7 - The Power of Configurable Entities
Atmire
 
Introduction To RDF and RDFS
Nilesh Wagmare
 
SPARQL Cheat Sheet
LeeFeigenbaum
 
Intro to Neo4j and Graph Databases
Neo4j
 
Knowledge Graphs & Graph Data Science, More Context, Better Predictions - Neo...
Neo4j
 
Introduction to DSpace
Bharat Chaudhari
 
Dspace software
Santosh Kumar Kori
 
Linked Data and Knowledge Graphs -- Constructing and Understanding Knowledge ...
Jeff Z. Pan
 
Information retrieval concept, practice and challenge
Gan Keng Hoon
 

Similar to RDF, linked data and semantic web (20)

PPTX
Linked Data MLA 2015
Cason Snow
 
PPTX
Linked data MLA 2015
Cason Snow
 
PPT
Future of Web 2.0 & The Semantic Web
is20090
 
PDF
Introduction to linked data
Laura Po
 
PPTX
TPDL2013 tutorial linked data for digital libraries 2013-10-22
jodischneider
 
PPTX
Linked open data project
Faathima Fayaza
 
PPTX
Linked data HHS 2015
Cason Snow
 
PDF
Open data and linked data
Marie Gustafsson Friberger
 
PDF
FAIR data: LOUD for all audiences
Alessandro Adamou
 
PDF
Intro to Exhibit Workshop
Shawn Day
 
PDF
Methodological Guidelines for Publishing Linked Data
Boris Villazón-Terrazas
 
PPTX
Intro to the semantic web (for libraries)
robin fay
 
PPTX
2011 05-02 linked data intro
vafopoulos
 
PPTX
Sem webmaubeuge
Jose Emilio Labra Gayo
 
PPTX
2011 05-01 linked data
vafopoulos
 
PDF
ESWC SS 2013 - Thursday Keynote Vassilis Christophides: Preserving linked data
eswcsummerschool
 
ODP
Linked Data
Danny Ayers
 
PDF
Linked Data
Anja Jentzsch
 
PPTX
Hack U Barcelona 2011
Peter Mika
 
PDF
Linked Open Data
Laura Hollink
 
Linked Data MLA 2015
Cason Snow
 
Linked data MLA 2015
Cason Snow
 
Future of Web 2.0 & The Semantic Web
is20090
 
Introduction to linked data
Laura Po
 
TPDL2013 tutorial linked data for digital libraries 2013-10-22
jodischneider
 
Linked open data project
Faathima Fayaza
 
Linked data HHS 2015
Cason Snow
 
Open data and linked data
Marie Gustafsson Friberger
 
FAIR data: LOUD for all audiences
Alessandro Adamou
 
Intro to Exhibit Workshop
Shawn Day
 
Methodological Guidelines for Publishing Linked Data
Boris Villazón-Terrazas
 
Intro to the semantic web (for libraries)
robin fay
 
2011 05-02 linked data intro
vafopoulos
 
Sem webmaubeuge
Jose Emilio Labra Gayo
 
2011 05-01 linked data
vafopoulos
 
ESWC SS 2013 - Thursday Keynote Vassilis Christophides: Preserving linked data
eswcsummerschool
 
Linked Data
Danny Ayers
 
Linked Data
Anja Jentzsch
 
Hack U Barcelona 2011
Peter Mika
 
Linked Open Data
Laura Hollink
 
Ad

More from Jose Emilio Labra Gayo (20)

PPTX
Publicaciones de investigación
Jose Emilio Labra Gayo
 
PPTX
Introducción a la investigación/doctorado
Jose Emilio Labra Gayo
 
PPTX
Challenges and applications of RDF shapes
Jose Emilio Labra Gayo
 
PPTX
Legislative data portals and linked data quality
Jose Emilio Labra Gayo
 
PPTX
Validating RDF data: Challenges and perspectives
Jose Emilio Labra Gayo
 
PPTX
Legislative document content extraction based on Semantic Web technologies
Jose Emilio Labra Gayo
 
PPTX
ShEx by Example
Jose Emilio Labra Gayo
 
PPTX
Introduction to SPARQL
Jose Emilio Labra Gayo
 
PPTX
Introducción a la Web Semántica
Jose Emilio Labra Gayo
 
PPTX
2017 Tendencias en informática
Jose Emilio Labra Gayo
 
PPTX
Introduction to SPARQL
Jose Emilio Labra Gayo
 
PPTX
19 javascript servidor
Jose Emilio Labra Gayo
 
PPTX
Como publicar datos: hacia los datos abiertos enlazados
Jose Emilio Labra Gayo
 
PPTX
16 Alternativas XML
Jose Emilio Labra Gayo
 
PPTX
Arquitectura de la Web y Computación en el Servidor
Jose Emilio Labra Gayo
 
PPTX
RDF validation tutorial
Jose Emilio Labra Gayo
 
PPTX
RDF Validation Future work and applications
Jose Emilio Labra Gayo
 
Publicaciones de investigación
Jose Emilio Labra Gayo
 
Introducción a la investigación/doctorado
Jose Emilio Labra Gayo
 
Challenges and applications of RDF shapes
Jose Emilio Labra Gayo
 
Legislative data portals and linked data quality
Jose Emilio Labra Gayo
 
Validating RDF data: Challenges and perspectives
Jose Emilio Labra Gayo
 
Legislative document content extraction based on Semantic Web technologies
Jose Emilio Labra Gayo
 
ShEx by Example
Jose Emilio Labra Gayo
 
Introduction to SPARQL
Jose Emilio Labra Gayo
 
Introducción a la Web Semántica
Jose Emilio Labra Gayo
 
2017 Tendencias en informática
Jose Emilio Labra Gayo
 
Introduction to SPARQL
Jose Emilio Labra Gayo
 
19 javascript servidor
Jose Emilio Labra Gayo
 
Como publicar datos: hacia los datos abiertos enlazados
Jose Emilio Labra Gayo
 
16 Alternativas XML
Jose Emilio Labra Gayo
 
Arquitectura de la Web y Computación en el Servidor
Jose Emilio Labra Gayo
 
RDF validation tutorial
Jose Emilio Labra Gayo
 
RDF Validation Future work and applications
Jose Emilio Labra Gayo
 
Ad

Recently uploaded (20)

PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Digital Circuits, important subject in CS
contactparinay1
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 

RDF, linked data and semantic web

  • 1. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDF, linked data and semantic web Departamento de Informática Universidad de Oviedo Jose Emilio Labra Gayo
  • 2. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra About me Main researcher WESO research group (WEb Semántics Oviedo) Author of the following books: http://www.di.uniovi.es/~labra Web Semántica (2012) Validating RDF Data (2017)
  • 3. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Structure of presentation Why RDF? RDF data model RDF ecosystem RDF applications Inference systems: RDFS, OWL SPARQL Challenges
  • 4. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Why RDF?
  • 5. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra
  • 6. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra The flood of data Producing data is more and more easy Open trends Open Software Open Content Open Data Open Science Open Government Old models are affected Músic, Films, finance,... Education Government ...
  • 7. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Why? Reasons for governments Transparency Leadership Government as catalyzer Promote participation New initiatives and apps Reasons for citizens Data belong to us Created with public money We want better services
  • 8. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra OK, long live to data! but…
  • 9. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Problems of current web It is not enough to publish data It must be found If not found, as if it doesn't exist It must be usable If not usable, it is worthless Reuse data in unexpected contexts
  • 10. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Semantic loss When publishing data, some semantics is lost The person that wants to publish has more info about the data Some info is lost during the publication process publisher party next saturday Formats: HTML, PDF, JPG, ... consumer (person) consumer (agent) party next saturday Semantics 9/Dec/2017 Data published
  • 11. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra HTML doesn't have enough semantics HTML is intended to publish hypertext HTML tags are understood by browsers Information inside tags = natural language Machines don't understand natural language yet <p>Event: <ul> <li>Name: Concert</li> <li>Date: Next saturday</li> </ul> </p> <p>իրադարձություն: <ul> <li>տիպ: համերգ</li> <li>ամսաթիվ: հաջորդ շաբաթ/li> </ul> </p>
  • 12. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra XML problem XML goes a step forward Specific vocabularies have meaning in some specific context Specific applications can process XML documents XML documents are difficult to integrate if they are from different domains <event> <name>համերգ</name> <date>հաջորդ շաբաթ</date> </event> <event> <name>Concert</name> <date>Next saturday</date> </event> <իրադարձություն> <տիպ>համերգ</տիպ> <ամսաթիվ>հաջորդ շաբաթ</ամսաթիվ> </իրադարձություն>
  • 13. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Json problem JSON is almost the same as XML It may be easier to parse and processby developers But the meaning depends on each domain It is even worse as there are no namespaces or validation { "event": { "name": "Party" , "date": "Next saturday" } } { "event": { "name": "համերգ" , "date": "հաջորդ շաբաթ" } }{ "իրադարձություն": { "տիպ": "համերգ" , "ամսաթիվ": "հաջորդ շաբաթ" } }
  • 14. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Towards semantic web Semantic web = vision of the data web Tim Berners Lee Source: Wikipedia Goal: Share and Reuse data between applications, and communities From a web of documents to a web of data
  • 15. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Benefits Accessible data Avoid semantic loss Facilitate task automation Linked data Data reuse Application integration The best way to use your data will be found by other people Jo Walsh, Rufus Pollock, http://www.okfn.org/files/talks/xtech_2007/
  • 16. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Web features Non centralized Difficult to ensure data integrity and quality Dynamic information Information is constantly changing Big amounts of information Big data 3Vs: Volume, Velocity, Variety Open system AAA lemma: Anyone can say Anything about Any topic
  • 17. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Biggest challenge = Integration In general, the challenge is not to computerize something The challenge is integrate systems Interoperability It is not enough to publish data…
  • 18. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Publish = make something accessible Accessibility levels Physical disability Technical disability: other environments Cultural and intellectual Illiteracy Knowledge barriers Other languages… Accessible to machines
  • 19. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Star model* ★ Publish data (any format) ★★ Use structured formats (Excel instead of scanned pictures) ★★★ Non proprietary structured formats (CSV instead of Excel) ★★★★ Use URIs to identify data (other systems can link to our data) ★★★★★ Link to other data (provide contextual information) * Tim Berners-Lee, Gov 2.0 Expo 2010 http://www.youtube.com/watch?v=ga1aSJXCFe0
  • 20. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Unstructured formats Black box formats: Pictures, video, audio, etc. Binary formats: PDF, PS, etc. They require low level techniques, pattern recognition, signal processing, etc ★
  • 21. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Structured formats Data have some structure Example: Excel Problem with proprietary formats May require non-free tools ★ ★
  • 22. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Non-proprietary formats Use open-structured formats Examples: CSV, HTML Problem: Content depends on context ★ ★ ★
  • 23. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra URIs identify data Use URIs to identify data Content negotiation can provide different representations ★ ★ ★ ★ Example
  • 24. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Example: RDF ★ ★ ★ ★ <http://www.sepe.es/data/unemployment/Asturias/Allande/2013/10> HTML? @prefix sepe: <http://www.sepe.es/datos/> sepe:obs1 sepe:municipality "Allande" ; sepe:unemployees 18 . RDF?
  • 25. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Link with other data Representations return links to other data It allos to: Reuse and find other data Unforeseen applications ★ ★ ★ ★ ★
  • 26. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Linked data example ★ ★ ★ ★ ★ <http://www.sepe.es/data/unemployment/Asturias/Allande/2013/10> HTML? @prefix sepe: <http://www.sepe.es/data/> sepe:obs1 sepe:municipality dbo:allande; sepe:unemployees 23 . RDF? dbo:allande dbo:areaTotal 342.24 ; rdf:type <http:/.../municipalitiesInAsturias> ; dbo:country <http:/.../Spain> ; dbo:populationTotal 2106 ; . . .
  • 27. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Linked Open Data principles 1. Use URIs to denote things 2. Use HTTP URIs so that people can look up those names 3. When someone looks up a URI, provide useful information, using the standards (RDF*, SPARQL) 4. Include links to other URIs. so that they can discover more things. ★ ★ ★ ★ ★
  • 28. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Linked open data (2007)
  • 29. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Linked open data (2008)
  • 30. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Linked open data (2009)
  • 31. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Linked open data (2014)
  • 32. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Linked open data (2017) Fuente: "Linking Open Data cloud diagram 2017, by Andrejs Abele, John P. McCrae, Paul Buitelaar, Anja Jentzsch and Richard Cyganiak. http://lod-cloud.net/"
  • 33. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDF Data Model
  • 34. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Short history of RDF RDF: Resource Description Framework Around 1997 - PICS, Dublin core, Meta Content Framework 1997 1st Working draft https://www.w3.org/TR/WD-rdf-syntax-971002 RDF/XML 1999 1st W3C Rec https://www.w3.org/TR/1999/REC-rdf-syntax-19990222/ XML Syntax, first applications RSS, EARL 2004 - RDF Revised https://www.w3.org/TR/2004/REC-rdf-concepts-20040210/ Emergence of SPARQL, Turtle, Linked Data 2014 - RDF 1.1 https://www.w3.org/TR/rdf11-concepts/ SPARQL 1.1, JSON-LD 2017 - RDF validation: SHACL/ShEx
  • 35. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDF Data Model RDF is made from statements Statment = a triple (subject, predicate, object) Example: http://example.org/alice http://example.org/bob http://schema.org/knows subject predicate object <http://example.org/alice> <http://schema.org/knows> <http://example.org/bob> . N-Triples representation subject object predicate
  • 36. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Set of statements = RDF graph RDF data model = directed graph Example: http://example.org/alice ex:bob http://example.org/carol http://example.org/bob http://schema.org/knows http://schema.org/knows http://schema.org/knows http://schema.org/knows N-triples representation <http://example.org/alice> <http://schema.org/knows> <http://example.org/bob> . <http://example.org/bob> <http://schema.org/knows> <http://example.org/carol> . <http://example.org/carol> <http://schema.org/knows> <http://example.org/alice> . <http://example.org/carol> <http://schema.org/knows> <http://example.org/bob> . subject predicate object
  • 37. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Turtle notation Human readable notation that simplifies N-Triples Allows namespace declarations <http://example.org/alice> <http://schema.org/knows> <http://example.org/bob> . <http://example.org/bob> <http://schema.org/knows> <http://example.org/carol> . <http://example.org/carol> <http://schema.org/knows> <http://example.org/alice> . <http://example.org/carol> <http://schema.org/knows> <http://example.org/bob> . prefix : <http://example.org/> prefix schema: <http://schema.org/> :alice schema:knows :bob . :bob schema:knows :carol . :carol schema:knows :bob . :carol schema:knows :alice . Turtle N-Triples Note: We will see later other Turtle simplifications
  • 38. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Namespaces simplification http://example.org/alice ex:bob http://example.org/carol http://example.org/bob http://schema.org/knows http://schema.org/knows http://schema.org/knows http://schema.org/knows :alice ex:bob :carol :bob schema:knows schema:knows schema:knows schema:knows
  • 39. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDF is compositional RDF graphs can be merged to obtain a bigger graph Automatic data integration schema:knows schema:knows schema:knows :alice ex:bob :carol :bob schema:knows schema:birthPlace :carol schema:birthPlace dbr:Oviedo :bob graph 1 graph 2
  • 40. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDF is compositional RDF graphs can be merged to obtain a bigger graph Automatic data integration schema:birthPlaceschema:knows schema:knows schema:knows :alice ex:bob :carol schema:birthPlace dbr:Oviedo :bob schema:knows graph 1 + graph 2
  • 41. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Turtle syntax Some simplifications prefix declarations ; when triples share the subject , when triples share subject and object :alice schema:birthPlace dbr:Oviedo ; schema:knows :bob . :alice schema:birthPlace dbr:Oviedo . :alice schema:knows :bob . :alice schema:knows :alice . :alice schema:knows :bob . :carol schema:knows :alice , :bob .
  • 42. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Turtle syntax Exercise: simplify prefix : <http://example.org/> prefix schema: <http://schema.org/> prefix dbr: <http://dbpedia.org/resource> :alice schema:knows :bob . :bob schema:knows :carol . :carol schema:knows :bob . :carol schema:knows :alice . :bob schema:birthPlace dbr:Spain . :carol schema:birthPlace dbr:Spain . prefix ex: <http://example.org/> prefix schema: <http://schema.org/> prefix dbr: <http://dbpedia.org/resource> :alice schema:knows :bob , :carol. :bob schema:knows :carol ; schema:birthPlace dbr:Spain . :carol schema:knows :bob, :alice ; schema:birthPlace dbr:Spain . Try it: https://tinyurl.com/y9wbdycp
  • 43. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDF Literals Objects can also be literals Literals contain a lexical form and a datatype Typical datatypes = XML Schema primitive datatypes If not specified, a literal has datatype xsd:string :bob Robert schema:name 1980-03-10 schema:birthDate xsd:date xsd:string :bob schema:name "Robert" ; :bob schema:birthDate "1980-03-10"^^<xsd:date>. Turtle notation
  • 44. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Remember...RDF is compositional Merging previous data schema:birthPlaceschema:knows schema:knows schema:knows :alice ex:bob :carol dbr:Spain schema:birthDate :bob Robert xsd:string 1980-03-10 xsd:date schema:name schema:knows prefix : <http://example.org/> prefix schema: <http://schema.org/> prefix dbr: <http://dbpedia.org/resource> :alice schema:knows :bob , :carol. :bob schema:knows :carol ; schema:birthPlace dbr:Spain; schema:name "Robert"; schema:birthDate "1980-03-10"^^<xsd:date>. :carol schema:knows :bob, :alice ; schema:birthPlace dbr:Spain . schema:birthPlace
  • 45. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Blank nodes Subjects and objects can also be Blank nodes :carol schema:knows 23 :age "Carol knows someone whose age is 23" :carol schema:knows _:x . _:x :age 23 . :carol schema:knows [ :age 23 ] . Turtle notation with local identifier Turtle notation with square brackets x(schema:knows(:carol,x)  :age(x, 23) Mathematical meaning:
  • 46. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Blank nodes ex:alice ex:carol schema:knows schema:knows schema:birthPlace ex:dave schema:birthPlace :age 23 xsd:integer schema:knows Alice knows someone who knows Dave Carol knows someone whose age is 23 that was born in the same place as Dave :alice schema:knows [ schema:knows :dave ] . :carol schema:knows [ :age 23 ; schema:birthPlace _:p ] . :dave schema:birthPlace _:p .
  • 47. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Language tagged strings String literals can be qualified by a language tag They have datatype rdfs:langString ex:spain rdfs:label "Spain"@en . ex:spain rdfs:label "España"@es .ex:spain Spain rdfs:label España rdfs:label es en Turtle notation
  • 48. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDF data model schema:knows schema:knows schema:knows ex:alice ex:bob ex:carol schema:birthPlace dbr:Spain schema:knows schema:knows schema:birthDate ex:bob Robert xsd:string 1980-03-10 xsd:date schema:name schema:birthPlace schema:knows ex:dave schema:birthPlace schema:age 23 xsd:integerschema:knows Spain rdfs:label España rdfs:label es en 3 types of nodes URIs Blank nodes Literals Subjects: URIs or Blank nodes Objects: URIs, Blank nodes or literals Predicates always URIs schema:birthPlace
  • 49. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra ...and that's all about the RDF data model The RDF Data model is very simple
  • 50. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDF ecosystem RDF Syntax Shared entities and RDF vocabularies Applications of RDF Inference and ontologies Query languages RDF Validation
  • 51. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDF syntax First syntax based on XML: RDF/XML N-Triples (enumerates all triples separated by dots) Turtle (human readability) JSON-LD ...other syntaxes...
  • 52. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDF/XML <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://example.org/" xmlns:schema="http://schema.org/"> <rdf:Description rdf:about="http://example.org/carol"> <schema:knows> <rdf:Description rdf:about="http://example.org/bob"> <schema:knows rdf:resource="http://example.org/carol"/> <schema:name>Robert</schema:name> <schema:birthDate rdf:datatype="xsd:date">1980-03-10</schema:birthDate> </rdf:Description> </schema:knows> <schema:knows> <rdf:Description rdf:about="http://example.org/alice"> <schema:knows rdf:resource="http://example.org/bob"/> <schema:knows rdf:resource="http://example.org/carol"/> </rdf:Description> </schema:knows> <schema:knows rdf:parseType="Resource"> <age rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">23</age> </schema:knows> </rdf:Description> </rdf:RDF> First syntax
  • 53. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra N-Triples <http://example.org/carol> <http://schema.org/knows> <http://example.org/bob> . <http://example.org/carol> <http://schema.org/knows> <http://example.org/alice> . <http://example.org/carol> <http://schema.org/knows> _:x . _:x <http://example.org/age> "23"^^<http://www.w3.org/2001/XMLSchema#integer> . <http://example.org/alice> <http://schema.org/knows> <http://example.org/bob> . <http://example.org/alice> <http://schema.org/knows> <http://example.org/carol> . <http://example.org/bob> <http://schema.org/knows> <http://example.org/carol> . <http://example.org/bob> <http://schema.org/name> "Robert" . <http://example.org/bob> <http://schema.org/birthDate> "1980-03-10"^^<xsd:date> . For testing and easy parsing ...just triples separated by dots
  • 54. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Turtle Designed to be human-readable prefix : <http://example.org/> prefix schema: <http://schema.org/> :alice schema:knows :bob , :carol . :bob schema:knows :carol ; schema:name "Robert"; schema:birthDate "1980-03-10"^^<xsd:date>. :carol schema:knows :bob, :alice ; schema:knows [ :age 23 ] .
  • 55. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra JSON-LD Json for linked data { "@context" : { "knows" : { "@id" : "http://schema.org/knows", "@type" : "@id" }, "age" : { "@id" : "http://example.org/age", "@type" : "http://www.w3.org/2001/XMLSchema#integer" }, "name" : { "@id" : "http://schema.org/name" }, "birthDate" : { "@id" : "http://schema.org/birthDate", "@type" : "xsd:date" }, "@vocab" : "http://example.org/", "schema" : "http://schema.org/" }, "@graph" : [ { "@id" : "http://example.org/alice", "knows" : [ "http://example.org/bob", "http://example.org/carol" ] }, { "@id" : "http://example.org/bob", "birthDate" : "1980-03-10", "knows" : "http://example.org/carol", "name" : "Robert" }, { "@id" : "http://example.org/carol", "knows" : [ "http://example.org/bob", "http://example.org/alice", "_:x" ] }, { "@id" : "_:x", "http://example.org/age" : 23 } ] }
  • 56. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Other Turtle simplifications RDF type property Numbers Collections
  • 57. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDF type property The rdf:type property declares the type of a resource @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. @prefix schema: <http://schema.org/> . e:alice rdf:type schema:Person . e:bob rdf:type schema:Person . @prefix schema: <http://schema.org/> . :alice a schema:Person . :bob a schema:Person . rdf:type can be simplified as a
  • 58. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Constants Numbers and boolean values can be represented without quotes They are parsed as XML Schema datatypes Datatype Shorthand example Lexical example xsd:integer 3 "3"^^xsd:integer xsd:decimal -3.14 "true"^^xsd:decimal xsd:double 3.14e2 "true"^^xsd:double xsd:boolean true "true"^^xsd:boolean
  • 59. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Collections Ordered lists rdf:first rdf:rest rdf:rest rdf:rest schema:name :m23 :results New York City Marathon rdf:nil :bob rdf:first :alice :dave :m23 schema:name "New York City Marathon "; :results ( :dave :alice :bob ) . :m23 schema:name "New York City Marathon "; :results _:1 . _:1 rdf:first :dave ; rdf:next _:2 . _:2 rdf:first :alice ; rdf:next _:3 . _:3 rdf:first :bob ; rdf:next rdf:nil . Internally, represented as linked lists rdf:first
  • 60. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Shared entities and vocabularies The use of URIs instead of plain strings facilitates: Merging data from heterogeneous sources Avoid ambiguity Challenge: Agreeing on common entities and properties Appearance of some popular vocabularies: schema.org: Joint effort from Google, Yahoo, Microsoft, Yandex Linked open vocabularies Project: http://lov.okfn.org/
  • 61. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Some popular vocabularies and namespaces Alias URL Name Some properties rdf: http://www.w3.org/1999/02/22-rdf-syntax- ns# RDF type, subject, predicate, object,… rdfs: http://www.w3.org/2000/01/rdf-schema# RDF Schema domain, range Class, Property subClassOf,… owl: http://www.w3.org/2002/07/owl# OWL Ontologías sameAs, intersectionOf unionOf, … dc: http://purl.org/dc/elements/1.1/ Dublin Core author, date, creator, … schema http://schema.org/ Schema.org name, knows, etc. skos: http://www.w3.org/2008/05/skos# SKOS Simple Knowledge Organization System broader, narrower, Service http://prefix.cc can be used to find the most popular prefix for some URI
  • 62. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra Applications of RDF First applications RDF & HTML: RDFa, Microdata RDF to represent knowledge RDF as an internal database Linked data
  • 63. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra First RDF applications Some initiatives proposed by W3C RSS 1.0 was proposed with an RDF/XML based syntax Other XML based versions were available EARL: Evaluation and Reporting Language RDF/XML adoption was not popular
  • 64. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDF & HTML Possibilities One resource for HTML and another for metadata in RDF RDFa: Use HTML attributes to encode RDF triples Microdata: New HTML5 attributes can encode metadata <p vocab="http://schema.org/" typeof="Book" about="http://example.org/book1"> The book <span property="name">The Spring</span> by <span property="author">Cervantes</span> was published <span property="datePublished" content="2014-05-04"> last Saturday</span>. </p> <p itemscope itemid="http://leer.com/libro123" itemtype="http://schema.org/Book"> The book <span itemprop="name">The Spring</span> by <span itemprop="author">Cervantes</span> was published <time itemprop="datePublished" content="2014-05-04"> last saturday</time>. </p> RDFa Microdata
  • 65. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDF to represent knowledge Freebase: developed by Metaweb (2005) Open, shared database of world's knowledge Acquired by Google in 2010. It is the basis of Google knowledge graph DBpedia (http://dbpedia.org) Extracts knowledge from Wikipedia and converts it to RDF Wikidata (http://wikidata.org/) Free knowledge base edited collaboratively Developed by Wikimedia foundation
  • 66. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDF as an internal database Specialized RDF databases (triplestores) RDF = very flexible, easy to adapt to domain changes Several big companies are using RDF internally Example: BBC, Europeana
  • 67. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDF for Linked open data Principles proposed by Tim Berners-Lee to publish data: 1. Use URIs to denote things 2. Use HTTP URIs so that people can look up those names 3. When someone looks up a URI, provide useful information, using the standards (RDF*, SPARQL) 4. Include links to other URIs. so that they can discover more things.
  • 68. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDF as the basis of Semantic Web RDF = lingua franca of Semantic Web Semantic web layer cake URIUnicode XML + Namespaces + XML Schema Proof RDF + RDF Schema Ontologies Logic Trust First version proposed by Tim Berners Lee, year 2000 http://www.w3.org/2000/Talks/1206-xml2k-tbl/slide10-0.html
  • 69. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDF as the basis of Semantic Web RDF = lingua franca of Semantic Web Semantic web layer cake (revised) URIUnicode XML/JSON/... RDF Query: SPARQL RDFS Ontologies OWL Trust Unifying Logic Rules RIF Proof Validation SHACL ShEx
  • 70. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDFS & inferences
  • 71. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDFS Originally RDF Schema (2000) Defines a vocabulary for common concepts Classes: rdfs:Class, rdfs:Property, rdfs:Literal Properties: rdfs:domain, rdfs:range, rdfs:subClassOf, ...
  • 72. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra RDFS RDFS processors can infer new triples RDFS defines several rules for inference: IF x rdf:type A AND A rdfs:subClassOf B THEN x rdf:type B :alice :Lecturer rdf:type :Person rdfs:subClassOf rdf:type
  • 73. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra OWL Web Ontology Language. First version (2004), OWL 2 (2009) Based on description logics Language to describe classes, individuals, relationships
  • 74. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra OWL example <> a owl:Ontology . :Man a owl:Class ; owl:equivalentClass [ owl:intersectionOf (:Person [ a owl:Restriction ; owl:onProperty schema:gender ; owl:hasValue schema:Male ] ) ] . :Woman a owl:Class ; owl:equivalentClass [ owl:intersectionOf ( :Person [ a owl:Restriction ; owl:onProperty schema:gender ; owl:hasValue schema:Female ] ) ] . [ a owl:AllDisjointClasses ; owl:members ( :Woman :Man ) ] . :Person owl:equivalentClass [ rdf:type owl:Class ; owl:unionOf ( :Woman :Man ) ] . :alice a :Woman ; schema:gender schema:Female . :bob a :Man . :alice a :Person . :bob a :Person . :bob schema:gender schema:Male . Instance data Inferred data
  • 75. Jose Emilio Labra Gayo http://www.di.uniovi.es/~labra OWL OWL can been used to describe domain ontologies Different kinds of ontologies: Upper level ontologies (SUMO, WordNet, ...) Domain specific (example: SNOMED) Tools to edit ontologies: Protégé editor