SPARQL

From BC$ MobileTV Wiki
Revision as of 23:20, 7 May 2010 by 198.164.42.156 (Talk)

Jump to: navigation, search
SPARQL Semantic Pattern-based Aspect-oriented Relational Query Language

SPARQL (pronounced "sparkle" [1]) is an RDF query language; its name is a recursive acronym [2] that stands for SPARQL Protocol and RDF Query Language. It is standardized by the RDF Data Access Working Group (DAWG) of the W3C. Initially released as a Candidate Recommendation in April 2006, but returned to Working Draft status in October 2006, due to two open issues. [3] In June 2007, SPARQL advanced to Candidate Recommendation once again. [4] On 12th November 2007 the status of SPARQL changed into Proposed Recommendation. [5] On 15th January 2008, SPARQL became an official W3C Recommendation. [6]


The RDF Data Access Working Group has published three SPARQL recommendations (Query Language, Protocol, and Results Format) in January 2008. SPARQL has become very widely implemented and used since then (and, in fact, even before the specification achieved a W3C Recommendation status). Usage and implementation of SPARQL have revealed requirements for extensions to the query langauge that are needed by applications. Most of these were already known and recorded when developing the current Recommendation, but there was not enough implementation and and usage experience at the time for standardization. Current implementation experience and feedback from the user community makes it now feasible to handle some of those issues in a satisfactory manner. [7]


Specifications



SPARQL Query in AllegroGraph

Applications

SPARQLbot


SPARQLscript


SPARQL Server


SPARQL Engine



Examples

The following simple SPARQL query returns all country capitals in Africa:

PREFIX abc: <http://example.com/exampleOntology#> 
SELECT ?capital ?country
WHERE {
  ?x abc:cityname ?capital ;
     abc:isCapitalOf ?y .
  ?y abc:countryname ?country ;
     abc:isInContinent abc:Africa .
}

Variables are indicated by a "?" or "$" prefix. Bindings for ?capital and the ?country will be returned.

The SPARQL query processor will search for sets of triples that match these four triple patterns, binding the variables in the query to the corresponding parts of each triple. Important to note here is the "property orientation" (class matches can be conducted solely through class-attributes / properties) [8]

To make queries concise, SPARQL allows the definition of prefixes and base URIs in a fashion similar to Turtle. In this query, the prefix "abc" stands for “http://example.com/exampleOntology#”.


EndPoints




Tools



Resources



Tutorial



External Links



References

  1. SPARQL Will Make the Web Shine
  2. wikipedia:recursive acronym
  3. SPARQL Query Language for RDF - W3C Working Draft: http://www.w3.org/TR/2006/WD-rdf-sparql-query-20061004/
  4. W3C Semantic Web Activity News - SPARQL is a Candidate Recommendation: http://www.w3.org/blog/SW/2007/06/15/sparql_is_a_candidate_recommendation
  5. Archive of W3C News in 2007: http://www.w3.org/News/2007#item247
  6. W3C Semantic Web Activity News - SPARQL is a Recommendation: http://www.w3.org/blog/SW/2008/01/15/sparql_is_a_recommendation
  7. SPARQL Charter: http://www.w3.org/2009/01/sparql-charter.html
  8. See: wikipedia:Duck typing



See Also

Semantic Web | Linked Data | OWL | RDF | N3 | XML | XSL | XSLT | JSON