SlideShare uma empresa Scribd logo
1 de 43
Baixar para ler offline
DATA
SUPPORT
OPEN
Training Module 1.3
Introduction to
RDF & SPARQL
PwC firms help organisations and individuals create the value they’re looking for. We’re a network of firms in 158 countries with close to 180,000 people who are committed to
delivering quality in assurance, tax and advisory services. Tell us what matters to you and find out more by visiting us at www.pwc.com.
PwC refers to the PwC network and/or one or more of its member firms, each of which is a separate legal entity. Please see www.pwc.com/structure for further details.
DATASUPPORTOPEN
This presentation has been created by PwC
Authors:
Michiel De Keyzer, Nikolaos Loutas and Stijn
Goedertier
Presentation
metadata
Slide 2
Open Data Support is funded by
the European Commission
under SMART 2012/0107 ‘Lot
2: Provision of services for the
Publication, Access and Reuse of
Open Public Data across the
European Union, through
existing open data
portals’(Contract No. 30-CE-
0530965/00-17).
© 2014 European Commission
Disclaimers
1. The views expressed in this presentation are purely those of the authors and may not, in any
circumstances, be interpreted as stating an official position of the European Commission.
The European Commission does not guarantee the accuracy of the information included in this
presentation, nor does it accept any responsibility for any use thereof.
Reference herein to any specific products, specifications, process, or service by trade name,
trademark, manufacturer, or otherwise, does not necessarily constitute or imply its endorsement,
recommendation, or favouring by the European Commission.
All care has been taken by the author to ensure that s/he has obtained, where necessary,
permission to use any parts of manuscripts including illustrations, maps, and graphs, on which
intellectual property rights already exist from the titular holder(s) of such rights or from her/his
or their legal representative.
2. This presentation has been carefully compiled by PwC, but no representation is made or
warranty given (either express or implied) as to the completeness or accuracy of the information it
contains. PwC is not liable for the information in this presentation or any decision or
consequence based on the use of it.. PwC will not be liable for any damages arising from the use of
the information contained in this presentation. The information contained in this presentation is
of a general nature and is solely for guidance on matters of general interest. This presentation is
not a substitute for professional advice on any particular matter. No reader should act on the basis
of any matter contained in this publication without considering appropriate professional advice.
DATASUPPORTOPEN
Learning objectives
By the end of this training module you should have an understanding
of:
• The Resource Description Framework (RDF).
• How to write/read RDF.
• How you can describe your data with RDF.
• What SPARQL is.
• The different types of SPARQL queries.
• How to write a SPARQL query.
Slide 3
DATASUPPORTOPEN
Content
This module contains ...
• An introduction to the Resource Description Framework (RDF) for
describing your data.
- What is RDF?
- How is it structured?
- How to represent your data in RDF.
• An introduction to SPARQL on how you can query and manipulate
data in RDF.
• Pointers to further reading, examples and exercises.
Slide 4
DATASUPPORTOPEN
Resource Description
Framework
An introduction on RDF.
Slide 5
DATASUPPORTOPEN
RDF in the stack of Semantic Web technologies
• RDF stands for:
- Resource: Everything that can
have a unique identifier (URI), e.g.
pages, places, people, dogs,
products...
- Description: attributes, features,
and relations of the resources
- Framework: model, languages
and syntaxes for these descriptions
• RDF was published as a W3C
recommendation in 1999.
• RDF was originally introduced as a
data model for metadata.
• RDF was generalised to cover
knowledge of all kinds.
Slide 6
See also:
http://www.w3.org/RDF/
DATASUPPORTOPEN
Example: RDF description of an organisation
Nike, Dahliastraat 24, 2160 Wommelgem
Slide 7
<rdf:RDF
xmlns:rov=“http://www.w3.org/TR/vocab-regorg/ “
xmlns:org=“http://www.w3.org/TR/vocab-org/”
xmlns:locn=“http://www.w3.org/ns/locn#” >
<rov:RegisteredOrganization rdf:about=“http://example.com/org/2172798119”>
<rov:legalName> “Nike”< /rov:legalName>
<org:hasRegisteredSite rdf:resource=“http://example.com/site/1234”/>
</rov:RegisteredOrganization>
<locn:Address rdf:about=“http://example.com/site/1234”/>
<locn:fullAddress>” Dahliastraat 24, 2160 Wommelgem”</locn:fullAddress>
</locn:Address>
</rdf:RDF>
DATASUPPORTOPEN
RDF structure
Triples, graphs and syntax.
Slide 8
DATASUPPORTOPEN
What is a triple?
Slide 9
RDF is a general syntax for representing data on the Web.
Every piece of information expressed in RDF is represented as a triple:
• Subject – a resource, which may be identified with a URI.
• Predicate – a URI-identified reused specification of the relationship.
• Object – a resource or literal to which the subject is related.
http://example.com/org/2172798119 has as legal name “Nikè”.
Subject Predicate Object
Example: name of a legal entity:
DATASUPPORTOPEN
RDF is graph based
Graph =
A collection of triples
Slide 10
http://example.co
m/site/1234
http://example.com/
org/2172798119
Nikè
has registered site
has legal name
Dahliastraat 24
2160 Wommelgem
full address
DATASUPPORTOPEN
RDF Syntax
RDF/XML
Slide 11
<rdf:RDF
xmlns:rov=“http://www.w3.org/TR/vocab-regorg/ “
xmlns:org=“http://www.w3.org/TR/vocab-org/”
xmlns:locn=“http://www.w3.org/ns/locn#” >
<rov:RegisteredOrganization rdf:about=“http://example.com/org/2172798119”>
<rov:legalName> “Niké”< /rov:legalName>
<org:hasRegisteredSite rdf:resource=“http://example.com/site/1234”/>
</rov:RegisteredOrganization>
<locn:Address rdf:about=“http://example.com/site/1234”/>
<locn:fullAddress>” Dahliastraat 24, 2160 Wommelgem”</locn:fullAddress>
</locn:Address>
</rdf:RDF>
Subject
Predicate
Object
Graph
RDF/XML is currently the only syntax that is
standardised by W3C.
Definition of prefixes
Description of data – triples
DATASUPPORTOPEN
RDF Syntax
Turtle
Slide 12
Subject
Predicate
Object
@prefix rov: <http://www.w3.org/TR/vocab-regorg/> .
@prefix org: <http://www.w3.org/TR/vocab-org/> .
@prefix locn: <http://www.w3.org/ns/locn#> .
< http://example.com/org/2172798119 >
a <rov:RegisteredOrganization> ;
rov:legalName “Niké “;
org:hasRegisteredSite <http://example.com/site/1234> .
<http://example.com/site/1234>
a <locn:Address> ;
locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” .
Graph
Turtle will be
standardised in RDF 1.1.
See also:
http://www.w3.org/2009/12/rdf-ws/papers/ws11
Definition of prefixes
Description of data – triples
DATASUPPORTOPEN
RDF Syntax
RDFa
Slide 13
Subject
Predicate
Object
<html>
<head> ... </head>
<body>
...
<div resource=“http://example.com/org/2172798119”
typeof= “http://www.w3.org/TR/vocab-regorg/RegisteredOrganization”>
<p>
<span property=" http://www.w3.org/TR/vocab-regorg/legalName">Nike<span>
Address: <span property="http://www.w3.org/ns/locn#fullAddress"> Dahliastraat
24, 2160 Wommelgem </span>
</p></div>
</body>
See also:
http://www.w3.org/TR/2012/NOTE-rdfa-primer-20120607/
embedding RDF data in HTML
DATASUPPORTOPEN
How to represent
data in RDF
Classes, properties and vocabularies
Slide 14
DATASUPPORTOPEN
RDF Vocabulary
Slide 15
“A vocabulary is a data model comprising classes, properties and
relationships which can be used for describing your data and
metadata.”
• RDF Vocabularies are sets of terms used to describe things.
• A term is either a class or a property.
 Object type properties (relationships)
 Data type properties (attributes)
DATASUPPORTOPEN
What are classes, relationships and properties?
• Class. A construct that represents things in the real and/or
information world, e.g. a person, an organisation, a concepts such as
“health” or “freedom”.
• Relationship. A link between two classes; for the link between a
document and the organisation that published it (i.e. organisation
publishes document), or the link between a map and the geographic
region it depicts (i.e. map depicts geographic region). In RDF
relationships are encoded as object type properties.
• Property. A characteristic of a class in a particular dimension such
as the legal name of an organisation or the date and time that an
observation was made.
Slide 16
DATASUPPORTOPEN
Examples of classes, relationships and properties
Slide 17
http://.../org/217279
8119
site
http://example.com/site
/1234
RegisteredOrganisation Address
Dahliastraat 24, 2160
Wommelgem“Nikè”
a a
fullAddresslegalName
ClassProperty
Relationship
DATASUPPORTOPEN
Reusing RDF vocabularies
• Reuse greatly aids interoperability of your data.
Use of dcterms:created, for example, the value for which should be a data typed date
such as 2013-02-21^^xsd:date, is immediately processable by many machines. If
your schema encourages data publishers to use a different term and date format,
such as ex:date "21 February 2013" – data published using your schema will require
further processing to make it the same as everyone else's.
• Reuse adds credibility to your schema.
It shows it has been published with care and professionalism, again, this promotes its
reuse.
• Reuse is easier and cheaper.
Reusing classes and properties from well defined and properly hosted vocabularies
avoids your having to replicate that effort.
Slide 18
See also:
https://joinup.ec.europa.eu/community/semic/document/cookbook-
translating-data-models-rdf-schemas
http://www.slideshare.net/OpenDataSupport/model-your-data-metadata
DATASUPPORTOPEN
Where can I find existing vocabularies?
Slide 19
Refinethesearch results via the
facetedsearch filters.
2
1
3
http://lov.okfn.org/
http://joinup.ec.europa.eu/
DATASUPPORTOPEN
Well-known vocabularies
Slide 20
Friend-of-a-Friend (FOAF) Vocabulary for describing people
Core Person Vocabulary
Vocabulary to describe the fundamental characteristics of
a person, e.g. the name, the gender, the date of birth...
DOAP Vocabulary for describing projects
DCAT-AP
Vocabulary based on the Data Catalogue vocabulary
(DCAT) for describing public sector datasets in Europe.
ADMS Vocabulary for describing interoperability assets.
Dublin Core Defines general metadata attributes
Registered Organisation Vocabulary
Vocabulary for describing organizations, typically in a
national or regional register
Organization Ontology for describing the structure of organizations
Core Location Vocabulary
Vocabulary capturing the fundamental characteristics of a
location.
Core Public Service Vocabulary
Vocabulary capturing the fundamental characteristics of a
service offered by public administration
schema.org
Agreed vocabularies for publishing structured data on the
Web elaborated by Google, Yahoo and Microsoft
See also:
http://www.w3.org/wiki/TaskForces/CommunityProj
ects/LinkingOpenData/CommonVocabularies
DATASUPPORTOPEN
Model your own vocabulary as an RDF Schema
If there is no suitable authoritative reusable vocabulary for describing
your data, use conventions for describing your own vocabulary:
- RDF Schema (RDFS)
- Web Ontology Language (OWL)
Example: definition of a class :
Slide 21
cpsv:PublicService a rdfs:Class, owl:Class;
rdfs:label "Public Service"@en;
rdfs:comment "This class represents the service itself. As noted in
the scope, a public service is the capacity to carry out a procedure
and exists whether it is used or not. It is a set of deeds and
acts performed by or on behalf of a public agency for the benefit of a
citizen, a business or another public agency."@en.
See also:
http://www.slideshare.net/OpenDataSupport/model-your-
data-metadata
DATASUPPORTOPEN
Introduction to
SPARQL
The RDF Query Language
Slide 22
DATASUPPORTOPEN
About SPARQL
SPARQL is the standard language to query graph data represented as
RDF triples.
• SPARQL Protocol and RDF Query Language
• One of the three core standards of the Semantic Web, along with RDF
and OWL.
• Became a W3C standard January 2008.
• SPARQL 1.1 now in Working Draft status.
Slide 23
DATASUPPORTOPEN
Types of SPARQL queries
• SELECT
Return a table of all X, Y, etc. satisfying the following conditions ...
• CONSTRUCT
Find all X, Y, etc. satisfying the following conditions ... and substitute
them into the following template in order to generate (possibly new)
RDF statements, creating a new graph.
• DESCRIBE
Find all statements in the dataset that provide information about the
following resource(s) ... (identified by name or description)
• ASK
Are there any X, Y, etc. satisfying the following conditions ...
Slide 24
See also:
http://www.euclid-project.eu/modules/chapter2
DATASUPPORTOPEN
PREFIX rov: <http://www.w3.org/TR/vocab-regorg/>
SELECT ?name
WHERE
{ ?x rov:legalName ?name }
Structure of a SPARQL Query
Slide 25
Type of
query
Variables, i.e. what to search for
RDF triple
patterns, i.e. the
conditions that have
to be met
Definition of
prefixes
DATASUPPORTOPEN
SELECT – return the name of an organisation with
particular URI
Slide 26
comp:A rov:haslegalName “Niké” .
comp:A org:hasRegisteredSite site:1234 .
Comp:B rov:haslegalName “BARCO” .
site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem .
PREFIX comp: < http://example/org/org/>
PREFIX org: < http://www.w3.org/TR/vocab-regorg/ >
PREFIX site: <http://example.org/site/>
PREFIX rov: <http://www.w3.org/TR/vocab-regorg/>
SELECT ?name
WHERE
{ ?x org:hasRegisteredSite site:1234 .
?x rov:haslegalName ?name .}
name
“Niké”
Sample data
Query
Result
DATASUPPORTOPEN
SELECT - return the name and address of
organisations
Slide 27
PREFIX org: < http://www.w3.org/TR/vocab-regorg/ >
PREFIX locn:< http://www.w3.org/ns/locn#>
PREFIC rov:<http://www.w3.org/TR/vocab-regorg/>
SELECT ?name ?address
WHERE
{ ?x org:hasRegisteredSite ?site.
?x rov:haslegalName ?name .
?site locn:fullAddress ?address . }
name address
“Niké” “Dahliastraat 24, 2160 Wommelgem”
comp:A rov:haslegalName “Niké” .
comp:A org:hasRegisteredSite site:1234 .
Comp:B rov:haslegalName “BARCO” .
site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” .
Sample data
Query
Result
DATASUPPORTOPEN
SELECT - Return all books under a certain price
(1/2)
Slide 28
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix : <http://example.org/book/> .
@prefix ns: <http://example.org/ns#> .
:book1 dc:title "SPARQL Tutorial" .
:book1 ns:price 42 .
:book2 dc:title "The Semantic Web" .
:book2 ns:price 23 .
Sample data
DATASUPPORTOPEN
SELECT – Return all books under a certain price
(2/2)
Slide 29
PREFIX dc: <http://purl.org/dc/elements/1.1/> .
PREFIX : <http://example.org/book/> .
PREFIX ns: <http://example.org/ns#> .
SELECT ?book ?title
WHERE
{ ?book dc:title ?title .
?book ns:price ?price . FILTER ( ?price < 40 )
}
book title
:book2 “The Semantic Web”
Query
Result
DATASUPPORTOPEN
CONSTRUCT – Create a new graph with another
label for name
Slide 30
@prefix comp: <http://example/org/> .
@prefix rdfs: <http://www.w3.org/TR/rdf-schema/>
comp:a rdfs:label “Niké" .
comp:b rdfs:label “BARCO" .
comp:A rov:haslegalName “Niké” .
comp:A org:hasRegisteredSite site:1234 .
comp:B rov:haslegalName “BARCO” .
site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” .
PREFIX comp: < http://example/org/org/>
PREFIX org: < http://www.w3.org/TR/vocab-regorg/ >
PREFIC rdfs: <http://www.w3.org/TR/rdf-schema/>
CONSTRUCT {?comp rdfs:label ?name}
WHERE
{ ?comp org:haslegalName ?name. }
Sample data
Query
Resulting graph
DATASUPPORTOPEN
DESCRIBE – Return all triples of organisations
registered at a particular site
Slide 31
PREFIX comp: <http://example/org/>
PREFIX site: <http://example/site>
PREFIX org: < http://www.w3.org/TR/vocab-regorg/
DESCRIBE ?organisation
WHERE
{?organisation org:hasRegisteredSite site:1234}
@prefix comp: <http://example/org/> .
@prefix org: <http://www.w3.org/TR/vocab-regorg/> .
comp:A has:legalName “Niké” .
comp:A org:hasRegisteredSite site:1234 .
comp:A rov:haslegalName “Niké” .
comp:A org:hasRegisteredSite site:1234 .
comp:B rov:haslegalName “BARCO” .
site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” .
Sample data
Query
Result
DATASUPPORTOPEN
DESCRIBE – Return all triples associated to a
particular resource (organisation)
Slide 32
PREFIX comp: <http://example/org/>
DESCRIBE comp:A
@prefix comp: <http://example/org/> .
@prefix org: <http://www.w3.org/TR/vocab-regorg/> .
comp:A rov:haslegalName “Niké” .
comp:A org:hasRegisteredSite site:1234 .
comp:A rov:haslegalName “Niké” .
comp:A org:hasRegisteredSite site:1234 .
comp:B rov:haslegalName “BARCO” .
site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” .
Sample data
Query
Result
DATASUPPORTOPEN
ASK – Are there any organisations having “1234”
as their registered site?
Slide 33
PREFIX org: < http://www.w3.org/TR/vocab-regorg/
ASK
WHERE
{?organisation org:hasRegisteredSite site:1234}
TRUE
comp:A rov:haslegalName “Niké” .
comp:A org:hasRegisteredSite site:1234 .
comp:B rov:haslegalName “BARCO” .
site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” .
Sample data
Query
Result
DATASUPPORTOPEN
ASK – Is there a registered site for organisation
“BARCO”?
Slide 34
PREFIX comp: <http://example/org/>
PREFIX org: <http://www.w3.org/TR/vocab-regorg/>
ASK
WHERE
{comp:B org:hasRegisteredSite ?site .}
FALSE
comp:A rov:haslegalName “Niké” .
comp:A org:hasRegisteredSite site:1234 .
comp:B rov:haslegalName “BARCO” .
site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” .
Sample data
Query
Result
DATASUPPORTOPEN
SPARQL Update
Can be used for...
• Adding data (INSERT)
• Deleting data (DELETE)
• Loading RDF Graph (LOAD / LOAD .. INTO)
• Clearing an RDF Graph (CLEAR GRAPH)
• Creating RDF Graphs (CREATE GRAPH)
• Removing RDF Graphs (DROP GRAPH)
• Copying RDF Graphs (COPY GRAPH ... TO GRAPH)
• Moving RDF Graphs (MOVE GRAPH ... TO GRAPH)
• Adding RDF Graphs (ADD GRAPH TO GRAPH)
Slide 35
See also:
http://www.euclid-project.eu/modules/chapter2
http://www.w3.org/TR/sparql11-update/
DATASUPPORTOPEN
INSERT – Add a registered site for “BARCO”?
Slide 36
comp:A rov:haslegalName “Niké” .
comp:A org:hasRegisteredSite site:1234 .
comp:B rov:haslegalName “BARCO” .
site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” .
Sample data
comp:A rov:haslegalName “Niké” .
comp:A org:hasRegisteredSite site:1234 .
comp:B rov:haslegalName “BARCO” .
comp:B org:hasRegisteredSite site:5678 .
site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” .
site:5678 locn:fullAddress “President Kennedypark 35, 8500 Kortrijk“ .
PREFIX comp: <http://example/org/>
PREFIX org: <http://www.w3.org/TR/vocab-regorg/>
INSERT DATA
{
site:5678 locn:fullAddress “President Kennedypark 35, 8500 Kortrijk“ .
comp:B org:hasRegisteredSite site:5678 .
}
Query
Result
DATASUPPORTOPEN
INSERT/DELETE – Change the address for “Niké”?
Slide 37
comp:A rov:haslegalName “Niké” .
comp:A org:hasRegisteredSite site:1234 .
comp:B rov:haslegalName “BARCO” .
site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” .
Data
PREFIX comp: <http://example/org/>
PREFIX org: <http://www.w3.org/TR/vocab-regorg/>
DELETE DATA
{
comp:A org:hasRegisteredSite site:1234 .
}
INSERT DATA
{
site:5678 locn:fullAddress “Rue de Loi 34, 1000 Bruxelles“ .
comp:A org:hasRegisteredSite site:5678 .
}
Query
comp:A rov:haslegalName “Niké” .
comp:A org:hasRegisteredSite site:1000.
site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” .
site:1000 locn:fullAddress “Rue de Loi 34, 1000 Bruxelles“ .
Result
DATASUPPORTOPEN
Summary
• RDF is a general way to express data intended for publishing on the
Web.
• RDF data is expressed in triples: subject, predicate, object.
• Different syntaxes exist for expressing data in RDF.
• SPARQL is a standardised language to query graph data expressed
as RDF.
• SPARQL can be used to query and update RDF data.
Slide 38
DATASUPPORTOPEN
Thank you!
...and now YOUR questions?
Slide 39
Take the online test here!
DATASUPPORTOPEN
References
Slide 6:
• Semantic Web Stack. W3C. http://www.w3.org/DesignIssues/diagrams/sweb-
stack/2006a.png
Slides 18& 20:
• Linked Data Cookbook. W3C.
http://www.w3.org/2011/gld/wiki/Linked_Data_Cookbook
Slide 21:
• Cookbook for translating data models to RDF schemas. ISA Programme.
https://joinup.ec.europa.eu/community/semic/document/cookbook-translating-
data-models-rdf-schemas
Slide 22:
• Common Vocabularies / Ontologies / Micromodels. W3C.
http://www.w3.org/wiki/TaskForces/CommunityProjects/LinkingOpenData/Co
mmonVocabularies
Slide 23-24:
• SPARQL Query Language for RDF. W3C. http://www.w3.org/TR/rdf-sparql-
query/
Slide 24:
• Module 2: Querying Linked Data. EUCLID. http://www.euclid-
project.eu/modules/course2
Slide 35:
• Module 2: Querying Linked Data. EUCLID. http://www.euclid-
project.eu/modules/course2
• SPARQL 1.1 Update. W3C.. http://www.w3.org/TR/sparql11-update/
Slide 40
DATASUPPORTOPEN
Further reading
Learning SPARQL. Bob DuCharme.
http://www.learningsparql.com/
Semantic Web for the working ontologist. Dean Allemang, Jim
Hendler.
http://workingontologist.org/
EUCLID - Course 2: Querying Linked Data
http://www.euclid-project.eu/modules/course2
Slide 41
DATASUPPORTOPEN
Related projects and initiatives
Joinup, https://joinup.ec.europa.eu/
Linked Open Vocabularies, http://okfn.org/
W3C GLD WG, http://www.w3.org/2011/gld/wiki/Main_Page
W3C Schools – Learn RDF
http://www.w3schools.com/rdf/default.asp
EUCLID, http://euclid-project.eu/
TopBraid Composer
Protégé Ontology Editor , http://protege.stanford.edu/
XML Summer School http://xmlsummerschool.com/
Slide 42
DATASUPPORTOPEN
Be part of our team...
Find us on
Contact us
Join us on
Follow us
Open Data Support
http://www.slideshare.net/OpenDataSupport
http://www.opendatasupport.euOpen Data Support
http://goo.gl/y9ZZI
@OpenDataSupport contact@opendatasupport.eu
Slide 43

Mais conteúdo relacionado

Mais procurados

An introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataAn introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataFabien Gandon
 
Introduction to the Semantic Web
Introduction to the Semantic WebIntroduction to the Semantic Web
Introduction to the Semantic WebMarin Dimitrov
 
Introduction to Ontology Concepts and Terminology
Introduction to Ontology Concepts and TerminologyIntroduction to Ontology Concepts and Terminology
Introduction to Ontology Concepts and TerminologySteven Miller
 
RDFS In A Nutshell V1
RDFS In A Nutshell V1RDFS In A Nutshell V1
RDFS In A Nutshell V1Fabien Gandon
 
Les bases pour utiliser SPARQL
Les bases pour utiliser SPARQLLes bases pour utiliser SPARQL
Les bases pour utiliser SPARQLBorderCloud
 
Understanding RDF: the Resource Description Framework in Context (1999)
Understanding RDF: the Resource Description Framework in Context  (1999)Understanding RDF: the Resource Description Framework in Context  (1999)
Understanding RDF: the Resource Description Framework in Context (1999)Dan Brickley
 
Ontologies and semantic web
Ontologies and semantic webOntologies and semantic web
Ontologies and semantic webStanley Wang
 
Linked Data의 RDF 어휘 이해하고 체험하기 - FOAF, SIOC, SKOS를 중심으로 -
Linked Data의 RDF 어휘 이해하고 체험하기 - FOAF, SIOC, SKOS를 중심으로 -Linked Data의 RDF 어휘 이해하고 체험하기 - FOAF, SIOC, SKOS를 중심으로 -
Linked Data의 RDF 어휘 이해하고 체험하기 - FOAF, SIOC, SKOS를 중심으로 -Dongbum Kim
 
SPARQL-DL - Theory & Practice
SPARQL-DL - Theory & PracticeSPARQL-DL - Theory & Practice
SPARQL-DL - Theory & PracticeAdriel Café
 
Resource description framework
Resource description frameworkResource description framework
Resource description frameworkhozifa1010
 
Design and manage persistent URIs
Design and manage persistent URIsDesign and manage persistent URIs
Design and manage persistent URIsOpen Data Support
 
Lecture: Ontologies and the Semantic Web
Lecture: Ontologies and the Semantic WebLecture: Ontologies and the Semantic Web
Lecture: Ontologies and the Semantic WebMarina Santini
 
Rdf In A Nutshell V1
Rdf In A Nutshell V1Rdf In A Nutshell V1
Rdf In A Nutshell V1Fabien Gandon
 
SPARQL introduction and training (130+ slides with exercices)
SPARQL introduction and training (130+ slides with exercices)SPARQL introduction and training (130+ slides with exercices)
SPARQL introduction and training (130+ slides with exercices)Thomas Francart
 

Mais procurados (20)

An introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataAn introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked Data
 
RDF data model
RDF data modelRDF data model
RDF data model
 
RDF and OWL
RDF and OWLRDF and OWL
RDF and OWL
 
Introduction to the Semantic Web
Introduction to the Semantic WebIntroduction to the Semantic Web
Introduction to the Semantic Web
 
Introduction to Ontology Concepts and Terminology
Introduction to Ontology Concepts and TerminologyIntroduction to Ontology Concepts and Terminology
Introduction to Ontology Concepts and Terminology
 
RDFS In A Nutshell V1
RDFS In A Nutshell V1RDFS In A Nutshell V1
RDFS In A Nutshell V1
 
FOAF
FOAFFOAF
FOAF
 
SHACL by example
SHACL by exampleSHACL by example
SHACL by example
 
Les bases pour utiliser SPARQL
Les bases pour utiliser SPARQLLes bases pour utiliser SPARQL
Les bases pour utiliser SPARQL
 
Understanding RDF: the Resource Description Framework in Context (1999)
Understanding RDF: the Resource Description Framework in Context  (1999)Understanding RDF: the Resource Description Framework in Context  (1999)
Understanding RDF: the Resource Description Framework in Context (1999)
 
Ontologies and semantic web
Ontologies and semantic webOntologies and semantic web
Ontologies and semantic web
 
Linked Data의 RDF 어휘 이해하고 체험하기 - FOAF, SIOC, SKOS를 중심으로 -
Linked Data의 RDF 어휘 이해하고 체험하기 - FOAF, SIOC, SKOS를 중심으로 -Linked Data의 RDF 어휘 이해하고 체험하기 - FOAF, SIOC, SKOS를 중심으로 -
Linked Data의 RDF 어휘 이해하고 체험하기 - FOAF, SIOC, SKOS를 중심으로 -
 
Introduction to RDF
Introduction to RDFIntroduction to RDF
Introduction to RDF
 
SPARQL-DL - Theory & Practice
SPARQL-DL - Theory & PracticeSPARQL-DL - Theory & Practice
SPARQL-DL - Theory & Practice
 
Resource description framework
Resource description frameworkResource description framework
Resource description framework
 
Introduction to linked data
Introduction to linked dataIntroduction to linked data
Introduction to linked data
 
Design and manage persistent URIs
Design and manage persistent URIsDesign and manage persistent URIs
Design and manage persistent URIs
 
Lecture: Ontologies and the Semantic Web
Lecture: Ontologies and the Semantic WebLecture: Ontologies and the Semantic Web
Lecture: Ontologies and the Semantic Web
 
Rdf In A Nutshell V1
Rdf In A Nutshell V1Rdf In A Nutshell V1
Rdf In A Nutshell V1
 
SPARQL introduction and training (130+ slides with exercices)
SPARQL introduction and training (130+ slides with exercices)SPARQL introduction and training (130+ slides with exercices)
SPARQL introduction and training (130+ slides with exercices)
 

Semelhante a Introduction to RDF & SPARQL

Designing and developing vocabularies in RDF
Designing and developing vocabularies in RDFDesigning and developing vocabularies in RDF
Designing and developing vocabularies in RDFOpen Data Support
 
Llinked open data training for EU institutions
Llinked open data training for EU institutionsLlinked open data training for EU institutions
Llinked open data training for EU institutionsOpen Data Support
 
Introduction to metadata management
Introduction to metadata managementIntroduction to metadata management
Introduction to metadata managementOpen Data Support
 
Linked Open Data Principles, Technologies and Examples
Linked Open Data Principles, Technologies and ExamplesLinked Open Data Principles, Technologies and Examples
Linked Open Data Principles, Technologies and ExamplesOpen Data Support
 
OpenAIRE and the case of Irish Repositories, by Jochen Schirrwagen (RIAN Work...
OpenAIRE and the case of Irish Repositories, by Jochen Schirrwagen (RIAN Work...OpenAIRE and the case of Irish Repositories, by Jochen Schirrwagen (RIAN Work...
OpenAIRE and the case of Irish Repositories, by Jochen Schirrwagen (RIAN Work...OpenAIRE
 
OpenAIRE and the Case of Irish Repositories
OpenAIRE and the Case of Irish RepositoriesOpenAIRE and the Case of Irish Repositories
OpenAIRE and the Case of Irish RepositoriesRIANIreland
 
Introduction to the Open Refine RDF tool
Introduction to the Open Refine RDF toolIntroduction to the Open Refine RDF tool
Introduction to the Open Refine RDF toolEuropean Commission
 
ICRH Winter Institute Strand 4 Day 1 - Building Narratives with Digital Objects
ICRH Winter Institute Strand 4 Day 1 - Building Narratives with Digital ObjectsICRH Winter Institute Strand 4 Day 1 - Building Narratives with Digital Objects
ICRH Winter Institute Strand 4 Day 1 - Building Narratives with Digital ObjectsShawn Day
 
Semantic Web / Linked Data Technologies
Semantic Web / Linked Data TechnologiesSemantic Web / Linked Data Technologies
Semantic Web / Linked Data TechnologiesMathieu d'Aquin
 
SemWeb Fundamentals - Info Linking & Layering in Practice
SemWeb Fundamentals - Info Linking & Layering in PracticeSemWeb Fundamentals - Info Linking & Layering in Practice
SemWeb Fundamentals - Info Linking & Layering in PracticeDan Brickley
 
RDFa Introductory Course Session 4/4 When RDFa
RDFa Introductory Course Session 4/4 When RDFaRDFa Introductory Course Session 4/4 When RDFa
RDFa Introductory Course Session 4/4 When RDFaPlatypus
 
Introduction to linked data
Introduction to linked dataIntroduction to linked data
Introduction to linked dataLaura Po
 
Discovery event peter burnhill (aggregation as tactic)
Discovery event peter burnhill (aggregation as tactic)Discovery event peter burnhill (aggregation as tactic)
Discovery event peter burnhill (aggregation as tactic)RDTF-Discovery
 
OpenAIRE guidelines and broker service for repository managers - OpenAIRE #OA...
OpenAIRE guidelines and broker service for repository managers - OpenAIRE #OA...OpenAIRE guidelines and broker service for repository managers - OpenAIRE #OA...
OpenAIRE guidelines and broker service for repository managers - OpenAIRE #OA...OpenAIRE
 
Linked Data at the OU - the story so far
Linked Data at the OU - the story so farLinked Data at the OU - the story so far
Linked Data at the OU - the story so farEnrico Daga
 
Wed roman tut_open_datapub
Wed roman tut_open_datapubWed roman tut_open_datapub
Wed roman tut_open_datapubeswcsummerschool
 

Semelhante a Introduction to RDF & SPARQL (20)

Designing and developing vocabularies in RDF
Designing and developing vocabularies in RDFDesigning and developing vocabularies in RDF
Designing and developing vocabularies in RDF
 
Llinked open data training for EU institutions
Llinked open data training for EU institutionsLlinked open data training for EU institutions
Llinked open data training for EU institutions
 
Introduction to metadata management
Introduction to metadata managementIntroduction to metadata management
Introduction to metadata management
 
Linked Open Data Principles, Technologies and Examples
Linked Open Data Principles, Technologies and ExamplesLinked Open Data Principles, Technologies and Examples
Linked Open Data Principles, Technologies and Examples
 
OpenAIRE and the case of Irish Repositories, by Jochen Schirrwagen (RIAN Work...
OpenAIRE and the case of Irish Repositories, by Jochen Schirrwagen (RIAN Work...OpenAIRE and the case of Irish Repositories, by Jochen Schirrwagen (RIAN Work...
OpenAIRE and the case of Irish Repositories, by Jochen Schirrwagen (RIAN Work...
 
OpenAIRE and the Case of Irish Repositories
OpenAIRE and the Case of Irish RepositoriesOpenAIRE and the Case of Irish Repositories
OpenAIRE and the Case of Irish Repositories
 
Introduction to the Open Refine RDF tool
Introduction to the Open Refine RDF toolIntroduction to the Open Refine RDF tool
Introduction to the Open Refine RDF tool
 
ICRH Winter Institute Strand 4 Day 1 - Building Narratives with Digital Objects
ICRH Winter Institute Strand 4 Day 1 - Building Narratives with Digital ObjectsICRH Winter Institute Strand 4 Day 1 - Building Narratives with Digital Objects
ICRH Winter Institute Strand 4 Day 1 - Building Narratives with Digital Objects
 
Linked Data In Action
Linked Data In ActionLinked Data In Action
Linked Data In Action
 
Semantic Web / Linked Data Technologies
Semantic Web / Linked Data TechnologiesSemantic Web / Linked Data Technologies
Semantic Web / Linked Data Technologies
 
SemWeb Fundamentals - Info Linking & Layering in Practice
SemWeb Fundamentals - Info Linking & Layering in PracticeSemWeb Fundamentals - Info Linking & Layering in Practice
SemWeb Fundamentals - Info Linking & Layering in Practice
 
RDFa Introductory Course Session 4/4 When RDFa
RDFa Introductory Course Session 4/4 When RDFaRDFa Introductory Course Session 4/4 When RDFa
RDFa Introductory Course Session 4/4 When RDFa
 
When RDFa?
When RDFa?When RDFa?
When RDFa?
 
Linked Data to Improve the OER Experience
Linked Data to Improve the OER ExperienceLinked Data to Improve the OER Experience
Linked Data to Improve the OER Experience
 
Introduction to linked data
Introduction to linked dataIntroduction to linked data
Introduction to linked data
 
Discovery event peter burnhill (aggregation as tactic)
Discovery event peter burnhill (aggregation as tactic)Discovery event peter burnhill (aggregation as tactic)
Discovery event peter burnhill (aggregation as tactic)
 
OpenAIRE guidelines and broker service for repository managers - OpenAIRE #OA...
OpenAIRE guidelines and broker service for repository managers - OpenAIRE #OA...OpenAIRE guidelines and broker service for repository managers - OpenAIRE #OA...
OpenAIRE guidelines and broker service for repository managers - OpenAIRE #OA...
 
Linked Data at the OU - the story so far
Linked Data at the OU - the story so farLinked Data at the OU - the story so far
Linked Data at the OU - the story so far
 
Linked data tooling XML
Linked data tooling XMLLinked data tooling XML
Linked data tooling XML
 
Wed roman tut_open_datapub
Wed roman tut_open_datapubWed roman tut_open_datapub
Wed roman tut_open_datapub
 

Mais de Open Data Support

Open government data and the psi directive et
Open government data and the psi directive etOpen government data and the psi directive et
Open government data and the psi directive etOpen Data Support
 
License your data and metadata et
License your data and metadata etLicense your data and metadata et
License your data and metadata etOpen Data Support
 
Introduction to open data quality et
Introduction to open data quality etIntroduction to open data quality et
Introduction to open data quality etOpen Data Support
 
Designing and developing vocabularies in rdf et
Designing and developing vocabularies in rdf etDesigning and developing vocabularies in rdf et
Designing and developing vocabularies in rdf etOpen Data Support
 
D2.1.2 training module 2.1 the linked open government data lifecycle v1.00
D2.1.2 training module 2.1 the linked open government data lifecycle v1.00D2.1.2 training module 2.1 the linked open government data lifecycle v1.00
D2.1.2 training module 2.1 the linked open government data lifecycle v1.00Open Data Support
 
Podatki & licenciranje metapodatkov
Podatki & licenciranje metapodatkovPodatki & licenciranje metapodatkov
Podatki & licenciranje metapodatkovOpen Data Support
 
Odprti podatki & kakovost metapodatkov
Odprti podatki  & kakovost metapodatkovOdprti podatki  & kakovost metapodatkov
Odprti podatki & kakovost metapodatkovOpen Data Support
 
Uvod v upravljanje z metapodatki
Uvod v upravljanje z metapodatkiUvod v upravljanje z metapodatki
Uvod v upravljanje z metapodatkiOpen Data Support
 
Odprti podatki javnega sektorja & Direktiva PSI
Odprti podatki javnega sektorja & Direktiva PSIOdprti podatki javnega sektorja & Direktiva PSI
Odprti podatki javnega sektorja & Direktiva PSIOpen Data Support
 
Open Data Support - Wie können wir Ihnen helfen?
Open Data Support - Wie können wir Ihnen helfen?Open Data Support - Wie können wir Ihnen helfen?
Open Data Support - Wie können wir Ihnen helfen?Open Data Support
 
Stałe identyfikatory URI – tworzenie i zarządzanie
Stałe identyfikatory URI – tworzenie i zarządzanieStałe identyfikatory URI – tworzenie i zarządzanie
Stałe identyfikatory URI – tworzenie i zarządzanieOpen Data Support
 
Zarządzanie metadanymi – wprowadzenie
Zarządzanie metadanymi – wprowadzenieZarządzanie metadanymi – wprowadzenie
Zarządzanie metadanymi – wprowadzenieOpen Data Support
 
Dane powiązane - wprowadzenie
Dane powiązane - wprowadzenieDane powiązane - wprowadzenie
Dane powiązane - wprowadzenieOpen Data Support
 
Įvadas į susietuosius duomenis
Įvadas į susietuosius duomenisĮvadas į susietuosius duomenis
Įvadas į susietuosius duomenisOpen Data Support
 
Atviri valdžios duomenys ir vsi direktyva
Atviri valdžios duomenys ir vsi direktyvaAtviri valdžios duomenys ir vsi direktyva
Atviri valdžios duomenys ir vsi direktyvaOpen Data Support
 
Open Data Support onsite training in Latvia (Latvian)
Open Data Support onsite training in Latvia (Latvian)Open Data Support onsite training in Latvia (Latvian)
Open Data Support onsite training in Latvia (Latvian)Open Data Support
 
Open Data Support - bridging open data supply and demand
Open Data Support - bridging open data supply and demandOpen Data Support - bridging open data supply and demand
Open Data Support - bridging open data supply and demandOpen Data Support
 
Open Data Support onsite training in Italy (Italian)
Open Data Support onsite training in Italy (Italian)Open Data Support onsite training in Italy (Italian)
Open Data Support onsite training in Italy (Italian)Open Data Support
 

Mais de Open Data Support (20)

Open government data and the psi directive et
Open government data and the psi directive etOpen government data and the psi directive et
Open government data and the psi directive et
 
License your data and metadata et
License your data and metadata etLicense your data and metadata et
License your data and metadata et
 
Introduction to open data quality et
Introduction to open data quality etIntroduction to open data quality et
Introduction to open data quality et
 
Designing and developing vocabularies in rdf et
Designing and developing vocabularies in rdf etDesigning and developing vocabularies in rdf et
Designing and developing vocabularies in rdf et
 
D2.1.2 training module 2.1 the linked open government data lifecycle v1.00
D2.1.2 training module 2.1 the linked open government data lifecycle v1.00D2.1.2 training module 2.1 the linked open government data lifecycle v1.00
D2.1.2 training module 2.1 the linked open government data lifecycle v1.00
 
Podatki & licenciranje metapodatkov
Podatki & licenciranje metapodatkovPodatki & licenciranje metapodatkov
Podatki & licenciranje metapodatkov
 
Odprti podatki & kakovost metapodatkov
Odprti podatki  & kakovost metapodatkovOdprti podatki  & kakovost metapodatkov
Odprti podatki & kakovost metapodatkov
 
Uvod v upravljanje z metapodatki
Uvod v upravljanje z metapodatkiUvod v upravljanje z metapodatki
Uvod v upravljanje z metapodatki
 
Odprti podatki javnega sektorja & Direktiva PSI
Odprti podatki javnega sektorja & Direktiva PSIOdprti podatki javnega sektorja & Direktiva PSI
Odprti podatki javnega sektorja & Direktiva PSI
 
Open Data Support - Wie können wir Ihnen helfen?
Open Data Support - Wie können wir Ihnen helfen?Open Data Support - Wie können wir Ihnen helfen?
Open Data Support - Wie können wir Ihnen helfen?
 
Stałe identyfikatory URI – tworzenie i zarządzanie
Stałe identyfikatory URI – tworzenie i zarządzanieStałe identyfikatory URI – tworzenie i zarządzanie
Stałe identyfikatory URI – tworzenie i zarządzanie
 
Zarządzanie metadanymi – wprowadzenie
Zarządzanie metadanymi – wprowadzenieZarządzanie metadanymi – wprowadzenie
Zarządzanie metadanymi – wprowadzenie
 
Dane powiązane - wprowadzenie
Dane powiązane - wprowadzenieDane powiązane - wprowadzenie
Dane powiązane - wprowadzenie
 
atvirų duomenų kokybė
atvirų duomenų kokybėatvirų duomenų kokybė
atvirų duomenų kokybė
 
Įvadas į susietuosius duomenis
Įvadas į susietuosius duomenisĮvadas į susietuosius duomenis
Įvadas į susietuosius duomenis
 
Atviri valdžios duomenys ir vsi direktyva
Atviri valdžios duomenys ir vsi direktyvaAtviri valdžios duomenys ir vsi direktyva
Atviri valdžios duomenys ir vsi direktyva
 
Open Data Support onsite training in Latvia (Latvian)
Open Data Support onsite training in Latvia (Latvian)Open Data Support onsite training in Latvia (Latvian)
Open Data Support onsite training in Latvia (Latvian)
 
Open Data Support - bridging open data supply and demand
Open Data Support - bridging open data supply and demandOpen Data Support - bridging open data supply and demand
Open Data Support - bridging open data supply and demand
 
Open data quality
Open data qualityOpen data quality
Open data quality
 
Open Data Support onsite training in Italy (Italian)
Open Data Support onsite training in Italy (Italian)Open Data Support onsite training in Italy (Italian)
Open Data Support onsite training in Italy (Italian)
 

Introduction to RDF & SPARQL

  • 1. DATA SUPPORT OPEN Training Module 1.3 Introduction to RDF & SPARQL PwC firms help organisations and individuals create the value they’re looking for. We’re a network of firms in 158 countries with close to 180,000 people who are committed to delivering quality in assurance, tax and advisory services. Tell us what matters to you and find out more by visiting us at www.pwc.com. PwC refers to the PwC network and/or one or more of its member firms, each of which is a separate legal entity. Please see www.pwc.com/structure for further details.
  • 2. DATASUPPORTOPEN This presentation has been created by PwC Authors: Michiel De Keyzer, Nikolaos Loutas and Stijn Goedertier Presentation metadata Slide 2 Open Data Support is funded by the European Commission under SMART 2012/0107 ‘Lot 2: Provision of services for the Publication, Access and Reuse of Open Public Data across the European Union, through existing open data portals’(Contract No. 30-CE- 0530965/00-17). © 2014 European Commission Disclaimers 1. The views expressed in this presentation are purely those of the authors and may not, in any circumstances, be interpreted as stating an official position of the European Commission. The European Commission does not guarantee the accuracy of the information included in this presentation, nor does it accept any responsibility for any use thereof. Reference herein to any specific products, specifications, process, or service by trade name, trademark, manufacturer, or otherwise, does not necessarily constitute or imply its endorsement, recommendation, or favouring by the European Commission. All care has been taken by the author to ensure that s/he has obtained, where necessary, permission to use any parts of manuscripts including illustrations, maps, and graphs, on which intellectual property rights already exist from the titular holder(s) of such rights or from her/his or their legal representative. 2. This presentation has been carefully compiled by PwC, but no representation is made or warranty given (either express or implied) as to the completeness or accuracy of the information it contains. PwC is not liable for the information in this presentation or any decision or consequence based on the use of it.. PwC will not be liable for any damages arising from the use of the information contained in this presentation. The information contained in this presentation is of a general nature and is solely for guidance on matters of general interest. This presentation is not a substitute for professional advice on any particular matter. No reader should act on the basis of any matter contained in this publication without considering appropriate professional advice.
  • 3. DATASUPPORTOPEN Learning objectives By the end of this training module you should have an understanding of: • The Resource Description Framework (RDF). • How to write/read RDF. • How you can describe your data with RDF. • What SPARQL is. • The different types of SPARQL queries. • How to write a SPARQL query. Slide 3
  • 4. DATASUPPORTOPEN Content This module contains ... • An introduction to the Resource Description Framework (RDF) for describing your data. - What is RDF? - How is it structured? - How to represent your data in RDF. • An introduction to SPARQL on how you can query and manipulate data in RDF. • Pointers to further reading, examples and exercises. Slide 4
  • 6. DATASUPPORTOPEN RDF in the stack of Semantic Web technologies • RDF stands for: - Resource: Everything that can have a unique identifier (URI), e.g. pages, places, people, dogs, products... - Description: attributes, features, and relations of the resources - Framework: model, languages and syntaxes for these descriptions • RDF was published as a W3C recommendation in 1999. • RDF was originally introduced as a data model for metadata. • RDF was generalised to cover knowledge of all kinds. Slide 6 See also: http://www.w3.org/RDF/
  • 7. DATASUPPORTOPEN Example: RDF description of an organisation Nike, Dahliastraat 24, 2160 Wommelgem Slide 7 <rdf:RDF xmlns:rov=“http://www.w3.org/TR/vocab-regorg/ “ xmlns:org=“http://www.w3.org/TR/vocab-org/” xmlns:locn=“http://www.w3.org/ns/locn#” > <rov:RegisteredOrganization rdf:about=“http://example.com/org/2172798119”> <rov:legalName> “Nike”< /rov:legalName> <org:hasRegisteredSite rdf:resource=“http://example.com/site/1234”/> </rov:RegisteredOrganization> <locn:Address rdf:about=“http://example.com/site/1234”/> <locn:fullAddress>” Dahliastraat 24, 2160 Wommelgem”</locn:fullAddress> </locn:Address> </rdf:RDF>
  • 9. DATASUPPORTOPEN What is a triple? Slide 9 RDF is a general syntax for representing data on the Web. Every piece of information expressed in RDF is represented as a triple: • Subject – a resource, which may be identified with a URI. • Predicate – a URI-identified reused specification of the relationship. • Object – a resource or literal to which the subject is related. http://example.com/org/2172798119 has as legal name “Nikè”. Subject Predicate Object Example: name of a legal entity:
  • 10. DATASUPPORTOPEN RDF is graph based Graph = A collection of triples Slide 10 http://example.co m/site/1234 http://example.com/ org/2172798119 Nikè has registered site has legal name Dahliastraat 24 2160 Wommelgem full address
  • 11. DATASUPPORTOPEN RDF Syntax RDF/XML Slide 11 <rdf:RDF xmlns:rov=“http://www.w3.org/TR/vocab-regorg/ “ xmlns:org=“http://www.w3.org/TR/vocab-org/” xmlns:locn=“http://www.w3.org/ns/locn#” > <rov:RegisteredOrganization rdf:about=“http://example.com/org/2172798119”> <rov:legalName> “Niké”< /rov:legalName> <org:hasRegisteredSite rdf:resource=“http://example.com/site/1234”/> </rov:RegisteredOrganization> <locn:Address rdf:about=“http://example.com/site/1234”/> <locn:fullAddress>” Dahliastraat 24, 2160 Wommelgem”</locn:fullAddress> </locn:Address> </rdf:RDF> Subject Predicate Object Graph RDF/XML is currently the only syntax that is standardised by W3C. Definition of prefixes Description of data – triples
  • 12. DATASUPPORTOPEN RDF Syntax Turtle Slide 12 Subject Predicate Object @prefix rov: <http://www.w3.org/TR/vocab-regorg/> . @prefix org: <http://www.w3.org/TR/vocab-org/> . @prefix locn: <http://www.w3.org/ns/locn#> . < http://example.com/org/2172798119 > a <rov:RegisteredOrganization> ; rov:legalName “Niké “; org:hasRegisteredSite <http://example.com/site/1234> . <http://example.com/site/1234> a <locn:Address> ; locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” . Graph Turtle will be standardised in RDF 1.1. See also: http://www.w3.org/2009/12/rdf-ws/papers/ws11 Definition of prefixes Description of data – triples
  • 13. DATASUPPORTOPEN RDF Syntax RDFa Slide 13 Subject Predicate Object <html> <head> ... </head> <body> ... <div resource=“http://example.com/org/2172798119” typeof= “http://www.w3.org/TR/vocab-regorg/RegisteredOrganization”> <p> <span property=" http://www.w3.org/TR/vocab-regorg/legalName">Nike<span> Address: <span property="http://www.w3.org/ns/locn#fullAddress"> Dahliastraat 24, 2160 Wommelgem </span> </p></div> </body> See also: http://www.w3.org/TR/2012/NOTE-rdfa-primer-20120607/ embedding RDF data in HTML
  • 14. DATASUPPORTOPEN How to represent data in RDF Classes, properties and vocabularies Slide 14
  • 15. DATASUPPORTOPEN RDF Vocabulary Slide 15 “A vocabulary is a data model comprising classes, properties and relationships which can be used for describing your data and metadata.” • RDF Vocabularies are sets of terms used to describe things. • A term is either a class or a property.  Object type properties (relationships)  Data type properties (attributes)
  • 16. DATASUPPORTOPEN What are classes, relationships and properties? • Class. A construct that represents things in the real and/or information world, e.g. a person, an organisation, a concepts such as “health” or “freedom”. • Relationship. A link between two classes; for the link between a document and the organisation that published it (i.e. organisation publishes document), or the link between a map and the geographic region it depicts (i.e. map depicts geographic region). In RDF relationships are encoded as object type properties. • Property. A characteristic of a class in a particular dimension such as the legal name of an organisation or the date and time that an observation was made. Slide 16
  • 17. DATASUPPORTOPEN Examples of classes, relationships and properties Slide 17 http://.../org/217279 8119 site http://example.com/site /1234 RegisteredOrganisation Address Dahliastraat 24, 2160 Wommelgem“Nikè” a a fullAddresslegalName ClassProperty Relationship
  • 18. DATASUPPORTOPEN Reusing RDF vocabularies • Reuse greatly aids interoperability of your data. Use of dcterms:created, for example, the value for which should be a data typed date such as 2013-02-21^^xsd:date, is immediately processable by many machines. If your schema encourages data publishers to use a different term and date format, such as ex:date "21 February 2013" – data published using your schema will require further processing to make it the same as everyone else's. • Reuse adds credibility to your schema. It shows it has been published with care and professionalism, again, this promotes its reuse. • Reuse is easier and cheaper. Reusing classes and properties from well defined and properly hosted vocabularies avoids your having to replicate that effort. Slide 18 See also: https://joinup.ec.europa.eu/community/semic/document/cookbook- translating-data-models-rdf-schemas http://www.slideshare.net/OpenDataSupport/model-your-data-metadata
  • 19. DATASUPPORTOPEN Where can I find existing vocabularies? Slide 19 Refinethesearch results via the facetedsearch filters. 2 1 3 http://lov.okfn.org/ http://joinup.ec.europa.eu/
  • 20. DATASUPPORTOPEN Well-known vocabularies Slide 20 Friend-of-a-Friend (FOAF) Vocabulary for describing people Core Person Vocabulary Vocabulary to describe the fundamental characteristics of a person, e.g. the name, the gender, the date of birth... DOAP Vocabulary for describing projects DCAT-AP Vocabulary based on the Data Catalogue vocabulary (DCAT) for describing public sector datasets in Europe. ADMS Vocabulary for describing interoperability assets. Dublin Core Defines general metadata attributes Registered Organisation Vocabulary Vocabulary for describing organizations, typically in a national or regional register Organization Ontology for describing the structure of organizations Core Location Vocabulary Vocabulary capturing the fundamental characteristics of a location. Core Public Service Vocabulary Vocabulary capturing the fundamental characteristics of a service offered by public administration schema.org Agreed vocabularies for publishing structured data on the Web elaborated by Google, Yahoo and Microsoft See also: http://www.w3.org/wiki/TaskForces/CommunityProj ects/LinkingOpenData/CommonVocabularies
  • 21. DATASUPPORTOPEN Model your own vocabulary as an RDF Schema If there is no suitable authoritative reusable vocabulary for describing your data, use conventions for describing your own vocabulary: - RDF Schema (RDFS) - Web Ontology Language (OWL) Example: definition of a class : Slide 21 cpsv:PublicService a rdfs:Class, owl:Class; rdfs:label "Public Service"@en; rdfs:comment "This class represents the service itself. As noted in the scope, a public service is the capacity to carry out a procedure and exists whether it is used or not. It is a set of deeds and acts performed by or on behalf of a public agency for the benefit of a citizen, a business or another public agency."@en. See also: http://www.slideshare.net/OpenDataSupport/model-your- data-metadata
  • 23. DATASUPPORTOPEN About SPARQL SPARQL is the standard language to query graph data represented as RDF triples. • SPARQL Protocol and RDF Query Language • One of the three core standards of the Semantic Web, along with RDF and OWL. • Became a W3C standard January 2008. • SPARQL 1.1 now in Working Draft status. Slide 23
  • 24. DATASUPPORTOPEN Types of SPARQL queries • SELECT Return a table of all X, Y, etc. satisfying the following conditions ... • CONSTRUCT Find all X, Y, etc. satisfying the following conditions ... and substitute them into the following template in order to generate (possibly new) RDF statements, creating a new graph. • DESCRIBE Find all statements in the dataset that provide information about the following resource(s) ... (identified by name or description) • ASK Are there any X, Y, etc. satisfying the following conditions ... Slide 24 See also: http://www.euclid-project.eu/modules/chapter2
  • 25. DATASUPPORTOPEN PREFIX rov: <http://www.w3.org/TR/vocab-regorg/> SELECT ?name WHERE { ?x rov:legalName ?name } Structure of a SPARQL Query Slide 25 Type of query Variables, i.e. what to search for RDF triple patterns, i.e. the conditions that have to be met Definition of prefixes
  • 26. DATASUPPORTOPEN SELECT – return the name of an organisation with particular URI Slide 26 comp:A rov:haslegalName “Niké” . comp:A org:hasRegisteredSite site:1234 . Comp:B rov:haslegalName “BARCO” . site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem . PREFIX comp: < http://example/org/org/> PREFIX org: < http://www.w3.org/TR/vocab-regorg/ > PREFIX site: <http://example.org/site/> PREFIX rov: <http://www.w3.org/TR/vocab-regorg/> SELECT ?name WHERE { ?x org:hasRegisteredSite site:1234 . ?x rov:haslegalName ?name .} name “Niké” Sample data Query Result
  • 27. DATASUPPORTOPEN SELECT - return the name and address of organisations Slide 27 PREFIX org: < http://www.w3.org/TR/vocab-regorg/ > PREFIX locn:< http://www.w3.org/ns/locn#> PREFIC rov:<http://www.w3.org/TR/vocab-regorg/> SELECT ?name ?address WHERE { ?x org:hasRegisteredSite ?site. ?x rov:haslegalName ?name . ?site locn:fullAddress ?address . } name address “Niké” “Dahliastraat 24, 2160 Wommelgem” comp:A rov:haslegalName “Niké” . comp:A org:hasRegisteredSite site:1234 . Comp:B rov:haslegalName “BARCO” . site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” . Sample data Query Result
  • 28. DATASUPPORTOPEN SELECT - Return all books under a certain price (1/2) Slide 28 @prefix dc: <http://purl.org/dc/elements/1.1/> . @prefix : <http://example.org/book/> . @prefix ns: <http://example.org/ns#> . :book1 dc:title "SPARQL Tutorial" . :book1 ns:price 42 . :book2 dc:title "The Semantic Web" . :book2 ns:price 23 . Sample data
  • 29. DATASUPPORTOPEN SELECT – Return all books under a certain price (2/2) Slide 29 PREFIX dc: <http://purl.org/dc/elements/1.1/> . PREFIX : <http://example.org/book/> . PREFIX ns: <http://example.org/ns#> . SELECT ?book ?title WHERE { ?book dc:title ?title . ?book ns:price ?price . FILTER ( ?price < 40 ) } book title :book2 “The Semantic Web” Query Result
  • 30. DATASUPPORTOPEN CONSTRUCT – Create a new graph with another label for name Slide 30 @prefix comp: <http://example/org/> . @prefix rdfs: <http://www.w3.org/TR/rdf-schema/> comp:a rdfs:label “Niké" . comp:b rdfs:label “BARCO" . comp:A rov:haslegalName “Niké” . comp:A org:hasRegisteredSite site:1234 . comp:B rov:haslegalName “BARCO” . site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” . PREFIX comp: < http://example/org/org/> PREFIX org: < http://www.w3.org/TR/vocab-regorg/ > PREFIC rdfs: <http://www.w3.org/TR/rdf-schema/> CONSTRUCT {?comp rdfs:label ?name} WHERE { ?comp org:haslegalName ?name. } Sample data Query Resulting graph
  • 31. DATASUPPORTOPEN DESCRIBE – Return all triples of organisations registered at a particular site Slide 31 PREFIX comp: <http://example/org/> PREFIX site: <http://example/site> PREFIX org: < http://www.w3.org/TR/vocab-regorg/ DESCRIBE ?organisation WHERE {?organisation org:hasRegisteredSite site:1234} @prefix comp: <http://example/org/> . @prefix org: <http://www.w3.org/TR/vocab-regorg/> . comp:A has:legalName “Niké” . comp:A org:hasRegisteredSite site:1234 . comp:A rov:haslegalName “Niké” . comp:A org:hasRegisteredSite site:1234 . comp:B rov:haslegalName “BARCO” . site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” . Sample data Query Result
  • 32. DATASUPPORTOPEN DESCRIBE – Return all triples associated to a particular resource (organisation) Slide 32 PREFIX comp: <http://example/org/> DESCRIBE comp:A @prefix comp: <http://example/org/> . @prefix org: <http://www.w3.org/TR/vocab-regorg/> . comp:A rov:haslegalName “Niké” . comp:A org:hasRegisteredSite site:1234 . comp:A rov:haslegalName “Niké” . comp:A org:hasRegisteredSite site:1234 . comp:B rov:haslegalName “BARCO” . site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” . Sample data Query Result
  • 33. DATASUPPORTOPEN ASK – Are there any organisations having “1234” as their registered site? Slide 33 PREFIX org: < http://www.w3.org/TR/vocab-regorg/ ASK WHERE {?organisation org:hasRegisteredSite site:1234} TRUE comp:A rov:haslegalName “Niké” . comp:A org:hasRegisteredSite site:1234 . comp:B rov:haslegalName “BARCO” . site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” . Sample data Query Result
  • 34. DATASUPPORTOPEN ASK – Is there a registered site for organisation “BARCO”? Slide 34 PREFIX comp: <http://example/org/> PREFIX org: <http://www.w3.org/TR/vocab-regorg/> ASK WHERE {comp:B org:hasRegisteredSite ?site .} FALSE comp:A rov:haslegalName “Niké” . comp:A org:hasRegisteredSite site:1234 . comp:B rov:haslegalName “BARCO” . site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” . Sample data Query Result
  • 35. DATASUPPORTOPEN SPARQL Update Can be used for... • Adding data (INSERT) • Deleting data (DELETE) • Loading RDF Graph (LOAD / LOAD .. INTO) • Clearing an RDF Graph (CLEAR GRAPH) • Creating RDF Graphs (CREATE GRAPH) • Removing RDF Graphs (DROP GRAPH) • Copying RDF Graphs (COPY GRAPH ... TO GRAPH) • Moving RDF Graphs (MOVE GRAPH ... TO GRAPH) • Adding RDF Graphs (ADD GRAPH TO GRAPH) Slide 35 See also: http://www.euclid-project.eu/modules/chapter2 http://www.w3.org/TR/sparql11-update/
  • 36. DATASUPPORTOPEN INSERT – Add a registered site for “BARCO”? Slide 36 comp:A rov:haslegalName “Niké” . comp:A org:hasRegisteredSite site:1234 . comp:B rov:haslegalName “BARCO” . site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” . Sample data comp:A rov:haslegalName “Niké” . comp:A org:hasRegisteredSite site:1234 . comp:B rov:haslegalName “BARCO” . comp:B org:hasRegisteredSite site:5678 . site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” . site:5678 locn:fullAddress “President Kennedypark 35, 8500 Kortrijk“ . PREFIX comp: <http://example/org/> PREFIX org: <http://www.w3.org/TR/vocab-regorg/> INSERT DATA { site:5678 locn:fullAddress “President Kennedypark 35, 8500 Kortrijk“ . comp:B org:hasRegisteredSite site:5678 . } Query Result
  • 37. DATASUPPORTOPEN INSERT/DELETE – Change the address for “Niké”? Slide 37 comp:A rov:haslegalName “Niké” . comp:A org:hasRegisteredSite site:1234 . comp:B rov:haslegalName “BARCO” . site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” . Data PREFIX comp: <http://example/org/> PREFIX org: <http://www.w3.org/TR/vocab-regorg/> DELETE DATA { comp:A org:hasRegisteredSite site:1234 . } INSERT DATA { site:5678 locn:fullAddress “Rue de Loi 34, 1000 Bruxelles“ . comp:A org:hasRegisteredSite site:5678 . } Query comp:A rov:haslegalName “Niké” . comp:A org:hasRegisteredSite site:1000. site:1234 locn:fullAddress “Dahliastraat 24, 2160 Wommelgem” . site:1000 locn:fullAddress “Rue de Loi 34, 1000 Bruxelles“ . Result
  • 38. DATASUPPORTOPEN Summary • RDF is a general way to express data intended for publishing on the Web. • RDF data is expressed in triples: subject, predicate, object. • Different syntaxes exist for expressing data in RDF. • SPARQL is a standardised language to query graph data expressed as RDF. • SPARQL can be used to query and update RDF data. Slide 38
  • 39. DATASUPPORTOPEN Thank you! ...and now YOUR questions? Slide 39 Take the online test here!
  • 40. DATASUPPORTOPEN References Slide 6: • Semantic Web Stack. W3C. http://www.w3.org/DesignIssues/diagrams/sweb- stack/2006a.png Slides 18& 20: • Linked Data Cookbook. W3C. http://www.w3.org/2011/gld/wiki/Linked_Data_Cookbook Slide 21: • Cookbook for translating data models to RDF schemas. ISA Programme. https://joinup.ec.europa.eu/community/semic/document/cookbook-translating- data-models-rdf-schemas Slide 22: • Common Vocabularies / Ontologies / Micromodels. W3C. http://www.w3.org/wiki/TaskForces/CommunityProjects/LinkingOpenData/Co mmonVocabularies Slide 23-24: • SPARQL Query Language for RDF. W3C. http://www.w3.org/TR/rdf-sparql- query/ Slide 24: • Module 2: Querying Linked Data. EUCLID. http://www.euclid- project.eu/modules/course2 Slide 35: • Module 2: Querying Linked Data. EUCLID. http://www.euclid- project.eu/modules/course2 • SPARQL 1.1 Update. W3C.. http://www.w3.org/TR/sparql11-update/ Slide 40
  • 41. DATASUPPORTOPEN Further reading Learning SPARQL. Bob DuCharme. http://www.learningsparql.com/ Semantic Web for the working ontologist. Dean Allemang, Jim Hendler. http://workingontologist.org/ EUCLID - Course 2: Querying Linked Data http://www.euclid-project.eu/modules/course2 Slide 41
  • 42. DATASUPPORTOPEN Related projects and initiatives Joinup, https://joinup.ec.europa.eu/ Linked Open Vocabularies, http://okfn.org/ W3C GLD WG, http://www.w3.org/2011/gld/wiki/Main_Page W3C Schools – Learn RDF http://www.w3schools.com/rdf/default.asp EUCLID, http://euclid-project.eu/ TopBraid Composer Protégé Ontology Editor , http://protege.stanford.edu/ XML Summer School http://xmlsummerschool.com/ Slide 42
  • 43. DATASUPPORTOPEN Be part of our team... Find us on Contact us Join us on Follow us Open Data Support http://www.slideshare.net/OpenDataSupport http://www.opendatasupport.euOpen Data Support http://goo.gl/y9ZZI @OpenDataSupport contact@opendatasupport.eu Slide 43