Top Banner
Technology Primer SESAM4 2011 SESAM4 Consortium 2009 – 2011 Published under Creative Commons license NFR Verdikt Project n o 2342453 Semantic Techno SPARQL SPARQL Protocol And RDF Query Language Robert Engels
17

Sesam4 project presentation sparql - april 2011

May 16, 2015

Download

Technology

sesam4able

This slide set is a provided by the SESAM4 consortium as one out of three Technology Primers on Semantic Web technology. This Primer is on SPARQL and gives you a short introduction to its constructs followed by some examples. You can find the belonging slideset at youtube under SESAM4.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Sesam4   project presentation sparql - april 2011

Technology PrimerSESAM4 2011

SESAM4 Consortium 2009 – 2011Published under Creative Commons license

NFR Verdikt Project no 2342453 Semantic Technology

SPARQLSPARQL Protocol And RDF Query Language

Robert Engels

Page 2: Sesam4   project presentation sparql - april 2011

Technology PrimerSESAM4 2011

SESAM4 Consortium 2009 – 2011Published under Creative Commons license

from local to globalInformation management in the digital age

From Locally isolated ... ... to Globally interconnected

Page 3: Sesam4   project presentation sparql - april 2011

Technology PrimerSESAM4 2011

SESAM4 Consortium 2009 – 2011Published under Creative Commons license

But What CAN you get out of this?

Page 4: Sesam4   project presentation sparql - april 2011

Technology PrimerSESAM4 2011

SESAM4 Consortium 2009 – 2011Published under Creative Commons license

What is SPARQL? Query Language for interlinked graphs

represented using RDF/OWL annotations

SPARQL 1.0: W3C recommendation 2008

SPARQL 1.1: nearly a recommendation

Page 5: Sesam4   project presentation sparql - april 2011

Technology PrimerSESAM4 2011

SESAM4 Consortium 2009 – 2011Published under Creative Commons license

Why SPARQL? allows for querying RDF/OWL data & models

allows to define globally unambiguous queries

allows for distributed querying of datasets

query results can be merged automatically

Page 6: Sesam4   project presentation sparql - april 2011

Technology PrimerSESAM4 2011

SESAM4 Consortium 2009 – 2011Published under Creative Commons license

What can you do with SPARQL? various result types

DESCRIBE, SELECT, ASK & CONSTRUCT

create result sets using known operators a union of two sets (UNION) a set representing the reverse of a statement (NOT) ….

algoritmic operators like count, avg, & sum specific to SPARQL 1.1

Page 7: Sesam4   project presentation sparql - april 2011

Technology PrimerSESAM4 2011

SESAM4 Consortium 2009 – 2011Published under Creative Commons license

SPARQL - “DESCRIBE”

Suppose The only thing you have is an Uri like this And no idea what is known about it....

http://data.esis.no/resource/projectID_111667

Simply send a SPARQL “DESCRIBE” to a sparql endpoint

DESCRIBE <http://data.esis.no/resource/projectID_111667>

Page 8: Sesam4   project presentation sparql - april 2011

Technology PrimerSESAM4 2011

SESAM4 Consortium 2009 – 2011Published under Creative Commons license

“DESCRIBE” This node for me:

Result of SPARQL - “DESCRIBE”

Page 9: Sesam4   project presentation sparql - april 2011

Technology PrimerSESAM4 2011

SESAM4 Consortium 2009 – 2011Published under Creative Commons license

Result of SPARQL - “DESCRIBE”

1

1

1

1

1

2

2

Page 10: Sesam4   project presentation sparql - april 2011

Technology PrimerSESAM4 2011

SESAM4 Consortium 2009 – 2011Published under Creative Commons license

SPARQL - “SElect”

... or you know what to look for and want to select specific resources.

Send a sparql “select” to a sparql endpoint

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>PREFIX dct: <http://purl.org/dc/terms/>PREFIX nfr: <http://data.esis.no/resource/>PREFIX foaf: <http://xmlns.com/foaf/0.1/>

SELECT ?projectID ?projectName WHERE { ?projectID a foaf:Project ;

dct:title ?projectName ; nfr:orgnrResponsibleOrg <https://ws.brreg.no/lod/enhet/962392687> .

}

Page 11: Sesam4   project presentation sparql - april 2011

Technology PrimerSESAM4 2011

SESAM4 Consortium 2009 – 2011Published under Creative Commons license

SPARQL - “SELECT”

Page 12: Sesam4   project presentation sparql - april 2011

Technology PrimerSESAM4 2011

SESAM4 Consortium 2009 – 2011Published under Creative Commons license

RESULT SPARQL - “SELECT”

Page 13: Sesam4   project presentation sparql - april 2011

Technology PrimerSESAM4 2011

SESAM4 Consortium 2009 – 2011Published under Creative Commons license

SPARQL - “CONSTRUCT”

REPLACE NEW

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>PREFIX dct: <http://purl.org/dc/terms/>PREFIX nfr: <http://data.esis.no/resource/>PREFIX foaf: <http://xmlns.com/foaf/0.1/>PREFIX funder: <http://research.data.gov.uk/def/project/>

CONSTRUCT { ?projectID funder:title ?title }

WHERE { ?projectID a foaf:Project; dct:title ?title ; nfr:orgnrResponsibleOrg <https://ws.brreg.no/lod/enhet/962392687> . }

Page 14: Sesam4   project presentation sparql - april 2011

Technology PrimerSESAM4 2011

SESAM4 Consortium 2009 – 2011Published under Creative Commons license

SPARQL - “ASK”

TRUE or FALSE?

PREFIX nfr: <http://data.esis.no/resource/>ASK { ?projectID nfr:orgnrResponsibleOrg <https://ws.brreg.no/lod/enhet/962392687> }

Page 15: Sesam4   project presentation sparql - april 2011

Technology PrimerSESAM4 2011

SESAM4 Consortium 2009 – 2011Published under Creative Commons license

Try it yourself!

http://data.esis.no:2020/query.html

http://opendata.computas.no:7001/joseki/

Page 16: Sesam4   project presentation sparql - april 2011

Technology PrimerSESAM4 2011

SESAM4 Consortium 2009 – 2011Published under Creative Commons license

Further reading

SPARQL 1.0 - W3C recommendation 2008 http://www.w3.org/TR/rdf-sparql-query/

SPARQL 1.1 – W3C SPARQL working group Wiki http://www.w3.org/2009/sparql/wiki/Main_Page

Extensive tutorials by HP and Talis (and many others...) http://openjena.org/ARQ/Tutorial/index.html

http://www.slideshare.net/ldodds/sparql-tutorial

Page 17: Sesam4   project presentation sparql - april 2011

Technology PrimerSESAM4 2011

SESAM4 Consortium 2009 – 2011Published under Creative Commons license

www.sesam4.net