An Effective SPARQL Support over Relational Database Jing Lu, Feng Cao, Li Ma, Yong Yu, Yue Pan SWDB-ODBIS 2007 SNU IDB Lab. Hyewon Lim July 30 th, 2009.

Slides:



Advertisements
Similar presentations
Querying on the Web: XQuery, RDQL, SparQL Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology.
Advertisements

Lukas Blunschi Claudio Jossen Donald Kossmann Magdalini Mori Kurt Stockinger.
Semantics Static semantics Dynamic semantics attribute grammars
1 Chapter 4:Constraint Logic Programs Where we learn about the only programming concept rules, and how programs execute.
Intermediate Code Generation
ESDSWG2011 – Semantic Web session Semantic Web Sub-group Session ESDSWG 2011 Meeting – Semantic Web sub-group session Wednesday, November 2, 2011 Norfolk,
Getting started with ML ML is a functional programming language. ML is statically typed: The types of literals, values, expressions and functions in a.
 Copyright 2004 Digital Enterprise Research Institute. All rights reserved. SPARQL Query Language for RDF presented by Cristina Feier.
SPARQL RDF Query.
Types and Arithmetic Operators
SPARQL for Querying PML Data Jitin Arora. Overview SPARQL: Query Language for RDF Graphs W3C Recommendation since 15 January 2008 Outline: Basic Concepts.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 52 Database Systems I Relational Algebra.
Instructor: Craig Duckett CASE, ORDER BY, GROUP BY, HAVING, Subqueries
NaLIX: A Generic Natural Language Search Environment for XML Data Presented by: Erik Mathisen 02/12/2008.
Semantic Web Query Processing with Relational Databases Artem Chebotko Department of Computer Science Wayne State University.
XML –Query Languages, Extracting from Relational Databases ADVANCED DATABASES Khawaja Mohiuddin Assistant Professor Department of Computer Sciences Bahria.
WRITING BASIC SQL SELECT STATEMENTS Lecture 7 1. Outlines  SQL SELECT statement  Capabilities of SELECT statements  Basic SELECT statement  Selecting.
Logics for Data and Knowledge Representation SPARQL Protocol and RDF Query Language (SPARQL) Feroz Farazi.
Chapter 5 Introduction to SQL. Structured Query Language = the “programming language” for relational databases SQL is a nonprocedural language = the user.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor Ms. Arwa.
Introduction to SPARQL. Acknowledgements This presentation is based on the W3C Candidate Recommendation “SPARQL Query Language for RDF” from
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation An Introduction to XQuery.
Banner and the SQL Select Statement: Part Four (Multiple Connected Select Statements) Mark Holliday Department of Mathematics and Computer Science Western.
SPARQL Semantic Web - Spring 2008 Computer Engineering Department Sharif University of Technology.
Chapter 3 Querying RDF stores with SPARQL. Why an RDF Query Language? Why not use an XML query language? XML at a lower level of abstraction than RDF.
The main mathematical concepts that are used in this research are presented in this section. Definition 1: XML tree is composed of many subtrees of different.
Querying Structured Text in an XML Database By Xuemei Luo.
Lesley Charles November 23, 2009.
SPARQL All slides are adapted from the W3C Recommendation SPARQL Query Language for RDF Web link:
Copyright Curt Hill SQL Queries Yet Another Set of Query Features.
Optimization in XSLT and XQuery Michael Kay. 2 Challenges XSLT/XQuery are high-level declarative languages: performance depends on good optimization Performance.
Flow of Control Part 1: Selection
SPARQL Query Graph Model (How to improve query evaluation?) Ralf Heese and Olaf Hartig Humboldt-Universität zu Berlin.
Q2Semantic: A Lightweight Keyword Interface to Semantic Search Haofen Wang 1, Kang Zhang 1, Qiaoling Liu 1, Thanh Tran 2, and Yong Yu 1 1 Apex Lab, Shanghai.
Efficient RDF Storage and Retrieval in Jena2 Written by: Kevin Wilkinson, Craig Sayers, Harumi Kuno, Dave Reynolds Presented by: Umer Fareed 파리드.
Introducing Python CS 4320, SPRING Lexical Structure Two aspects of Python syntax may be challenging to Java programmers Indenting ◦Indenting is.
Practical RDF Chapter 10. Querying RDF: RDF as Data Shelley Powers, O’Reilly SNU IDB Lab. Hyewon Lim.
Practical RDF Ch.10 Querying RDF: RDF as Data Taewhi Lee SNU OOPSLA Lab. Shelley Powers, O’Reilly August 27, 2004.
MT311 Java Application Development and Programming Languages Li Tak Sing ( 李德成 )
XML Query: xQuery Reference: Xquery By Priscilla Walmsley, Published by O’Reilly.
CS 405G: Introduction to Database Systems Instructor: Jinze Liu Fall 2009.
05/01/2016 SPARQL SPARQL Protocol and RDF Query Language S. Garlatti.
Of 38 lecture 6: rdf – axiomatic semantics and query.
CC L A W EB DE D ATOS P RIMAVERA 2015 Lecture 7: SPARQL (1.0) Aidan Hogan
Restrictions Objectives of the Lecture : To consider the algebraic Restrict operator; To consider the Restrict operator and its comparators in SQL.
CSE 6331 © Leonidas Fegaras XQuery 1 XQuery Leonidas Fegaras.
LM 5 Introduction to SQL MISM 4135 Instructor: Dr. Lei Li.
Chapter 04 Semantic Web Application Architecture 23 November 2015 A Team 오혜성, 조형헌, 권윤, 신동준, 이인용.
 CONACT UC:  Magnific training   
Select Complex Queries Database Management Fundamentals LESSON 3.1b.
Concepts of Database Management, Fifth Edition Chapter 3: The Relational Model 2: SQL.
1 Sections 3.1 – 3.2a Basic Syntax and Semantics Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
More SQL: Complex Queries,
Chapter 5 Introduction to SQL.
CC La Web de Datos Primavera 2017 Lecture 7: SPARQL [i]
MySQL Subquery Source: Dev.MySql.com
Instructor: Craig Duckett Lecture 09: Tuesday, April 25th, 2017
SPARQL SPARQL Protocol and RDF Query Language
Supporting Arbitrary Custom Datatypes in RDF and SPARQL
Writing Basic SQL SELECT Statements
CS 405G: Introduction to Database Systems
Logics for Data and Knowledge Representation
CC La Web de Datos Primavera 2016 Lecture 7: SPARQL (1.0)
Chapter # 7 Introduction to Structured Query Language (SQL) Part II.
More SQL: Complex Queries, Triggers, Views, and Schema Modification
G-CORE: A Core for Future Graph Query Languages
Writing Basic SQL SELECT Statements
Contents Preface I Introduction Lesson Objectives I-2
AST Based Sequence to Sequence Natural Language Question to SQL Method
CPSC-608 Database Systems
Presentation transcript:

An Effective SPARQL Support over Relational Database Jing Lu, Feng Cao, Li Ma, Yong Yu, Yue Pan SWDB-ODBIS 2007 SNU IDB Lab. Hyewon Lim July 30 th, 2009

Contents  Introduction  Problem Statement  SPARQL to SQL Translation  Optimization  An Example of Translation  Experimental Analysis  Conclusion 2

Introduction (1)  SPARQL query consists of  Pattern – matched against given data source D  Values – obtained from the matching  SPARQL filter expression  Restricts the graph pattern matching solutions  Functionalities  Ability to restrict the value of literal and arithmetic expression  Ability to preprocess the RDF data by built-in functions 3

Introduction (2)  Previous methods on supporting SPARQL over relational databases  mainly supported basic SPARQL query patterns  Filter expressions  Ignored due to complexity, or  Adopted memory-based method for evaluation  Ex. Sesame or Jena2  Translated into a SQL without filter expressions  Then, the results are further filtered in Java program 4

Introduction (3)  Filter expression translation is difficult  Filter expressions often consist of multiple functions and operators  Operator may have different operands  When operands are variables or complex expressions  Hard to determine their actual type  Variables may be bound to different kinds of literals  The type of RDF resources needs to be dynamically determined in the translation 5

Introduction – SPARQL Pattern Tree  The graph pattern part can be expressed as a SPARQL pattern tree  Used in the translation  Four possible types of nodes 6

Problem Statement (1)  A SPARQL filter can not be translated into a SQL expression straightforwardly  Result of filter expression is an RDF object  literal, IRI reference, or an error  Result of a SQL expression is a primitive value  Usually only a primitive part of an RDF object is used in a function or operator  Define “facets” of RDF objects 7

Problem Statement (2)  Facet of an RDF object 8 FacetexplanationPrimitive datatype Available for IRI FacetFull IRI string of an IRI reference stringExcept literals Lexical FacetLexical form of a literalstringLiterals Language FacetLanguage tag of a literalstringLiterals Datatype FacetFull IRI of the datatype of a typed literal stringLiterals Numeric FacetNumeric value of a numeric literal doubleTyped literals with xsd:float, xsd:double, xsd:decimal Boolean FacetBoolean value of a boolean literal Translated into SQL predicates Typed literals with xsd:boolean Date time FacetDate time value of a date time literal 64-bit integer Typed literal with xsd:dateTime ID facetInternal ID of the RDF objectintegerVariables

SPARQL to SQL Translation  Facet-based approach (FSparql2Sql)  Translation of pattern nodes  Translation of filter expressions 9

SPARQL to SQL Translation - Translation of pattern nodes (1)  TRIPLE node  Translated into a simple SELECT query  If there are constants, WHERE clause is added  Otherwise, columns are renamed to the corresponding variable names  One variable appears multiple times, equivalent constraint should be added to the WHERE clause 10

SPARQL to SQL Translation - Translation of pattern nodes (2)  AND node  Translated into a query on consequent joins of the sub-queries from its child pattern nodes  If a child node is optional, a left join is used  If there are child FILTER nodes,  Translated into SQL expressions  Added to the WHERE clause  OR node  Translated into a UNION of the sub-queries 11

SPARQL to SQL Translation - Translation of Filter Expressions (1)  A Filter expression can be parsed into a filter expression tree 12

SPARQL to SQL Translation - Translation of Filter Expressions (2)  Literal Constants and IRI Constants  Translation is rather straightforward  Translation results for all kinds of supported facets are just SQL constants  Variables  If the SQL for a specific facet of a variable is requested, the corresponding table is added to the SQL query  Comparison Operators (, =, <=, …)  Most complex because of non-equality operators  Can not be used between all kinds of RDF terms  Different comparison methods should be used for different types of operands 13

SPARQL to SQL Translation - Translation of Filter Expressions (3)  CASE Expression  Types of operands need to be bound dynamically  Use SQL CASE expression (CASE…WHEN) in the translation 14

SPARQL to SQL Translation - Translation of Filter Expressions (4)  Built-in Functions  Always return an IRI or a literal with a fixed type as the result  bound, isIRI, regex: boolean typed literal  Lang, str: plain literal with no language tag  Datatype: IRI reference  Calculation Operators (+, -, *, /)  Used between numeric literals  Always gives a numeric literal  When the lexical facet is required  Use a SQL function to convert the numeric result into a string 15

SPARQL to SQL Translation - Translation of Filter Expressions (5)  Logical Operators (&&, ||, !)  Used between boolean literals  Always returns a boolean literal  Language, datatype facet: give constant  If the lexical facet is required  Use an additional CASE expression to change the result into a string 16

Optimization  Facet-based translation may generate very complex result SQL statement  Requirements  One side is a constant while other side is a CASE expression with exactly two WHEN clauses  Two WHEN clauses are exactly the negation of each other  One of the results matches the constant on the other side of the “=“ while the other does not 17 translation optimization

An Example of Translation (1)  Translation for filter expressions 18  Goal  Generate SQLs for the Boolean facet of the root node E1

An Example of Translation (2)  Optimization for the generated SQL 19 remove

Experimental Analysis (1)  University Ontology Benchmark (UOBM)  Effectiveness analysis 20 Q0: w/o filter Q1: w/ filter Q2: w/ nested filter More complex query Q3: w/o filter Q4: w/ filter Q5: w/ nested filter

Experimental Analysis (2)  Scalability test 21

Conclusion  Contributions  Propose an effective method to translate a complete SPARQL query into a single SQL  Idea of facet-based scheme to translate filter expressions into SQL statements  Propose optimization strategy  Future work  Support more SPARQL features, such as XQuery functions 22