ldql: a query language for the web of linked data

24
LDQL: A Query Language for the Web of Linked Data Olaf Hartig¹ and Jorge Pérez² ¹Hasso Plattner Institute, University of Potsdam, Germany ²Department of Computer Science, Universidad de Chile

Upload: olaf-hartig

Post on 23-Jan-2018

1.624 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Languagefor the Web of Linked Data

Olaf Hartig¹ and Jorge Pérez²

¹Hasso Plattner Institute, University of Potsdam, Germany

²Department of Computer Science, Universidad de Chile

Page 2: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 2

Linked Data Query Processing

Page 3: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 3

Research Question

What languagecan we use to express queries

(in a declarative manner)?

Page 4: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 4

Existing Proposals 1/2

● Basic Graph Patterns– Bounded method [Bouquet, Ghidini, Serafini 2009]

– Navigational method [Bouquet, Ghidini, Serafini 2009]

– Direct access method [Bouquet, Ghidini, Serafini 2009]

– Matching-based query semantics [Hartig 2011]

– Family of authoritativeness-based query semantics [Harth and Speiser 2012]

– Different inference-based query semantics[Umbrich et al. 2012]

Page 5: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 5

Existing Proposals 2/2

● SPARQL 1.0– Full-Web query semantics [Hartig 2012]

– Family of reachability-based semantics [Hartig 2012]

● c ALL-semantics, c NONE -semantics, c MATCH -semantics, …

● SPARQL 1.1 Property Paths Patterns– Context-based query semantics [Hartig and Pirrò 2015]

● NautiLOD [Fionda, Gutierrez, and Pirrò 2012]

● LDPath (no formal semantics) [Schaffert et al. 2012]

Page 6: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 6

Limitation of Existing Proposals

● No separation of the following two tasks:

– Select query-relevant regions of the Web of Linked Data

– Evaluate pattern over the data in the selected regions

● For instance, impossible to express queries such as:

– Take all Linked Data reached by followingtwo foaf:knows links starting from URI u, and evaluate a given SPARQL patternover the union of this data.

Page 7: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 7

General Idea of LDQL

Query Specification ofquery-relevant

region

( N , Q )

Page 8: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 8

Our Contributions

● Formal syntax and semantics of LDQL– Including some rewrite rules (i.e., equivalences)

● Study Web safeness of LDQL queries– Show a decidable syntactic property of LDQL queries

for which a complete execution is feasible in practice

● Compare LDQL with existing proposals– Show that LDQL is strictly more expressive

? ? ?

? ? ??

?

Page 9: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 9

Existing Proposals 2/2

● SPARQL 1.0– Full-Web query semantics [Hartig 2012]

– Family of reachability-based semantics [Hartig 2012]

● c ALL-semantics, c NONE -semantics, c MATCH -semantics, …

● SPARQL 1.1 Property Paths Patterns– Context-based query semantics [Hartig and Pirrò 2015]

● NautiLOD [Fionda, Gutierrez, and Pirrò 2012]

● LDPath (no formal semantics) [Schaffert et al. 2012]

√√

√ √ √

Page 10: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 10

Our Contributions

● Formal syntax and semantics of LDQL– Including some rewrite rules (i.e., equivalences)

● Study Web safeness of LDQL queries– Show a decidable syntactic property of LDQL queries

for which a complete execution is feasible in practice

● Compare LDQL with existing proposals– Show that LDQL is strictly more expressive

? ? ?

? ? ??

?

Let's have a brief look!

Page 11: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 11

General Idea of LDQL

Query

( N , Q )

Specification ofquery-relevant

region

Page 12: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 12

General Idea of LDQL

SPARQL 1.1graph pattern

Link Path Expression(Nested regular

expressions overan alphabet of so

called link patterns)

Query

( N , Q )

Specification ofquery-relevant

region

Page 13: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 13

Link Patterns

● Each βi is either:

– a URI, or

– a wildcard denoted by _, or

– a placeholder for the context URI denoted by +

● β3 may also be a literal

● Example:

( β1, β2, β3 )

( +, foaf:knows, _ )

Page 14: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 14

Link Graph

( ua, foaf:knows, ub )( uc, foaf:knows, ua )

doc(ua)

doc(ub)

...

doc(uc)

( +, foaf:knows, _ )

Page 15: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 15

Link Graph

( ua, foaf:knows, ub )( uc, foaf:knows, ua )

doc(ua)

doc(ub)

...

doc(uc)

( +, foaf:knows, _ )

( ua, foaf:knows, ub ), ub ( uc, foaf:knows, ua ), uc( ua, foaf:knows, ub )( uc, foaf:knows, ua )

Page 16: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 16

Link Pattern Matching

( ua, foaf:knows, ub )( uc, foaf:knows, ua )

doc(ua)

doc(ub)

...

doc(uc)

( +, foaf:knows, _ )

( ua, foaf:knows, ub ), ub ( uc, foaf:knows, ua ), uc

A link graph edge labeled with RDF triple (x1, x2, x3) and URI u matches a link pattern (β1, β2, β3) in the context of URI uctx if:

• i ∈ {1,2,3} such that βi = _ and xi = u, and

• i ∈ {1,2,3} (i) βi = xi , (ii) βi = _ , or (iii) βi = + and xi = uctx

Page 17: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 17

Link Pattern Matching

( ua, foaf:knows, ub )( uc, foaf:knows, ua )

doc(ua)

doc(ub)

...

doc(uc)

( +, foaf:knows, _ )

( ua, foaf:knows, ub ), ub ( uc, foaf:knows, ua ), uc

A link graph edge labeled with RDF triple (x1, x2, x3) and URI u matches a link pattern (β1, β2, β3) in the context of URI uctx if:

• i ∈ {1,2,3} such that βi = _ and xi = u, and

• i ∈ {1,2,3} (i) βi = xi , (ii) βi = _ , or (iii) βi = + and xi = uctx

√ X

Page 18: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 18

(Algebraic) Syntax of LDQL

q := (lpe, P) | (lpe an LPE, P a SPARQL pattern)

(q AND q) | (q UNION q) | πV q | (V a set of variables)

(SEED U q) | (U a set of URIs)

(SEED ?v q) (?v a variable)

lpe := ε | lp | lpe/lpe | lpe|lpe | lpe* | [lpe] | (?v, q)

Page 19: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 19

(Algebraic) Syntax of LDQL

q := (lpe, P) | (lpe an LPE, P a SPARQL pattern)

(q AND q) | (q UNION q) | πV q | (V a set of variables)

(SEED U q) | (U a set of URIs)

(SEED ?v q) (?v a variable)

lpe := ε | lp | lpe/lpe | lpe|lpe | lpe* | [lpe] | (?v, q)

Example: Take all Linked Data reached by following twofoaf:knows links starting from URI u, and evaluateSPARQL pattern P over the union of this data.

( (+,foaf:knows, _) /(+,foaf:knows, _) , P ) with seeds S = { u }

Page 20: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 20

(Algebraic) Syntax of LDQL

q := (lpe, P) | (lpe an LPE, P a SPARQL pattern)

(q AND q) | (q UNION q) | πV q | (V a set of variables)

(SEED U q) | (U a set of URIs)

(SEED ?v q) (?v a variable)

lpe := ε | lp | lpe/lpe | lpe|lpe | lpe* | [lpe] | (?v, q)

Example: Take all Linked Data reached by following twofoaf:knows links starting from URI u, and evaluateSPARQL pattern P over the union of this data.

( (+,foaf:knows, _) /(+,foaf:knows, _) , P ) with seeds S = { u }

Page 21: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 21

(Algebraic) Syntax of LDQL

q := (lpe, P) | (lpe an LPE, P a SPARQL pattern)

(q AND q) | (q UNION q) | πV q | (V a set of variables)

(SEED U q) | (U a set of URIs)

(SEED ?v q) (?v a variable)

lpe := ε | lp | lpe/lpe | lpe|lpe | lpe* | [lpe] | (?v, q)

Example: Take all Linked Data reached by following twofoaf:knows links starting from URI u, and evaluateSPARQL pattern P over the union of this data.

( (+,foaf:knows, _) /(+,foaf:knows, _) , P ) with seeds S = { u }

Page 22: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 22

(Algebraic) Syntax of LDQL

q := (lpe, P) | (lpe an LPE, P a SPARQL pattern)

(q AND q) | (q UNION q) | πV q | (V a set of variables)

(SEED U q) | (U a set of URIs)

(SEED ?v q) (?v a variable)

lpe := ε | lp | lpe/lpe | lpe|lpe | lpe* | [lpe] | (?v, q)

For every LDQL query q', there exists a semantically equivalent LDQL query q'' such that every LPE in q'' consists only of ε and lpe* and (?v, q).

Page 23: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 23

(Algebraic) Syntax of LDQL

q := (lpe, P) | (lpe an LPE, P a SPARQL pattern)

(q AND q) | (q UNION q) | πV q | (V a set of variables)

(SEED U q) | (U a set of URIs)

(SEED ?v q) (?v a variable)

Example: ( (lpe1 , P1) AND (SEED ?x q2) )where P1 is: ( (?x,p,?y) FILTER (?y > 3))

lpe := ε | lp | lpe/lpe | lpe|lpe | lpe* | [lpe] | (?v, q)

Page 24: LDQL: A Query Language for the Web of Linked Data

LDQL: A Query Language for the Web of Linked Data – Olaf Hartig and Jorge Peréz – ISWC 2015 24

Summary

● Query language for the Web of Linked Data● Main feature: separation of ...

… navigational components to selectregions of the Web of Linked Data, and

… query patterns to be matched in thedata of the selected regions

● In the paper we study LDQL– Web-safeness property

– LDQL is strictly more expressivethan the major existing proposals