SPARQL and SQL: technical aspects and synergy


Published on

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

SPARQL and SQL: technical aspects and synergy

  1. 1. SPARQL and SQL technical aspects and synergy <ul><li>Relational model </li></ul><ul><ul><li>flat model, tabular form, typing is implicit (by convention, column definition) </li></ul></ul><ul><ul><li>JOIN functions used to combine information from tables </li></ul></ul><ul><ul><li>use of foreign keys to add semantics and graph-like structures </li></ul></ul><ul><ul><li>each table has many columns = many attributes of objects </li></ul></ul><ul><li>RDF model </li></ul><ul><ul><li>may be viewed as flat </li></ul></ul><ul><ul><ul><li>but because it is a graph can also be traversed hierarchically or arbitrarily </li></ul></ul></ul><ul><ul><li>explicit typing is common (by namespace definition) </li></ul></ul><ul><ul><li>URIs instead of closed database table names </li></ul></ul><ul><ul><li>explicit relationships via predicates (triple format: subj, pred, obj) </li></ul></ul><ul><ul><li>relationships and references are the key point </li></ul></ul><ul><li>SPARQL </li></ul><ul><ul><li>designed to query collections of triples and to easily traverse relationships </li></ul></ul><ul><ul><li>syntax vaguely resembles SQL (SELECT, WHERE, etc) </li></ul></ul><ul><ul><li>it matches graph patterns </li></ul></ul><ul><li>SPARQL and SQL </li></ul><ul><ul><li>SPARQL can be translated to SQL </li></ul></ul>
  2. 2. SPARQL “under the hood” <ul><li>Works with popular web and web services protocols: HTTP and SOAP </li></ul><ul><li>XML results format (easy to transform, XSLT, XQuery) </li></ul><ul><li>A SPARQL query consists of three parts: </li></ul><ul><ul><li>Pattern matching (OPTIONAL, UNION, FILTER) </li></ul></ul><ul><ul><li>Solution modifiers (PROJECTION, DISTINCT, OFFSET, LIMIT) </li></ul></ul><ul><ul><li>Output part CONSTRUCT of new triples </li></ul></ul><ul><li>BGP (Basic Graph Pattern) built-in mechanism </li></ul><ul><li>Can work in conjunction with RDFS ’s taxonomic reasoning (respects RDFS type checking and subsumption thus providing inference) </li></ul><ul><ul><li>Inference system in RDFS (and through SPARQL) supports existential, sub-property, sub-class, and typing (implicit and explicit) inferences </li></ul></ul>
  3. 3. SPARQL applications, engines, endpoints <ul><li>RDF engines (SPARQL to interrogate them) </li></ul><ul><ul><li>Oracle (will support SPARQL syntax), Allegrograph, OpenLink Virtuoso, ARQ/Joseki (HP), Boca (IBM), Rasqal for Redland, SWI-Prolog, Sesame, D2R Server </li></ul></ul><ul><li>Notable SPARQL users & applications (R&D and commercial) </li></ul><ul><ul><li>Garlik: SPARQL to built reports on people’s online credit reports, 500-2000 SPARQL queries to build a report, 1-2 seconds processing time, 8 big knowledge bases (>2bn triples), XML format) </li></ul></ul><ul><ul><li>JSpace: an extension to mSpace, UI driven SPARQL firing, digital music domain </li></ul></ul><ul><ul><li>POPS: expertise location service for NASA, federates 4 diverse data sources, 4.5M triples, pilot study for the Office of the Chief Engineer </li></ul></ul><ul><ul><li>BIANCA: network asset management service, integrated view of applications, servers, networks and changes and their relations, deployed at NASA </li></ul></ul><ul><ul><li>HCLS (Health Care and Life Sciences) interest group at W3C, 60 organisations members, Google maps based interface for Allen Brain Atlas, 20k genes, 400k images. </li></ul></ul><ul><li>Further resources and point of info: </li></ul><ul><li> </li></ul>
  4. 4. SPARQL and the Semantic Web - technical <ul><li>Relation of SPARQL to rules for the Semantic Web </li></ul><ul><ul><li>Rules: several proposals for rule systems usable on top of RDF/RDF (SWRL, N3, TRIPLE, SWI-Prolog, WSML, etc) </li></ul></ul><ul><ul><li>Only a handful through W3C standardisation (SWRL) and already working on RIF (for interchanging rules) </li></ul></ul><ul><ul><li>SPARQL is a query language (primarily) but can be used as a rule language (translation work underway for SPARQL to LP (Datalog) ) </li></ul></ul><ul><ul><ul><li>Example the RDFS entailment rule that can be expressed with SPARQL CONSTRUCT clause </li></ul></ul></ul><ul><li>RIF charter states that it will be compatible with SPARQL </li></ul>
  5. 5. SPARQL and SQL technical aspects and synergy <ul><li>SQL </li></ul><ul><ul><li>Great for finding data from tabular representations, can get complex when many tables are involved in a given query </li></ul></ul><ul><li>SPARQL </li></ul><ul><ul><li>Good pattern matching paradigm, especially when relationships have to be used to answer a query </li></ul></ul><ul><li>Also add here: work on BGP for translating SPARQL to SQL (technical paper) </li></ul><ul><li>Federated SPARQL endpoints and SPARQL validators, query resolvers, SPARQL APIs </li></ul><ul><li>Use of SPARQL CONSTRUCTS as opposed to rules and inference engines </li></ul><ul><li>Argument for SPARQL overarching SQL schemata: reduces computational workload with having to describe complex JOIN SQL queries; common namespaces and a match to underlying SQL schemata is the only workload </li></ul><ul><li>Syndication and verticals to agree on common namespaces? Abstract layer from which to access merchant specific DBs </li></ul><ul><li>Check sylvia’s slides from WSRI seminar – scalability of SPARQL and use cases – lack of SUM function, etc. – check also my slides </li></ul><ul><li>Some examples of SPARQL at work? From the recent NaTii experiment and from e-response - show them data provenance and typing examples (use of namespaces) </li></ul>