19
Querying the Web of Data with XSPARQL 1.1 Daniele Dell’Aglio (DEIB, Politecnico di Milano) Axel Polleres (Vienna University of Economics and Business) Nuno Lopes (IBM Research Ireland) Stefan Bischof (SIEMENS Austria)

Querying the Web of Data with XSPARQL 1.1

Embed Size (px)

DESCRIPTION

My presentation on XSPARQL 1.1 at ISWC Developer Workshop at ISWC 2014

Citation preview

Page 1: Querying the Web of Data with XSPARQL 1.1

Querying the Web of Data with

XSPARQL 1.1

Daniele Dell’Aglio (DEIB, Politecnico di Milano)

Axel Polleres (Vienna University of Economics and Business)

Nuno Lopes (IBM Research Ireland)

Stefan Bischof (SIEMENS Austria)

Page 2: Querying the Web of Data with XSPARQL 1.1

/ 8

What is XSPARQL?

19 October 2014 - ISWC Dev Workshop 2014 Querying the Web of Data with XSPARQL 1.1 2

XSPARQL is a transformation language to conveniently

query XML and RDF side-by-side

It is a syntactic extension of XQuery

A SPARQL-for clause to query RDF data (by using SPARQL

operators)

A CONSTRUCT clause to produce RDF output

Page 3: Querying the Web of Data with XSPARQL 1.1

/ 8

What is XSPARQL?

19 October 2014 - ISWC Dev Workshop 2014 Querying the Web of Data with XSPARQL 1.1 2

XSPARQL is a transformation language to conveniently

query XML and RDF side-by-side

It is a syntactic extension of XQuery

A SPARQL-for clause to query RDF data (by using SPARQL

operators)

A CONSTRUCT clause to produce RDF output

Several improvements during the years

Support for querying RDBMS data sources

Support for R2RML

Query optimisations

Page 4: Querying the Web of Data with XSPARQL 1.1

/ 8

Where to go to learn headbanging?

We want to retrieve the list of upcoming concerts of music artists having Nuclear Blast as music label

Pic

ture

s fr

om

Wik

ipedia

19 October 2014 - ISWC Dev Workshop 2014 Querying the Web of Data with XSPARQL 1.1 3

Page 5: Querying the Web of Data with XSPARQL 1.1

/ 8

Where to go to learn headbanging?

We want to retrieve the list of upcoming concerts of music artists having Nuclear Blast as music label

We can get

The list of the artists from DBPedia

Pic

ture

s fr

om

Wik

ipedia

19 October 2014 - ISWC Dev Workshop 2014 Querying the Web of Data with XSPARQL 1.1 3

Page 6: Querying the Web of Data with XSPARQL 1.1

/ 8

Where to go to learn headbanging?

We want to retrieve the list of upcoming concerts of music artists having Nuclear Blast as music label

We can get

The list of the artists from DBPedia

The concerts on Last.fm

Pic

ture

s fr

om

Wik

ipedia

19 October 2014 - ISWC Dev Workshop 2014 Querying the Web of Data with XSPARQL 1.1 3

Page 7: Querying the Web of Data with XSPARQL 1.1

/ 8

Where to go to learn headbanging?

We want to retrieve the list of upcoming concerts of music artists having Nuclear Blast as music label

We can get

The list of the artists from DBPedia

The concerts on Last.fm

And put data… together?

Different data sources

Different formats (JSON, RDF)

Pic

ture

s fr

om

Wik

ipedia

19 October 2014 - ISWC Dev Workshop 2014 Querying the Web of Data with XSPARQL 1.1 3

Page 8: Querying the Web of Data with XSPARQL 1.1

/ 8

Where to go to learn headbanging?

We want to retrieve the list of upcoming concerts of music artists having Nuclear Blast as music label

We can get

The list of the artists from DBPedia

The concerts on Last.fm

And put data… together?

Different data sources

Different formats (JSON, RDF)

Pic

ture

s fr

om

Wik

ipedia

19 October 2014 - ISWC Dev Workshop 2014 Querying the Web of Data with XSPARQL 1.1 3

Page 9: Querying the Web of Data with XSPARQL 1.1

/ 8

How can XSPARQL 1.1 help us?

1. prefix lastfm: <http://xsparql.deri.org/lastfm#>

2. prefix dbprop: http://dbpedia.org/property/

3. prefix dbpedia: <http://dbpedia.org/resource/>

4. for *

5. where {

6. service <http://dbpedia.org/sparql> {

7. $artist a dbowl:Band ;

8. dbprop:label dbpedia:Nuclear_Blast ;

9. dbprop:name $artistName .

10. }

11. }

12. return

13. let $doc := fn:concat("http://ws.../artist=",$artistName)

14. for $event in xsparql:json-doc($doc)//events/event/*

15. construct {

16. [] a lastfm:Event ;

17. lastfm:artist {$artistName} ;

18. lastfm:venue {$event/venue/location/city} ;

19. last:date {$event/startDate}

20. }

19 October 2014 - ISWC Dev Workshop 2014 Querying the Web of Data with XSPARQL 1.1 4

Page 10: Querying the Web of Data with XSPARQL 1.1

/ 8

How can XSPARQL 1.1 help us?

1. prefix lastfm: <http://xsparql.deri.org/lastfm#>

2. prefix dbprop: http://dbpedia.org/property/

3. prefix dbpedia: <http://dbpedia.org/resource/>

4. for *

5. where {

6. service <http://dbpedia.org/sparql> {

7. $artist a dbowl:Band ;

8. dbprop:label dbpedia:Nuclear_Blast ;

9. dbprop:name $artistName .

10. }

11. }

12. return

13. let $doc := fn:concat("http://ws.../artist=",$artistName)

14. for $event in xsparql:json-doc($doc)//events/event/*

15. construct {

16. [] a lastfm:Event ;

17. lastfm:artist {$artistName} ;

18. lastfm:venue {$event/venue/location/city} ;

19. last:date {$event/startDate}

20. }

Support of SPARQL 1.1

operators: Assignment/Project Expressions

Aggregate functions: SUM, AVG,...

Federation

Negation

Property paths

Subqueries

19 October 2014 - ISWC Dev Workshop 2014 Querying the Web of Data with XSPARQL 1.1 4

Page 11: Querying the Web of Data with XSPARQL 1.1

/ 8

How can XSPARQL 1.1 help us?

1. prefix lastfm: <http://xsparql.deri.org/lastfm#>

2. prefix dbprop: http://dbpedia.org/property/

3. prefix dbpedia: <http://dbpedia.org/resource/>

4. for *

5. where {

6. service <http://dbpedia.org/sparql> {

7. $artist a dbowl:Band ;

8. dbprop:label dbpedia:Nuclear_Blast ;

9. dbprop:name $artistName .

10. }

11. }

12. return

13. let $doc := fn:concat("http://ws.../artist=",$artistName)

14. for $event in xsparql:json-doc($doc)//events/event/*

15. construct {

16. [] a lastfm:Event ;

17. lastfm:artist {$artistName} ;

18. lastfm:venue {$event/venue/location/city} ;

19. last:date {$event/startDate}

20. }

Support of SPARQL 1.1

operators: Assignment/Project Expressions

Aggregate functions: SUM, AVG,...

Federation

Negation

Property paths

Subqueries

Processing of JSON files

19 October 2014 - ISWC Dev Workshop 2014 Querying the Web of Data with XSPARQL 1.1 4

Page 12: Querying the Web of Data with XSPARQL 1.1

/ 8

How does it work?

xsp

arql

eva

luat

or

xsp

arql

rew

rite

r

XSPARQL

query data

xsp

arql-cl

i JA

R L

ibra

ry

19 October 2014 - ISWC Dev Workshop 2014 Querying the Web of Data with XSPARQL 1.1 5

Page 13: Querying the Web of Data with XSPARQL 1.1

/ 8

How does it work?

XQuery

query

xsp

arql

eva

luat

or

xsp

arql

rew

rite

r

lexer/parser

rewriter

optimizer

XSPARQL

query data

xsp

arql-cl

i JA

R L

ibra

ry

19 October 2014 - ISWC Dev Workshop 2014 Querying the Web of Data with XSPARQL 1.1 5

Page 14: Querying the Web of Data with XSPARQL 1.1

/ 8

How does it work?

XQuery

query

XQuery engine

SPARQL engine xsp

arql

eva

luat

or

xsp

arql

rew

rite

r

lexer/parser

rewriter

optimizer

XSPARQL

query

answer

(XML|RDF)

data

xsp

arql-cl

i JA

R L

ibra

ry

19 October 2014 - ISWC Dev Workshop 2014 Querying the Web of Data with XSPARQL 1.1 5

Page 15: Querying the Web of Data with XSPARQL 1.1

/ 8

How does it work?

XQuery

query

XQuery engine

SPARQL engine xsp

arql

eva

luat

or

xsp

arql

rew

rite

r

lexer/parser

rewriter

optimizer

XSPARQL

query

answer

(XML|RDF)

data

xsp

arql-cl

i JA

R L

ibra

ry

19 October 2014 - ISWC Dev Workshop 2014 Querying the Web of Data with XSPARQL 1.1 5

Page 16: Querying the Web of Data with XSPARQL 1.1

/ 8

How does it work?

XSPARQLEvaluator evalutor =

new XSPARQLEvaluator();

Reader query = ...;

Writer out = ...;

evalutor.evaluate(query, out);

XQuery

query

XQuery engine

SPARQL engine xsp

arql

eva

luat

or

xsp

arql

rew

rite

r

lexer/parser

rewriter

optimizer

XSPARQL

query

answer

(XML|RDF)

data

xsp

arql-cl

i JA

R L

ibra

ry

19 October 2014 - ISWC Dev Workshop 2014 Querying the Web of Data with XSPARQL 1.1 5

Page 17: Querying the Web of Data with XSPARQL 1.1

/ 8

Whats next?

19 October 2014 - ISWC Dev Workshop 2014 Querying the Web of Data with XSPARQL 1.1 6

Use of different SPARQL engines

openRDF and Strabon

Support to JSON-LD

No full control flow

XQUERY/XSPARQL don’t allow you to specify politeness (e.g.

crawl delays between doc(.) calls)

Page 18: Querying the Web of Data with XSPARQL 1.1

/ 8

Thank you!

Querying the Web of Data with XSPARQL 1.1

http://xsparql.deri.org

http://sourceforge.net/projects/xsparql

Daniele Dell’Aglio, Axel Polleres, Nuno Lopes

and Stefan Bischof

[email protected]

(Thank you, SWSA and Google, for my Student Travel

grant!)

19 October 2014 - ISWC Dev Workshop 2014 Querying the Web of Data with XSPARQL 1.1 7

Page 19: Querying the Web of Data with XSPARQL 1.1

/ 8

The last slide :)

19 October 2014 - ISWC Dev Workshop 2014 Querying the Web of Data with XSPARQL 1.1

XQuery

query

XQuery engine

SPARQL engine xsp

arql

eva

luat

or

xsp

arql

rew

rite

r

lexer/parser

rewriter

optimizer

XSPARQL

query

answer

(XML|RDF)

data

xsp

arql-cl

i JA

R L

ibra

ry

Pic

ture

s fr

om

Wik

ipedia

8