Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

What;s Coming In SPARQL2?


Published on

A brief introduction to SPARQL and the current status of SPARQL 2, as presented to the NYC Semantic Web group on October 1, 2009.

Published in: Technology, Business
  • Be the first to comment

What;s Coming In SPARQL2?

  1. 1. What’s coming with SPARQL 2?<br />Slides available online at:<br /><br />Comments & questions to:<br />Lee Feigenbaum &lt;;<br />VP Technology & Standards, Cambridge Semantics<br />Co-chair, W3C SPARQL Working Group<br />
  2. 2. For More Details<br />SPARQL By Example<br /><br />SPARQL Cheat Sheet<br /><br />SPARQL2 Status<br /><br />
  3. 3. Why SPARQL?<br />SPARQL is the query language of the Semantic Web. SPARQL lets us:<br />Pull values from structured and semi-structured data<br />Explore data by querying unknown relationships<br />Perform complex joins of disparate data sources in a single, simple query<br />Transform RDF data from one vocabulary to another<br />
  4. 4. Structure of a SPARQL Query<br />A SPARQL query comprises, in order:<br />Prefix declarations, for abbreviating URIs<br />Dataset definition, stating what RDF graph(s) are being queried<br />A result clause, identifying what information to return from the query<br />The query pattern, specifying what to query for in the underlying dataset<br />Query modifiers, slicing, ordering, and otherwise rearranging query results<br />
  5. 5. Anatomy of a SPARQL Query<br />PREFIXfoo:&lt;…&gt;<br />PREFIXbar:&lt;…&gt;<br />…<br />SELECT …<br />FROM &lt;…&gt;<br />FROM NAMED &lt;…&gt;<br />WHERE{<br /> …<br />}<br />ORDER BY …<br />LIMIT …<br />OFFSET …<br />Declare prefix<br />shortcuts <br />(optional)<br />Query result <br />clause<br />Define the <br />dataset (optional)<br />Query pattern<br />Query modifiers<br />(optional)<br />
  6. 6. An Example SPARQL Query<br />Find the name of all landlocked countries with a population bigger than 15 million<br />PREFIXrdfs:&lt;;<br />PREFIXtype:&lt;;<br />PREFIXprop: &lt;;<br />SELECT?country_name ?population <br />WHERE{ <br />?countryatype:LandlockedCountries;<br />rdfs:label?country_name;<br />prop:populationEstimate?population.<br />FILTER(?population&gt;15000000).<br />}<br />
  7. 7. SPARQL Over HTTP (the SPARQL Protocol)<br />;parameters&gt;<br />where &lt;parameters&gt;can include:<br />query=&lt;encoded query string&gt;<br />e.g. SELECT+*%0DWHERE+{…<br />default-graph-uri=&lt;encoded graph URI&gt;<br />e.g.…<br />n.b. zero of more occurrences of default-graph-uri<br /> named-graph-uri=&lt;encoded graph URI&gt;<br />e.g.…<br />n.b. zero of more occurrences of named-graph-uri<br />HTTP GET or POST. Graphs given in the protocol override graphs given in the query.<br />
  8. 8. Some Public SPARQL Endpoints<br />
  9. 9. Disclaimer<br />The SPARQL Working Group has not yet decided many of the technical questions surveyed in these slides. All examples are subject to change; please do not construe them as indicators or endorsements of specific technical designs/decisions.<br />All opinions are Lee Feigenbaum’s alone.<br />
  10. 10. Naming<br />I use “SPARQL2” to collectively refer to the work of the 2nd SPARQL Working Group. The actual languages being worked on are known as:SPARQL/Query 1.1SPARQL/Update 1.0<br />
  11. 11. Where are we now?<br />Today<br />August 2010<br />March 2009<br />???<br />Last Call and beyond of core SPARQL specifications<br />July 2009<br />FPWD of SPARQL New Features and Rationales document<br />October 2009<br />FPWD of core SPARQL specifications<br />
  12. 12. Overview<br />
  13. 13. Projected Expressions<br />Select expressions other than variables (literals, functions on literals and variables, etc.)<br />Issues around:<br />Do expressions require an aliased name?<br />Syntax (main issue here)<br />SELECT ?price * ?qty AS ?total_price<br />WHERE {<br /> …<br />}<br />
  14. 14. Aggregates<br />À la SQL aggregates (MIN, MAX, COUNT, AVG, etc.)<br />Issues around:<br />Which aggregates to include<br />Aggregates over mixed datatypes<br />Syntax, keywords, custom aggregates<br />SELECT MIN(?price) AS ?min_price …<br />WHERE { … }<br />GROUP BY ?item<br />
  15. 15. Subqueries<br />Nested queries allow multiple queries to be combined into one. <br />Issues around:<br />Variable scope & evaluation model<br />Precise syntax<br />SELECT ?article ?authorWHERE { ?article ex:author ?author . { SELECT ?article WHERE { … ?article … } ORDER BY … LIMIT … }}<br />
  16. 16. Negation<br />Supplant the mystifying OPTIONAL/!bound method of negation with a dedicated construct<br />Issues around:<br />Filter semantics vs. set-difference semantics<br />Choice of keyword(s)<br />SELECT … WHERE { ?person a foaf:Person .<br /> NOT { <br /> ?person foaf:mbox ?email<br /> }<br />}<br />
  17. 17. Service Description<br />A standard discovery mechanism and vocabulary for describing the capabilities, extensions, data sets, and more for a SPARQL endpoint<br />Discovery. How can a client find the RDF that describes a SPARQL endpoint at a particular URI?<br />Description. What predicates, classes, values, etc. should a client expect to find (and be able to query) once it locates a service description?<br />Issues around:<br />Choice of discovery mechanism<br /> Which predicates and enumerations to define URIs for<br />
  18. 18. Update Language<br />Based on the SPARQL Update member submission<br />Batch insert & delete<br />Insert & delete based on triple patterns<br />Graph management (creation, removal)<br />Issues around:<br />Graph stores vs. triple stores<br />Which language statements to include?<br />Transactions/atomicity/concurrency?<br />
  19. 19. Update Protocol<br />The ability to issue SPARQL/Update language statements via a standard protocol (e.g. via HTTP POST)<br />Issues around:<br />Relation to existing SPARQL (Query) Protocol<br /> Security<br /> Need for WSDL description? SOAP bindings?<br />
  20. 20. RESTful Update<br />Where appropriate, map RESTful HTTP requests to SPARQL/Update operations<br />DELETE /foo/g1 …-&gt; DELETE DATA FROM ex:g1 …<br />Issues around:<br />Which mappings to include?<br />Updating graphs with URIs that are not under the control of the SPARQL endpoint<br />
  21. 21. Property Paths<br />Support arbitrary-length predicate paths in triple patterns – “regular expressions” on predicates?<br />Query hierarchical structures such as RDF collections<br />Issues around:<br />Can variables be used in path expressions?<br />Can the length of a path be found?<br />Are paths first-class datatypes?<br />SELECT … WHERE { ?person foaf:knows+ ?network .<br />}<br />
  22. 22. Basic Federated Query<br />Initial scaffolding for authoring federated SPARQL queries<br />Likely will involve a keyword to explicitly target portions of a query to specific endpoints<br />Initial plan: Start with ARQ’s SERVICE keyword<br />SELECT … WHERE { … SERVICE ex:books {<br /> …<br /> }<br />}<br />
  23. 23. Entailment Regime Semantics<br />SPARQL/Query 1.0 defines a mechanism to extend SPARQL semantics for additional entailment regimes<br />Use this mechanism to define the semantics of SPARQL queries for:<br />RDF Schema<br />OWL flavors<br />RIF rule sets<br />…<br />Issues around:<br />Requiring consistency checks<br />How to limit infinite results (e.g. from axiomatic inferences)<br />
  24. 24. Common Functions<br />Extend the set of functions that SPARQL engines must support to include some of…<br />Common string functions (e.g. substr)<br />Common date/time/datetime functions<br />Logical functions (COALESCE, IF, …?)<br />Limited discussion to date about which functions to include<br />
  25. 25. Get Involved<br />Join. <br />Email<br />Follow. <br />WG materials at<br />Comment. <br />Public feedback at<br />Use. <br />Discuss SPARQL at<br />
  26. 26. SPARQL Resources<br />The SPARQL Specification<br /><br />SPARQL implementations<br /><br />SPARQL endpoints<br /><br />SPARQL Frequently Asked Questions<br /><br />SPARQL 2 Working Group<br /><br />Common SPARQL extensions<br /><br />