From SQL to SPARQL Symposium zur Pensionierung Prof. Wolfgang Panny Axel Polleres web:

Slides:



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

CH-4 Ontologies, Querying and Data Integration. Introduction to RDF(S) RDF stands for Resource Description Framework. RDF is a standard for describing.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
GridVine: Building Internet-Scale Semantic Overlay Networks By Lan Tian.
27 January Semantically Coordinated E-Market Semantic Web Term Project Prepared by Melike Şah 27 January 2005.
ESDSWG2011 – Semantic Web session Semantic Web Sub-group Session ESDSWG 2011 Meeting – Semantic Web sub-group session Wednesday, November 2, 2011 Norfolk,
Semantic Web Introduction
 Copyright 2010 Digital Enterprise Research Institute. All rights reserved. Digital Enterprise Research Institute Transforming between RDF.
Chapter 3 Querying RDF stores with SPARQL. TL;DR We will want to query large RDF datasets, e.g. LOD SPARQL is the SQL of RDF SPARQL is a language to query.
CSCI 572 Project Presentation Mohsen Taheriyan Semantic Search on FOAF profiles.
Ontologies and the Semantic Web by Ian Horrocks presented by Thomas Packer 1.
Actual Trends Semantic Web Lecture WS 2010/2011. What‘s next? W3C view: Look at Semantic Web activity:
ModelicaXML A Modelica XML representation with Applications Adrian Pop, Peter Fritzson Programming Environments Laboratory Linköping University.
COMP 6703 eScience Project Semantic Web for Museums Student : Lei Junran Client/Technical Supervisor : Tom Worthington Academic Supervisor : Peter Strazdins.
1 Lecture 13: Database Heterogeneity Debriefing Project Phase 2.
Storing and Querying Ordered XML Using a Relational Database System By Khang Nguyen Based on the paper of Igor Tatarinov and Statis Viglas.
RDF: Building Block for the Semantic Web Jim Ellenberger UCCS CS5260 Spring 2011.
Dr. Jim Bowring Computer Science Department College of Charleston CSIS 690 (633) May Evening 2009 Semantic Web Principles and Practice Class 4: 20 May.
Semantic Web Query Processing with Relational Databases Artem Chebotko Department of Computer Science Wayne State University.
Samad Paydar Web Technology Laboratory Computer Engineering Department Ferdowsi University of Mashhad 1389/11/20 An Introduction to the Semantic Web.
1 DCS861A-2007 Emerging IT II Rinaldo Di Giorgio Andres Nieto Chris Nwosisi Richard Washington March 17, 2007.
Semantic Web Andrejs Lesovskis. Publishing on the Web Making information available without knowing the eventual use; reuse, collaboration; reproduction.
DartGrid Browser-based mapping tool of SQL to RDF Point Template Zhejiang University & OpenLink Software.
Semantic Web Bootcamp Dominic DiFranzo PhD Student/Research Assistant Rensselaer Polytechnic Institute Tetherless World Constellation.
Triple Stores.
Logics for Data and Knowledge Representation SPARQL Protocol and RDF Query Language (SPARQL) Feroz Farazi.
© 2006 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice Publishing data on the Web (with.
Managing & Integrating Enterprise Data with Semantic Technologies Susie Stephens Principal Product Manager, Oracle
Rajashree Deka Tetherless World Constellation Rensselaer Polytechnic Institute.
SPARQL All slides are adapted from the W3C Recommendation SPARQL Query Language for RDF Web link:
RDA and Linking Library Data VuStuff III Conference Villanova University, Villanova, PA October 18, 2012 Dr. Sharon Yang Rider University.
OFC304 Excel 2003 Overview: XML Support Joseph Chirilov Program Manager.
The Relational Model. Review Why use a DBMS? OS provides RAM and disk.
Michalis Vafopoulos NTUA, GFOSS & The transformers GREEN CITY HACKATHON.
Introduction to SPARQL. Acknowledgements This presentation is based on the W3C Candidate Recommendation “SPARQL Query Language for RDF” from
1 SAMT’08 Semantic-driven multimedia retrieval with the MPEG Query Format Ruben Tous and Jaime Delgado Distributed Multimedia Applications Group (DMAG)
The Semantic Web Web Science Systems Development Spring 2015.
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.
Open Data Protocol * Han Wang 11/30/2012 *
Master Informatique 1 Semantic Technologies Part 11Direct Mapping Werner Nutt.
SPARQL W3C Simple Protocol And RDF Query Language
SPARQL AN RDF Query Language. SPARQL SPARQL is a recursive acronym for SPARQL Protocol And Rdf Query Language SPARQL is the SQL for RDF Example: PREFIX.
Pavan Reddiavri (Ebiquity Labs) “R ♫ P” RDF Access control Policies.
Metadata. Generally speaking, metadata are data and information that describe and model data and information For example, a database schema is the metadata.
Master Informatique 1 Semantic Technologies Part 7SPARQL 1.1 Werner Nutt.
 Copyright 2009 Digital Enterprise Research Institute. All rights reserved. Digital Enterprise Research Institute Reasoning and Querying for.
Efficient RDF Storage and Retrieval in Jena2 Written by: Kevin Wilkinson, Craig Sayers, Harumi Kuno, Dave Reynolds Presented by: Umer Fareed 파리드.
1 SPARQL A. Emrah Sanön. 2 RDF RDF is quite committed to Semantic Web. Data model Serialization by means of XML Formal semantics Still something is missing!
Practical RDF Chapter 10. Querying RDF: RDF as Data Shelley Powers, O’Reilly SNU IDB Lab. Hyewon Lim.
Introduction to the Semantic Web and Linked Data Module 1 - Unit 2 The Semantic Web and Linked Data Concepts 1-1 Library of Congress BIBFRAME Pilot Training.
05/01/2016 SPARQL SPARQL Protocol and RDF Query Language S. Garlatti.
Chapter 3 Querying RDF stores with SPARQL
Sesame: An Architecture for Storing and Querying RDF Data and Schema Inf. Yasser Ganji Saffar When they were out of sight Ali Baba.
RDF and Relational Databases
Of 38 lecture 6: rdf – axiomatic semantics and query.
SPARQL1.1 Updates and Entailment - Why the specification is silent about their interaction Axel Polleres web:
© The ATHENA Consortium. Susan Thomas SAP AG, Research Department How do you do semantics? Semantic Web Drawings by Sebastian Cremers Unit 3:
© 2009 OpenLink Software, All rights reserved. Mapping Relational Databases to RDF with OpenLink Virtuoso Orri Erling - Program Manager, Virtuoso.
Semantic Web for the Working Ontologist Dean Allemang Jim Hendler SNU IDB laboratory.
Chapter 04 Semantic Web Application Architecture 23 November 2015 A Team 오혜성, 조형헌, 권윤, 신동준, 이인용.
1 CS122A: Introduction to Data Management Lecture #4 (E-R  Relational Translation) Instructor: Chen Li.
SPARQL Query Andy Seaborne. Apache Jena he.org/jena ● Open source - Apache License ● Apache Incubator (accepted November 2010) ●
1 RDF Storage and Retrieval Systems Jan Pettersen Nytun, UiA.
Components.
CC La Web de Datos Primavera 2017 Lecture 8: SPARQL [ii]
Introduction to SPARQL
Lifting Data Portals to the Web of Data
Triple Stores.
CC La Web de Datos Primavera 2018 Lecture 8: SPARQL [1.1]
Semantic-Web, Triple-Strores, and SPARQL
Presentation transcript:

From SQL to SPARQL Symposium zur Pensionierung Prof. Wolfgang Panny Axel Polleres web:

Hintergrund  ~40 Jahre Forschung im Bereich Artif. Intelligence und Abfragesprachen an der WU  Operations Research, Algorithmen, Datenbanken  Logische Inferenz & Expertensysteme  SQL & Relationale Datenbanken in Theorie und Praxis  Aktive Mitarbeit in der Standardisierung von Abfragesprachen (ISO SQL)

Hintergrund  +10 Jahre Forschung im Bereich Semantic Web und Abfragesprachen, seit 2013 an der WU  Logische Programmierung, Deduktive Datenbanken  Logische Inferenz in Ontologien  SPARQL und Erweiterungen (SPARQL++, XSPARQL,...)  Aktive Mitarbeit in der Standardisierung von Abfragesprachen (W3C SPARQL)

Outline: From SQL to SPARQL  Linked Data: A universal Data Format for the Web  From Relational Data to Graph Data on the Web  Querying Linked Data with SQL and SPARQL  A few hints on the relation between those two languages  SPARQL‘s distinct Features and challenges

The “Semantic Web” promise… “If HTML and the Web made all the online documents look like one huge book, RDF, schema and inference languages will make all the data in the world look like one huge database” Tim Berners-Lee, 1999 Try the following in google:  “Persons who have published books related to this book and also have edited W3C specifications”

The data is all available on the Web… 6 Jim Melton, Oracle

Globally Unique identifiers Links between Documents (href) A common protocol RDF URIs HTTP Globally Unique identifiers Typed Links (=relations) between Entities A common protocol From the HTML Web… … towards a Web of (Linked) Data polleres.net#me xmlns.com/foaf/0.1/made w3.org/TR/sparql11-update  a universal graph-based data format… (note that e.g. any relational data can be decomposed into such triples) href Person Article Axel Polleres edited SPARQL1.1 Update spec.

8 Linked Data on the Web: Adoption March 2008 March 2009 July 2009 Sep Sep Image from: 8

9 polleres.net#me made RDF Store RDF + Linked Data Principles allow standard access information on the Web SubjectPredicateObject _:b1foaf:madew3.org/TR/xpath- functions/ _:b1foaf:name“Jim Melton” google.books/Ji m Melton foaf:name“Jim Melton google.books/Ji m Melton foaf:madegoogle.books/SQL google.books/ SQ L-99 rdfs:seeAlso google.books/ SQL made title type name Axel Polleres Jim Melton SPARQL 1.1 Update W3.org/REC name w3.org/TR/xpath-functions/ made type google.books/ SQL-1999 made name title XQuery 1.0 and XPath 2.0 Functions and Operators w3.org/TR/sparql11-update

10 SPARQ L provides a standard query language google.books/SQL-99 seeAlso ?Book1 made ?P ?Doc2 made type w3c:REC PREFIX g:... SELECT ?P ?T WHERE {g:SQL-99 rdfs:seeAlso ?Book1. ?P foaf:made ?Book1. ?P foaf:made ?Doc2. ?Doc2 rdf:type w3c:REC ; cd:title ?T. } SPARQL = SQL look-and–feel for Linked Data Query: 10 RDF Store SubjectPredicateObject W3c:editor1foaf:madew3.org/TR/xpath- functions/ W3c:editor1foaf:name“Jim Melton” google.books/Ji m Melton foaf:name“Jim Melton google.books/Ji m Melton foaf:madegoogle.books/SQL google.books/ SQ L-99 rdfs:seeAlso google.books/ SQL ?T title

11 Could be done in SQL, couldn’t it? PREFIX g:... SELECT T2.Subject T5.Object FROM triples T1, triples T2, triples T3, triples T4, triples T5 WHERE { T1.Subject = g:SQL-99 AND T1.Predicate = rdfs:seeAlso AND T1.Object = T2.Object AND T2.Subject = T3.Subject AND T2.Predicate = foaf:made … 11 triples SubjectPredicateObject W3c:editor1foaf:madew3.org/TR/xpath- functions/ W3c:editor1foaf:name“Jim Melton” google.books/Ji m Melton foaf:name“Jim Melton google.books/Ji m Melton foaf:madegoogle.books/SQL google.books/ SQ L-99 rdfs:seeAlso google.books/ SQL Yes, [Angles&Gutierrez, 2008] show that SPARQL1.0 has the same expressivity as non- recursive Datalog with Negation, i.e. Relational Algebra, i.e. within SQL-99) But: … syntax gets quite blown up … lots of self-joins… encodings into SQL usually use different schemata e.g. property tables. Specialized triple stores perform better than encodings on top of SQL DBs in practice Plus: peculiarities that make this encoding non-trivial e.g. the semantics of outer-joins in SPARQL (OPTIONAL) cf. SPARQL1.1 Tutorial at

SPARQL1.1  Adds some interesting new features that differ from SQL!  SPARQL1.1 Query: Property Paths, Aggregates, Subqueries,...  SPARQL1.1 Federation  SPARQL1.1 Update  SPARQL1.1 Entailment Regimes  Still leaves some challenges open

SPARQL1.1 Query: Property Paths, Aggregates, Subqueries,...  New features in the query language make SPARQL a „real“ graph query language, property paths (aka regular path queries): „List all previous versions of the SPARQL Query Language specification“ PREFIX g:... SELECT ?X ?T WHERE { ?Rec rdf:type w3c:REC; dc:title “ SPARQL 1.1 Query Language ” w3c:prevVersion* ?X. } sparql11 prevVersion PR-sparql11 prevVersion CR-sparql11 prevVersion WD-sparql11 w3c:REC SPARQL 1.1 Query Language title type sparql11PR-sparql11CR-sparql11WD-sparql11

SPARQL1.1 Query: Property Paths, Aggregates, Subqueries,...  New features in the query language make SPARQL a „real“ graph query language, property paths (aka regular path queries):  „E.g. List all previous versions of the SPARQL Query Language specification“ PREFIX g:... SELECT ?X ?T WHERE { ?Rec rdf:type w3c:REC; dc:title “ SPARQL 1.1 Query Language ” w3c:prevVersion* ?X. } sparql11 prevVersion V1 prevVersion V2 V4 prevVersion V3 RDF specific issues in terms of the „right“ semantics: Count multiple paths or not? RDF specific issues in terms of the „right“ semantics: Count multiple paths or not? How to deal with cycles? This problem does not occur in relational or tree-based models! Academia provided useful input here: [Arenas+,2012], [Losemann&Mrtens,2012]

Local RDF Store Remote SPARQL endpoint: dbpedia.org SPARQL Protocol SPARQL1.1 Federation  Remote subqueries to delegate parts of a query to another SPARQL server:  „Famous people on wikipedia who have the same birthdays as my friends“ PREFIX g: SELECT ?P FROM WHERE { polleres.net#me :knows ?X. ?X :birthday ?D SERVICE { ?P :birthday ?D } } Problem in practice: result limits in public endpoints (incomplete results)  Needs control flow to „incect“ bindings into remote calls. Problem in practice: result limits in public endpoints (incomplete results)  Needs control flow to „incect“ bindings into remote calls. A solution to this problem: combining XQuery and SPARQL - XSPARQL [JODS,2013],

SPARQL1.1 Federation  Remote subqueries to delegate parts of a query to another SPARQL server:  „Famous people on wikipedia who have the same birthdays as my friends“ PREFIX g: for ?D from where{ polleres.net#me :knows ?X. ?X :birthday ?D } return { for ?P from endpoint where { ?P :birthday ?D } return ?P } A solution to this problem: combining XQuery and SPARQL - XSPARQL [JODS,2013],

SPARQL1.1 Update  Note the difference to SQL would not work for RDF, because in RDF several titles are possible:  Updates even more tricky when combined with implied triples by Ontologies (RDF Schema, OWL), cf. [OrdRing,2013] INSERT { dc:title “ SPARQL 1.1 Abfragesprache ” } DELETE { dc:title “ SPARQL 1.1 Query Language ” } „Change the title of the SPARQL1.1 specification“. UPDATE specs SET title = “ SPARQL 1.1 Abfragesprache ” WHERE id = sparql11 sparql11 SPARQL 1.1 Query Language title SPARQL 1.1 Abfragesprache title  SPARQL1.1 adds a Data Manipulation Language:

Take-home message:  SPARQL is not too far form SQL even SPARQL1.1 is translatable to SQL (or variants of Datalog, cf. [JANCL,2013]) although not straightforwardly, many special purpuoe implementations ... but adds some distinct features important for querying Web- &Graph-data ... plus syntax more „friendly“ to these use cases ... imposes different challenges than in normal relational setting in terms of optimizations for implementers  The availability of a standard query language will be a key enabler to the further success of Linked Data!

References [Losemann&Martens,2012] Katja Losemann, Wim Martens: The complexity of evaluating path expressions in SPARQL. PODS 2012: [Arenas+,2012] Marcelo Arenas, Sebastián Conca, Jorge Pérez: Counting beyond a Yottabyte, or how SPARQL 1.1 property paths will prevent adoption of the standard. WWW 2012: Own publications: [JODS,2013] Stefan Bischof, Stefan Decker, Thomas Krennwallner, Nuno Lopes, and Axel Polleres. Mapping between RDF and XML with XSPARQL. Journal on Data Semantics, 1(3): , [JANCL,2013] Axel Polleres and Johannes Wallner. On the relation between sparql1.1 and answer set programming. Journal of Applied Non-Classical Logics (JANCL), 23(1-2): , 2013 [OrdRing,2013] Albin Ahmeti, Axel Polleres. SPARQL update under RDFS entailment in fully materialized and redundancy-free triple stores. 2nd Int‘l Workshop on Ordering and Reasoning (OrdRing 2013), October 2013.