SPARQL Query Graph Model (How to improve query evaluation?) - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

SPARQL Query Graph Model (How to improve query evaluation?)

Description:

Generator UBA (v.1.7) of Lehigh University Benchmarks. http://swat.cse.lehigh.edu/projects/lubm ... s ub:name ?n . Ralf Heese, SPARQL Query Graph Model. 21 ... – PowerPoint PPT presentation

Number of Views:172
Avg rating:3.0/5.0
Slides: 25
Provided by: ralfh5
Category:

less

Transcript and Presenter's Notes

Title: SPARQL Query Graph Model (How to improve query evaluation?)


1
SPARQL Query Graph Model(How to improve query
evaluation?)
  • Ralf Heese and Olaf Hartig
  • Humboldt-Universität zu Berlin

2
A Posting in a Newsgroup
  • Question
  • A series of SPARQL queries of the form WHERE
    ?family lthttp//dadgt ?d . ?d lthttp//namegt
    "Peter" .?family lthttp//momgt ?m . ?m
    lthttp//namegt "Robin" .
  • My queries runs very slowly
  • Simple queries on a database of 10,000 trees
    describing families
  • Answer
  • Put the more specific part of the query first it
    makes a significant difference.
  • Reply
  • My time went from 33000ms?? 150ms.

Date Mar 8, 2006 http//groups.yahoo.com/group/je
na-dev/message/21436
3
One query, many ways to execute
?family lthttp//dadgt ?d .?d lthttp//namegt
"Peter" . ?family lthttp//momgt ?m .?m
lthttp//namegt "Robin" . ?family lthttp//petgt ?p
.?p lthttp//namegt "Toller" .
?family lthttp//momgt ?m .?m lthttp//namegt
"Robin" . ?family lthttp//dadgt ?d .?d
lthttp//namegt "Peter" . ?family lthttp//petgt ?p
.?p lthttp//namegt "Toller" .
?family lthttp//momgt ?m .?m lthttp//namegt
"Robin" . ?family lthttp//petgt ?p .?p
lthttp//namegt "Toller" . ?family lthttp//dadgt
?d .?d lthttp//namegt "Peter" .
4
Outline
  • Query processing in databases
  • SPARQL query graph model (SQGM)
  • Transforming SQGMs
  • Evaluation
  • Conclusion

5
Query Processing in Databases
6
Tasks of the query engine
Query parsing
Query rewriting
Query Processing in Databases SPARQL Query Graph
Model Transforming SQGMs Evaluation Conclusion
Internal representationof the query
QEP generation
QEP execution
QEP Query Execution Plan
7
SPARQL Query Graph Model (SQGM)
8
Advantages
Query Processing in Databases SPARQL Query Graph
Model Transforming SQGMs Evaluation Conclusion
Extensible to new concepts of the query language
Supports all phases of query processing
Adaptable to changes of the query language
Store additional information needed for query
processing
9
Basic Structures
  • Directed graph
  • Operation
  • Head provided variables
  • Body operation details
  • Dataflow
  • connects the input andthe output of two
    operations

Query Processing in Databases SPARQL Query Graph
Model Transforming SQGMs Evaluation Conclusion
10
Constructing an SQGM
SELECT ?n ?cFROM http//example.org/university.rd
fWHERE ?s rdftype ubGraduateStudent .
OPTIONAL ?s ubtakesCourse ?c . ?s ubname
?n .
Query Processing in Databases SPARQL Query Graph
Model Transforming SQGMs Evaluation Conclusion
?n ?c
?s ?c
?s ?n
?s ?c
?s
optional
http//example.org/university.rdf
11
Operation Types and Dataflow Types
  • Variable providing operations
  • Graph providing operations
  • Variable dataflows
  • Graph dataflows

Query Processing in Databases SPARQL Query Graph
Model Transforming SQGMs Evaluation Conclusion
http//example.org/university.rdf
12
Transforming SQGMs
13
Query Rewriting
  • Goals
  • More efficient evaluation of a query
  • Provide more options for the generation of query
    plans, e.g.,
  • Data access strategy
  • Join order
  • Selection of indexes
  • Means
  • Rule-based transformation, i.e., restructuring of
    the query, detection of redundancies and
    contradictions
  • Heuristic set of rules

Query Processing in Databases SPARQL Query Graph
Model Transforming SQGMs Evaluation Conclusion
14
Heuristic Combine Basic Graph Pattern
Basic graph pattern cannot be merged
But these could be merged if they wereoperands
of the same join operation.
Query Processing in Databases SPARQL Query Graph
Model Transforming SQGMs Evaluation Conclusion
Apply transformation rules to the SQGM
?n ?c
?s ?c
?s ?n
?s ?c
?s
optional
http//example.org/university.rdf
15
Next Step
Apply another transformation rule
Query Processing in Databases SPARQL Query Graph
Model Transforming SQGMs Evaluation Conclusion
?n ?c
?s ?n
?s ?c
optional
?s
?s ?n
http//example.org/university.rdf
16
Evaluation
17
Prototype
  • Setup
  • Jena Semantic Web Framework
  • ARQ SPARQL query processor for Jena
  • RDF graphs stored on secondary storage
  • Extended by
  • SPARQL query graph model
  • Rule engine

Query Processing in Databases SPARQL Query Graph
Model Transforming SQGMs Evaluation Conclusion
18
Interaction between ARQ and SQGM extension
ARQ
SQGM extension
SPARQL Query
Query Processing in Databases SPARQL Query Graph
Model Transforming SQGMs Evaluation Conclusion
Construction ofan ARQ query model
Translation intoan SQGM
Rewriting ofthe SQGM
Translation intoan ARQ model
Generation of a Query Execution Plan
Execution of the QEP
Query result
19
Evaluation Setup
  • RDF Data
  • A set of 41 SPARQL queries
  • Different combinations of graph patterns
    including OPTIONAL, FILTER and UNION

Query Processing in Databases SPARQL Query Graph
Model Transforming SQGMs Evaluation Conclusion
UnivBench (1.0) UnivBench (5.0) UnivBench (10.0)
Triples 100,543 624,532 1,272,575
Resources 20,659 129,533 263,427
Generator UBA (v.1.7) of Lehigh University
Benchmarks http//swat.cse.lehigh.edu/projects/lub
m/
20
Evaluation Results
  • Measured query execution time of a selected query
  • Factor?? 2.4
  • Time needed for transformation between modelslt 1
    ms
  • Average time savings of approx. 87
  • Only one case with slightly higher execution time

Query Processing in Databases SPARQL Query Graph
Model Transforming SQGMs Evaluation Conclusion
5.8
2.5
39.4
16.4
32.3
77.9
SELECT ?n ?cFROM http//example.org/university.rd
fWHERE ?s rdftype ubGraduateStudent .
OPTIONAL ?s ubtakesCourse ?c . ?s ubname
?n .
21
Explanation for the Result
  • Fast path algorithm of Jena
  • Perform pattern matching within the underlying
    relational database
  • Match multiple filtered basic graph patterns

WHERE ?s rdftype ubGraduateStudent .
OPTIONAL ?s ubtakesCourse ?c . ?s ubname
?n .
Fast path not applicable
WHERE ?s rdftype ubGraduateStudent . ?s
ubname ?n . OPTIONAL ?s ubtakesCourse ?c
.
Fast path applicable
22
Conclusion
23
Conclusion and Future Work
  • SQGM a query model for SPARQL
  • Supporting all phases of query processing
  • Easy to extend
  • Transformation rules and heuristics for SQGMs
  • Implementation illustrated the potential of SQGMs
  • Outlook
  • Develop further heuristics to rewrite SPARQL
    queries
  • Integrate index selection into the query
    optimization

Query Processing in Databases SPARQL Query Graph
Model Transforming SQGMs Evaluation Conclusion
24
Thank you!
Write a Comment
User Comments (0)
About PowerShow.com