Graph data formats:�RDF, RDFS, Linked Data
Jakub Klímek
This work is licensed under a Creative Commons Attribution 4.0 International License.
2
Graph data representation
There is a thing, which is a catalog
3
The catalog has title “my catalog”
The catalog has description�“my first testing catalog”
The catalog has homepage “https://mycatalog.example.org/homepage”
Graph data representation
There is a thing, which is a catalog
4
The catalog has title “my catalog”
The catalog has description�“my first testing catalog”
The catalog has homepage “https://mycatalog.example.org/homepage”
Graph data representation
There is a thing, which is a catalog
5
Catalog
which is a
Graph data representation
There is a thing, which is a catalog
6
The catalog has title “my catalog”
Catalog
"my catalog"
which is a
has title
Graph data representation
There is a thing, which is a catalog
7
7
The catalog has title “my catalog”
The catalog has description�“my first testing catalog”
Catalog
"my catalog"
which is a
has title
"my first testing catalog"
has description
Graph data representation
There is a thing, which is a catalog
8
8
The catalog has title “my catalog”
The catalog has description�“my first testing catalog”
The catalog has homepage “https://mycatalog.example.org/homepage”
Catalog
"my catalog"
https://mycatalog.example.org/homepage
which is a
has title
has homepage
"my first testing catalog"
has description
Graph data representation
There is a thing, which is a catalog
9
9
The catalog has title “my catalog”
The catalog has description�“my first testing catalog”
The catalog has homepage “https://mycatalog.example.org/homepage”
Catalog
"my catalog"
https://mycatalog.example.org/homepage
which is a
has title
has homepage
"my first testing catalog"
has description
Page
which is a
The homepage is a page
Graph data representation
There is a thing, which is a catalog
10
The catalog has title “my catalog”
The catalog has description�“my first testing catalog”
The catalog has homepage “https://mycatalog.example.org/homepage”
https://mycatalog.example.org/catalog
Catalog
"my catalog"
https://mycatalog.example.org/homepage
which is a
has title
"my first testing catalog"
has description
has homepage
Page
which is a
The homepage is a page
Graph data representation
There is a thing, which is a catalog
11
The catalog has title “my catalog”
The catalog has description�“my first testing catalog”
The catalog has homepage “https://mycatalog.example.org/homepage”
https://mycatalog.example.org/catalog
http://www.w3.org/ns/dcat#Catalog
"my catalog"
https://mycatalog.example.org/homepage
which is a
has title
"my first testing catalog"
has description
The homepage is a page
has homepage
Page
which is a
Graph data representation
There is a thing, which is a catalog
12
The catalog has title “my catalog”
The catalog has description�“my first testing catalog”
The catalog has homepage “https://mycatalog.example.org/homepage”
https://mycatalog.example.org/catalog
http://www.w3.org/ns/dcat#Catalog
"my catalog"
https://mycatalog.example.org/homepage
which is a
http://purl.org/dc/terms/title
"my first testing catalog"
has description
has homepage
Page
which is a
The homepage is a page
Graph data representation
There is a thing, which is a catalog
13
The catalog has title “my catalog”
The catalog has description�“my first testing catalog”
The catalog has homepage “https://mycatalog.example.org/homepage”
https://mycatalog.example.org/catalog
http://www.w3.org/ns/dcat#Catalog
"my catalog"
https://mycatalog.example.org/homepage
which is a
http://purl.org/dc/terms/title
"my first testing catalog"
http://purl.org/dc/terms/description
The homepage is a page
has homepage
Page
which is a
Graph data representation
There is a thing, which is a catalog
14
The catalog has title “my catalog”
The catalog has description�“my first testing catalog”
The catalog has homepage “https://mycatalog.example.org/homepage”
https://mycatalog.example.org/catalog
http://www.w3.org/ns/dcat#Catalog
"my catalog"
https://mycatalog.example.org/homepage
which is a
http://purl.org/dc/terms/title
"my first testing catalog"
http://purl.org/dc/terms/description
The homepage is a page
http://xmlns.com/foaf/0.1/homepage
Page
which is a
Graph data representation
There is a thing, which is a catalog
15
The catalog has title “my catalog”
The catalog has description�“my first testing catalog”
The catalog has homepage “https://mycatalog.example.org/homepage”
https://mycatalog.example.org/catalog
http://www.w3.org/ns/dcat#Catalog
"my catalog"
https://mycatalog.example.org/homepage
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
http://purl.org/dc/terms/title
"my first testing catalog"
http://purl.org/dc/terms/description
The homepage is a page
http://xmlns.com/foaf/0.1/homepage
Page
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
Graph data representation
There is a thing, which is a catalog
16
The catalog has title “my catalog”
The catalog has description�“my first testing catalog”
The catalog has homepage “https://mycatalog.example.org/homepage”
https://mycatalog.example.org/catalog
http://www.w3.org/ns/dcat#Catalog
"my catalog"
https://mycatalog.example.org/homepage
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
http://purl.org/dc/terms/title
"my first testing catalog"
http://purl.org/dc/terms/description
The homepage is a page
http://xmlns.com/foaf/0.1/homepage
http://xmlns.com/foaf/0.1/Page
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
Graph data representation
There is a thing, which is a catalog
17
The catalog has title “my catalog”
The catalog has description�“my first testing catalog”
The catalog has homepage “https://mycatalog.example.org/homepage”
ex:catalog
dcat:Catalog
"my catalog"
ex:homepage
rdf:type
dcterms:title
"my first testing catalog"
dcterms:description
The homepage is a page
foaf:homepage
foaf:Page
rdf:type
a statement, a triple
Graph data representation
ex:catalog rdf:type dcat:Catalog .
18
The catalog has title “my catalog”
The catalog has description�“my first testing catalog”
The catalog has homepage “https://mycatalog.example.org/homepage”
ex:catalog
dcat:Catalog
"my catalog"
ex:homepage
rdf:type
dcterms:title
"my first testing catalog"
dcterms:description
The homepage is a page
foaf:homepage
foaf:Page
rdf:type
a statement, a triple
Graph data representation
ex:catalog rdf:type dcat:Catalog .
19
ex:catalog dcterms:title "my catalog" .
The catalog has description�“my first testing catalog”
The catalog has homepage “https://mycatalog.example.org/homepage”
ex:catalog
dcat:Catalog
"my catalog"
ex:homepage
rdf:type
dcterms:title
"my first testing catalog"
dcterms:description
The homepage is a page
foaf:homepage
foaf:Page
rdf:type
Graph data representation
ex:catalog rdf:type dcat:Catalog .
20
ex:catalog dcterms:description �"my first testing catalog" .
The catalog has homepage “https://mycatalog.example.org/homepage”
ex:catalog
dcat:Catalog
"my catalog"
ex:homepage
rdf:type
dcterms:title
"my first testing catalog"
dcterms:description
The homepage is a page
foaf:homepage
foaf:Page
rdf:type
ex:catalog dcterms:title "my catalog" .
Graph data representation
ex:catalog rdf:type dcat:Catalog .
21
ex:catalog dcterms:description �"my first testing catalog" .
ex:catalog foaf:homepage ex:homepage .
ex:catalog
dcat:Catalog
"my catalog"
ex:homepage
rdf:type
dcterms:title
"my first testing catalog"
dcterms:description
The homepage is a page
foaf:homepage
foaf:Page
rdf:type
ex:catalog dcterms:title "my catalog" .
Graph data representation
ex:catalog rdf:type dcat:Catalog .
22
ex:catalog dcterms:description �"my first testing catalog" .
ex:catalog foaf:homepage ex:homepage .
ex:catalog
dcat:Catalog
"my catalog"
ex:homepage
rdf:type
dcterms:title
"my first testing catalog"
dcterms:description
ex:homepage rdf:type foaf:Page .
foaf:homepage
foaf:Page
rdf:type
ex:catalog dcterms:title "my catalog" .
Graph data representation
ex:catalog rdf:type dcat:Catalog .�ex:catalog dcterms:title "my catalog" .�ex:catalog dcterms:description "my first testing catalog" .�ex:catalog foaf:homepage ex:homepage .�ex:homepage rdf:type foaf:Page .
There is a thing, which is a catalog
23
The catalog has title “my catalog”
The catalog has description�“my first testing catalog”
The catalog has homepage “https://mycatalog.example.org/homepage”
The homepage is a page
RDF
24
RDF - Resource Description Framework - idea
RDF - graph based data model - �a set of triples
Triple describes a relation as:
subject predicate object
2004 & 2014 W3C Recommendations
Triples are written in one of RDF notations / syntaxes / serializations:
RDF/XML, RDFa, N-Triples, Turtle, JSON-LD, N-Quads, TriG
25
Jakub Klímek studied at Charles University .
predicate
object
subject
Jakub Klímek Charles University
studied at
RDF model: a triple, a statement
<http://example.com/index.html> <http://purl.org/dc/terms/creator> <http://example.com/staff/8574> .
26
http://example.com/index.html
http://example.com/staff/8574
http://purl.org/dc/terms/creator
subject (S)
predicate (P)�(property)
object (O)
Resource / Thing
Resource / Thing
RDF model: a triple with literal value
<http://example.com/index.html> <http://purl.org/dc/terms/subject> "education" .
27
http://example.com/index.html
education
http://purl.org/dc/terms/subject
subject (S)
predicate (P)
object (O)
Resource
Literal
RDF serializations: IRIs and IRI prefixes
<http://purl.org/dc/terms/creator>
=
@prefix dcterms: <http://purl.org/dc/terms/> .
dcterms:creator
28
RDF model: multiple properties
my:index.html dcterms:creator exstaff:85740 .�my:index.html dcterms:subject "education" .�my:index.html dcterms:language "en" .
29
my:index.html
my:staff/85740
dcterms:creator
education
en
dcterms:language
dcterms:subject
a set�i.e. no ordering among triples
RDF model: typed literals
my:index.html dcterms:created "2020-04-23"^^xsd:date .
30
my:index.html
"2020-04-23"^^<http://www.w3.org/2001/XMLSchema#date>
dcterms:created
RDF model: text literals with a language tag
my:index.html dcterms:title "Homepage of Jakub Klímek"@en .
31
my:index.html
"Homepage of Jakub Klímek"@en
dcterms:title
RDF model: classes
32
my:Person
my:staff/85740
rdf:type
Resource
Resource
Class
RDF model: blank nodes
my:staff/85740 my:hasAddress _:a1 .
_:a1 my:street "Malostranske nam. 25" .�_:a1 my:city "Prague" .�_:a1 my:zipCode "11800" .
33
my:street
Prague
11800
my:zipCode
my:city
my:staff/85740
my:hasAddress
Malostranské nám. 25
RDF - Resource Description Framework
34
RDF serializations
35
RDF 1.1 N-Triples
36
<http://one.example/subject1> <http://one.example/predicate1> <http://one.example/object1> . # comments here
<http://example.org/show/218> <http://example.org/show/localName> "That Seventies Show"@en . # literal with a language tag
�<http://en.wikipedia.org/wiki/Helium> <http://example.org/elements/atomicNumber> "2"^^<http://www.w3.org/2001/XMLSchema#integer> . # xsd:integer
RDF 1.1 N-Triples
<http://example.com/index.html> <http://purl.org/dc/terms/created> "2020-04-23"^^<http://…#date> .
<http://example.com/index.html> <http://purl.org/dc/terms/creator> <http://example.com/staff/8574> .
<http://example.com/index.html> <http://purl.org/dc/terms/creator> <http://example.com/staff/8575> .
<http://example.com/index.html> <http://purl.org/dc/terms/title> "Moje stránka"@cs .
<http://example.com/index.html> <http://purl.org/dc/terms/title> "My page"@en .
37
RDF 1.1 Turtle - Prefixes
<http://example.com/index.html> <http://purl.org/dc/terms/created> "2020-04-23"^^<http://…#date> .
<http://example.com/index.html> <http://purl.org/dc/terms/creator> <http://example.com/staff/8574> .
<http://example.com/index.html> <http://purl.org/dc/terms/creator> <http://example.com/staff/8575> .
<http://example.com/index.html> <http://purl.org/dc/terms/title> "Moje stránka"@cs .
<http://example.com/index.html> <http://purl.org/dc/terms/title> "My page"@en .
38
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .�@prefix dcterms: <http://purl.org/dc/terms/> .�@prefix my: <http://example.com/> .�@prefix staff: <http://example.com/staff/> .��my:index.html dcterms:created "2020-04-23"^^xsd:date .
my:index.html dcterms:creator staff:8574 .
my:index.html dcterms:creator staff:8575 .
my:index.html dcterms:title "Moje stránka"@cs .
my:index.html dcterms:title "My page"@en .
RDF 1.1 Turtle - Prefixes and ";"
<http://example.com/index.html> <http://purl.org/dc/terms/created> "2020-04-23"^^<http://…#date> .
<http://example.com/index.html> <http://purl.org/dc/terms/creator> <http://example.com/staff/8574> .
<http://example.com/index.html> <http://purl.org/dc/terms/creator> <http://example.com/staff/8575> .
<http://example.com/index.html> <http://purl.org/dc/terms/title> "Moje stránka"@cs .
<http://example.com/index.html> <http://purl.org/dc/terms/title> "My page"@en .
39
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .�@prefix dcterms: <http://purl.org/dc/terms/> .�@prefix my: <http://example.com/> .�@prefix staff: <http://example.com/staff/> .��my:index.html dcterms:created "2020-04-23"^^xsd:date ;
dcterms:creator staff:8574 ;
dcterms:creator staff:8575 ;
dcterms:title "Moje stránka"@cs ;
dcterms:title "My page"@en .
RDF 1.1 Turtle - Prefixes and ";" and ","
<http://example.com/index.html> <http://purl.org/dc/terms/created> "2020-04-23"^^<http://…#date> .
<http://example.com/index.html> <http://purl.org/dc/terms/creator> <http://example.com/staff/8574> .
<http://example.com/index.html> <http://purl.org/dc/terms/creator> <http://example.com/staff/8575> .
<http://example.com/index.html> <http://purl.org/dc/terms/title> "Moje stránka"@cs .
<http://example.com/index.html> <http://purl.org/dc/terms/title> "My page"@en .
40
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .�@prefix dcterms: <http://purl.org/dc/terms/> .�@prefix my: <http://example.com/> .�@prefix staff: <http://example.com/staff/> .��my:index.html dcterms:created "2020-04-23"^^xsd:date ;
dcterms:creator staff:8574 ,
staff:8575 ;
dcterms:title "Moje stránka"@cs ,
"My page"@en .
RDF 1.1 Turtle - More prefixes
@prefix foo: <http://example.org/ns#> .�@prefix : <http://other.example.org/ns#> .
foo:bar foo: : .�:bar : foo:bar .
<http://example.org/ns#bar> <http://example.org/ns#> <http://other.example.org/ns#> .
<http://other.example.org/ns#bar> <http://other.example.org/ns#> <http://example.org/ns#bar> .
41
RDF 1.1 Turtle - Relative IRIs
Need to know, relative to WHAT the IRI is.
Assuming Document URL https://test.org/doc��@prefix foo: <http://example.org/ns#> .��<#document> foo: <https://jk.com> .��@base <http://newbase.com/> .�<#document> foo: <https://jk.com> .
<https://test.org/doc#document> <http://example.org/ns#> <https://jk.com> .
<http://newbase.com/#document> <http://example.org/ns#> <https://jk.com> .
42
RDF 1.1 Turtle - Multiline strings, escapes
"""a string�with newlines�"""
43
RDF 1.1 Turtle - Class assignment (rdf:type)
�<http://example.com/index.html> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> foaf:Document .
=
<http://example.com/index.html> a foaf:Document .
44
RDF 1.1 Turtle - blank nodes
<http://example.com/> a v:VCard ;� v:adr [
a v:Work ;
v:country-name "Australia" ;
v:locality "WonderCity" ;
v:postal-code "5555" ;
v:street-address "33 Enterprise Drive"
] ;
.
<http://example.com/> v:adr _:1234 .
_:1234 a v:Work ;
v:locality "WonderCity" ;
...
45
=
RDF 1.1 Turtle - datatype shortcuts
ex:Car ex:numberOfWheels 4 ;
ex:Car ex:numberOfWheels +4 ;
ex:Car ex:numberOfWheels "4"^^xsd:integer ;
ex:Car ex:value 1300000.0 ;
ex:Car ex:value "1300000.0"^^xsd:decimal ;
ex:Car ex:value 1.3e6 ;
ex:Car ex:value "1.3e6"^^xsd:double ;
ex:Car ex:leftHandDrive true ;
ex:Car ex:leftHandDrive "true"^^xsd:boolean ;
46
RDF 1.1 Turtle - playing with prefixes and rel. IRIs
# In-scope base IRI is the document URI at this point�<a1> <b1> <c1> .�@base <http://example.org/ns/> .��# In-scope base IRI is http://example.org/ns/ at this point�<a2> <http://example.org/ns/b2> <c2> .�@base <foo/> .��# In-scope base IRI is http://example.org/ns/foo/ at this point�<a3> <b3> <c3> .�@prefix : <bar#> .�:a4 :b4 :c4 .�@prefix : <http://example.org/ns2#> .�:a5 :b5 :c5 .
47
http://example.org/ns/c2
http://example.org/ns/foo/
http://example.org/ns/foo/c3
http://example.org/ns/foo/bar#
http://example.org/ns/foo/bar#c4
http://example.org/ns2#c5
Detour from RDF serializations
48
RDF model - statements about statements
my:index.html my:createdBy "Jakub Klímek" .
49
This statement
How to represent these facts in RDF?
RDF model - reification
Direct approach to the problem:
Statement will become a resource.
Original statement:
my:index.html my:createdBy "Jakub Klímek" .
Reified statement:
_:triple1 a rdf:Statement .
_:triple1 rdf:subject my:index.html .
_:triple1 rdf:predicate my:createdBy .
_:triple1 rdf:object "Jakub Klímek" .
50
Possibility of additional statements we need:
_:triple1 dcterms:created "2020-04-23"^^xsd:date .
RDF model - named graphs
Alternative approach to the problem:
RDF Triples become RDF Quads
51
my:index.html
my:staff/85740
dcterms:creator
education
en
dcterms:language
dcterms:subject
my:index.html
my:staff/85740
dcterms:creator
education
en
dcterms:language
dcterms:subject
my:index.html
my:staff/85740
dcterms:creator
education
en
dcterms:language
dcterms:subject
https://example.org/named-graphs/1
RDF dataset
Consists of
52
my:index.html
my:staff/85740
dcterms:creator
education
en
dcterms:language
dcterms:subject
my:index.html
my:staff/85740
dcterms:creator
education
en
dcterms:language
dcterms:subject
my:index.html
my:staff/85740
dcterms:creator
education
en
dcterms:language
dcterms:subject
https://example.org/named-graphs/1
https://example.org/named-graphs/2
default graph
Back to RDF serializations
53
RDF 1.1 N-Quads
S P O G
<http://example.org/#spiderman> <http://www.perceive.net/schemas/relationship/enemyOf> <http://example.org/#green-goblin> <http://example.org/graphs/spiderman> .
54
RDF 1.1 TriG
RDF Dataset consists of
@base <http://www.w3.org/People/> .
@prefix : <http://xmlns.com/foaf/0.1/> .
# default graph
{
ericFoaf:ericP :givenName "Eric" .
}
# also default graph, no {}
ericFoaf:ericP :givenName "Eric" .
# graph highlight
GRAPH <Eric/ericP-foaf.rdf> {
ericFoaf:ericP :givenName "Eric" .
}
55
RDFS: RDF Schema
56
RDFS - RDF Schema 1.1
Vocabulary for creation of other RDF vocabularies
RDF Vocabulary
57
RDFS - defining classes and class hierarchies
ex:MotorVehicle rdf:type rdfs:Class .
ex:PassengerVehicle rdf:type rdfs:Class .
ex:Van rdf:type rdfs:Class .
ex:Truck rdf:type rdfs:Class .
ex:MiniVan rdf:type rdfs:Class .
ex:PassengerVehicle rdfs:subClassOf ex:MotorVehicle .
ex:Van rdfs:subClassOf ex:MotorVehicle .
ex:Truck rdfs:subClassOf ex:MotorVehicle .
ex:MiniVan rdfs:subClassOf ex:Van .
ex:MiniVan rdfs:subClassOf ex:PassengerVehicle .
58
RDFS - defining classes and class hierarchies
59
ex:MotorVehicle
ex:Truck
ex:Van
ex:PassengerVehicle
ex:MiniVan
rdfs:subclassOf
rdfs:subclassOf
rdfs:subclassOf
rdfs:subclassOf
rdfs:subclassOf
RDFS - defining properties and property hierarchies
ex:Person rdf:type rdfs:Class .
ex:author rdf:type rdf:Property .
ex:author rdfs:range ex:Person .
ex:hasMother rdf:type rdf:Property .
ex:hasMother rdfs:range ex:Female .
ex:hasMother rdfs:domain ex:Person .
ex:age rdf:type rdf:Property .
ex:age rdfs:range xsd:integer .
exterms:weight rdfs:domain ex:Book .
exterms:weight rdfs:domain ex:MotorVehicle .
ex:driver rdf:type rdf:Property .
ex:primaryDriver rdf:type rdf:Property .
ex:primaryDriver rdfs:subPropertyOf ex:driver .
Big difference between RDFS and object-oriented programming (OOP): �RDF properties are first class citizens.
They can exist on their own, independently of any class.
60
RDFS - property hierarchies
61
ex:Person
ex:MotorVehicle
ex:driver
ex:primaryDriver
ex:driver a rdf:Property .
ex:primaryDriver a rdf:Property .
�ex:primaryDriver rdfs:subPropertyOf�ex:driver .
RDFS: label, comment, seeAlso
62
RDF model: rdf:List for closed collection
63
rdf:List
my:item1
my:item2
rdf:type
rdf:first
rdf:rest
my:list
rdf:nil
rdf:first
rdf:rest
rdf:type
rdf:type
RDF model: containers for open collections
rdf:Bag, rdf:Seq, rdf:Alt
64
my:bag
my:item1
my:item2
my:item3
rdf:Bag
rdf:type
rdf:_1
rdf:_2
rdf:_3
RDF 1.1 Turtle - rdf:List shortcut
# the value of this triple is the RDF collection blank node
:subject :predicate ( :a :b :c ) .
# an empty collection value - rdf:nil
:subject :predicate2 () .
65
RDFS - RDF Schema 1.1
Vocabulary for creation of other RDF vocabularies
RDF Vocabulary
66
Functionally different from other schema languages, e.g. XML Schema��RDF is “schema-less”
Open World Assumption (OWA)
“open-world assumption is the assumption that the truth value of a statement may be true irrespective of whether or not it is known to be true”
67
Statement: "Mary" "is a citizen of" "France"
Question: Is Paul a citizen of France?
"Closed world" (for example SQL) answer: No.
"Open world" answer: Unknown.
Linked Data
68
Regular data ~ not linked
ID | Jméno | Hraje |
1235 | Joaquin Phoenix | Joker |
1234 | Robert De Niro | Joker |
... | | |
Hey, look at 1234, he’s cool!
Where and how do I get data about 1234?
Which Joker, the 5.6 or the 9.0 one?
[{
"id": "1234",
"id2": "az-11",
"name": {
"en": "Joker"
},
"rating": 9.0
}, {
"id": "1235",
"id2": "yt-18",
"name": {
"en": "Joker"
},
"rating": 5.6
}]
Stars in, or stars as?
Or this 1234?
This 1234?
Issues with regular, non-linked data
i.e. CSV, JSON, XML, Excel files...
70
ID | Name | Stars |
1235 | Joaquin Phoenix | Joker |
1234 | Robert De Niro | Joker |
... | | |
Issues => Additional requirements on data
i.e. CSV, JSON, XML, ...
71
Is there such a system?
The World Wide Web
Shared global space of documents
Built on top of several simple principles:
There are two kinds of applications working in this space of documents:
72
HTML
HTML
HTML
HTML
Web browser
Search engine
HTTP
HTTP
The World Wide Web - what can we do with it?
73
HTML
HTML
HTML
HTML
Web browser
Search engine
HTTP
HTTP
The World Wide Web - 30 years, Sir Tim Berners-Lee
74
30th Anniversary of the World Wide Web @ CERN�(March 2019)
From the Web to Linked Data
75
Web of Documents
76
�Lots of information about Prague in the Web of Documents. Problems:
Prague budget
Basic info about Prague
Prague public contracts
Demography of Prague
EU funded projects in Prague
Web of Documents
77
�Queries, for which there is information:
Prague budget
Basic info about Prague
Prague public contracts
Demography of Prague
EU funded projects in Prague
The World Wide Web
78
HTML
HTML
HTML
HTML
Web browser
Search engine
HTTP
HTTP
Database A
Database B
Database D
Database C
The World Wide Web
Different APIs provide machine readable data for further processing in so called mash-up applications.
Also built on several simple principles:
79
Database A
Database B
Database D
Database C
Mash-up App
Mash-up App
HTTP
Proprietary Data API A
HTTP
HTTP
HTTP
Proprietary Data API C
Proprietary Data API D
Proprietary Data API B
Social network silos
80
Problems with data on the current Web
81
Web of Documents | Current Web IS NOT Web of Data! |
URLs as unique global identifiers of documents | no unique global identifiers of things |
HTML as a format for publishing documents | many formats for publishing data (XML, JSON, CSV, XLS, ...) |
HTTP for localization and accessing documents by their URLs | HTTP for localization of APIs and accessing them (REST) [but not for localization of things and accessing their data] |
hyperlinks between documents | none of current formats enables us to link related entities |
Can we apply the principles of the Web to data?
Linked Data ~ the Web of Data
Principles, “best practices” for publishing and linking data about entities on the Web.
82
BEST PRACTICE
The principles of Linked Data
83
Web of Documents without the first two principles
Web pages without URLs
84
ID | Name | Stars |
1235 | Joaquin Phoenix | Joker |
1234 | Robert De Niro | Joker |
... | | |
Things as first-class citizens
85
Project
CZ.2.16/2.1.00/22189
Prague City
Prague Council
Prague Demography
Prague Budget
Contract
DIL/23/07/007302/2010
1. + 2. Use HTTP URIs as names for things
86
Project
CZ.2.16/2.1.00/22189
praha.eu (Prague)
http://praha.eu/contract/7302
http://praha.eu/council
http://praha.eu/city
1. + 2. Use HTTP URIs as names for things
87
Project
CZ.2.16/2.1.00/22189
praha.eu (Prague)
http://praha.eu/contract/7302
http://praha.eu/council
http://praha.eu/city
mfcr.cz (Ministry of Finance)
http://mfcr.cz/
prague/budget
http://mfcr.cz/
prague
1. + 2. Use HTTP URIs as names for things
88
Project
CZ.2.16/2.1.00/22189
praha.eu (Prague)
http://praha.eu/contract/7302
http://praha.eu/council
http://praha.eu/city
mfcr.cz (Ministry of Finance)
http://mfcr.cz/
prague/budget
http://mfcr.cz/
prague
risy.cz (Regional Information Service)
http://risy.cz/
location/prague
http://risy.cz/contract/22189-01
http://risy.cz/
project/22189
czso.cz (Czech Statistical Office)
http://registry.
czso.cz/prague
http://czso.cz/
prague
http://czso.cz/prague/demogstat
The principles of Linked Data
89
Web of Documents without the third principle
Web pages are in many formats, not only HTML
Thanks for the URI of your web page
… we all know this - how many times you click on a link and PDF/Word/Excel opens
90
Technical detour: HTTP Accept header and URIs
91
Web browser
esfcr.cz
HTTP
(HTML)
http://esfcr.cz/.../projekt/
CZ10421016300169
Applications
HTTP
(RDF)
<http://esfcr.cz/data/projekt/CZ10421016300169>
esf:nazev "INNOSTART" ;
esf:registracni_cislo "CZ.1.04/2.1.01/63.00169" ;
esf:castka "4711681" ;
esf:realizace_od "2011-06-01" ;
esf:realizace_do "2013-03-31" ;
esf:realizator <http://esfcr.cz/.../25438352> ;
esf:partner <http://esfcr.cz/.../25438352> ;
esf:kontaktni_osoba <http://esfcr.cz/.../8541274571>;
esf:region <http://esfcr.cz/.../ustecky> .
http://esfcr.cz/.../projekt/
CZ10421016300169
The principles of Linked Data
92
Web of Documents without the fourth principle
Web pages without links to other pages
93
4. Include links to other URIs (provide context)
94
praha.eu (Prague)
http://praha.eu/contract/7302
http://praha.eu/city
mfcr.cz (Ministry of Finance)
http://mfcr.cz/
prague/budget
http://mfcr.cz/
prague
risy.cz (Regional Information Service)
http://risy.cz/
location/prague
http://risy.cz/contract/22189-01
http://risy.cz/
project/22189
czso.cz (Czech Statistical Office)
http://registry.
czso.cz/prague
http://czso.cz/
prague
http://czso.cz/prague/demogstat
http://praha.eu/council
4. Include links to other URIs (provide context)
95
praha.eu (Prague)
http://praha.eu/contract/7302
http://praha.eu/city
mfcr.cz (Ministry of Finance)
http://mfcr.cz/
prague/budget
http://mfcr.cz/
prague
risy.cz (Regional Information Service)
http://risy.cz/
location/prague
http://risy.cz/contract/22189-01
http://risy.cz/
project/22189
czso.cz (Czech Statistical Office)
http://registry.
czso.cz/prague
http://czso.cz/
prague
http://czso.cz/prague/demogstat
c: hasBeneficiary
a:fundedBy
b:hasBudget
http://praha.eu/council
d:hasDemography
4. Include links to other URIs (provide context)
96
praha.eu (Prague)
http://praha.eu/contract/7302
http://praha.eu/city
mfcr.cz (Ministry of Finance)
http://mfcr.cz/
prague/budget
http://mfcr.cz/
prague
risy.cz (Regional Information Service)
http://risy.cz/
location/prague
http://risy.cz/contract/22189-01
http://risy.cz/
project/22189
czso.cz (Czech Statistical Office)
http://registry.
czso.cz/prague
http://czso.cz/
prague
http://czso.cz/prague/demogstat
c: hasBeneficiary
a:fundedBy
b:hasBudget
http://praha.eu/council
d:hasDemography
owl:sameAs
owl:sameAs
The Web of Data
97
http://praha.eu/contract/7302
http://praha.eu/city
http://mfcr.cz/
prague/budget
http://mfcr.cz/
prague
http://risy.cz/
location/prague
http://risy.cz/contract/22189-01
http://risy.cz/
project/22189
http://registry.
czso.cz/prague
http://czso.cz/
prague
http://czso.cz/prague/demogstat
c: hasBeneficiary
a:fundedBy
b:hasBudget
http://praha.eu/council
d:hasDemography
owl:sameAs
owl:sameAs
Web of documents vs. Web of data (Linked Data)
98
Web of documents | Linked Data |
HTML as document publication format | RDF as a data publication format |
URL as a unique global document identifier | URL as a unique global entity identifier |
HTTP protocol for accessing documents using their URL | HTTP protocol for accessing data about entities using their URL |
Links to other documents | Links to other entities |
| vocabularies – standards for common data representation |
Linked Open Vocabularies
Catalog of vocabularies used on the Web of Data
Basic rule - vocabulary reuse
99
https://lov.linkeddata.es/dataset/lov/
Linked Data = Technical interoperability solution
100
HTTPAPI
FTP
SOAP�WSDL
TriG dump
IRI dereference
SPARQL
#LD
Web of Data
101
If the data from those web sites was published as Linked Data, getting the answer to the queries, e.g.
would have only one step:��1. Write the query answering the question
(in the worst case there would be a preceding “download data” step if federated querying was not supported)
Prague budget
Basic info about Prague
Prague public contracts
Demography of Prague
EU funded projects in Prague
The Web of Data - will it be successful?
102
The LOD cloud - 2007 - 12 datasets
103
The LOD cloud - 2008 - 32 datasets
104
The LOD cloud - 2009 - 89 datasets
105
The LOD cloud - 2010 - 203 datasets
106
The LOD cloud - 2011 - 295 datasets
107
The LOD cloud - 2014 - 570 datasets
108
The LOD cloud - 2017 - 1146 datasets
109
The LOD cloud - 2018 - 1229 datasets
110
The LOD cloud - 2019 - 1239 datasets
111
The LOD cloud - 2020 - 1255 datasets
112
The LOD cloud - 2024 - 1346 datasets
113
Open data - 5 star classification�Legal and technical maturity of data
114
RDF - relation to conceptual model
ex:index.html a ex:Page .�ex:index.html dcterms:creator emp:85740 .�ex:index.html dcterms:subject "education" .�ex:index.html dcterms:language "en" .
emp:85740 a ex:Employee .�emp:85740 ex:number 42 .�
115
- number
Employee
�- language (dcterms:language)�- theme (dcterms:subject)
Page
creator�(dcterms:creator)
1..*
0..*
Person
ex:Page a rdfs:Class .�ex:Employee a rdfs:Class .�ex:Person a rdfs:Class .�ex:Employee rdfs:subClassOf ex:Person .
dcterms:creator a rdf:Property .�dcterms:subject a rdf:Property .�dcterms:language a rdf:Property .�ex:number a rdf:Property .
RDF - relation to conceptual model
ex:index.html a ex:Page .�ex:index.html dcterms:creator emp:85740 .�ex:index.html dcterms:subject "education" .�ex:index.html dcterms:language "en" .
emp:85740 a ex:Employee .�emp:85740 ex:number 42 .�
116
- number
Employee
�- language (dcterms:language)�- theme (dcterms:subject)
Page
creator�(dcterms:creator)
1..*
0..*
Person
ex:Page a rdfs:Class ;� rdfs:label "Page"@en ;� rdfs:comment "A web page"@en .��ex:number a rdf:Property ;� rdfs:label "Employee number"@en ;� rdfs:domain ex:Employee ;� rdfs:range xsd:integer .�