- SPARQL
__NOTOC__ SPARQL (pronounced "" [cite web | url = http://www.eweek.com/article2/0,1759,1965980,00.asp | title = SPARQL Will Make the Web Shine | author = Jim Rapoza | work =
eWeek | date = May 2, 2006 | accessdate = 2007-01-17 ] ) is anRDF query language ; its name is anacronym that stands for "Simple Protocol and RDF Query Language". It is standardized by the "RDF Data Access Working Group" (DAWG) of theWorld Wide Web Consortium . Initially released as a Candidate Recommendation in April 2006, but returned to Working Draft status in October 2006, due to two open issues. cite web | url = http://www.w3.org/TR/2006/WD-rdf-sparql-query-20061004/ | title = SPARQL Query Language for RDF : W3C Working Draft | date = 4 October 2006 | author = Eric Prud'hommeaux, W3C; Andy Seaborne,Hewlett-Packard Laboratories | accessdate = 2007-01-17 ] In June 2007, SPARQL advanced to Candidate Recommendation once again. [ [http://www.w3.org/blog/SW/2007/06/15/sparql_is_a_candidate_recommendation W3C Semantic Web Activity News - SPARQL is a Candidate Recommendation ] ] On 12th November 2007 the status of SPARQL changed into Proposed Recommendation. [ [http://www.w3.org/News/2007#item247 Archive of W3C News in 2007 ] ] On 15th January 2008, SPARQL became an official W3C Recommendation. [ [http://www.w3.org/blog/SW/2008/01/15/sparql_is_a_recommendation W3C Semantic Web Activity News - SPARQL is a Recommendation ] ]SPARQL allows for a query to consist of
triple pattern s, conjunctions, disjunctions, and optionalpattern s. [cite web | url = http://www.xml.org/xml/news/archives/archive.10062006.shtml#5 | title = XML and Web Services In The News | work = xml.org | date = 6 October 2006 | accessdate = 2007-01-17 ]Several implementations for multiple
programming language s exist [http://esw.w3.org/topic/SparqlImplementations] . "SPARQL will make a huge difference" according to SirTim Berners-Lee in a May 2006 interview. [cite news | url = http://news.zdnet.co.uk/internet/0,1000000097,39270671,00.htm | title = Berners-Lee looks for Web's big leap | date = 22 May 2006 | author = Reuters | work = zdnet.co.uk | accessdate = 2007-01-17 ]Example
The following simple SPARQL query returns all country capitals in Africa:
PREFIX abc:
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 - see
Duck typing )To make queries concise, SPARQL allows the definition of prefixes and base
URI s in a fashion similar to Turtle. In this query, the prefix "abc" stands for “http://example.com/exampleOntology# ”.References
External links
* [http://www.w3.org/2001/sw/DataAccess/ W3C RDF Data Access Working Group]
* [http://www.w3.org/TR/rdf-sparql-query/ SPARQL Query language]
* [http://www.w3.org/TR/rdf-sparql-protocol/ SPARQL Protocol]
* [http://www.w3.org/TR/rdf-sparql-XMLres/ SPARQL Query XML Results Format]
Wikimedia Foundation. 2010.