SPARQL (pronounced "sparkle" ) is an RDF query language; its name is an acronym that stands for Simple Protocol and RDF Query Language. It is standardized by the RDF Data Access Working Group (DAWG) of the World 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. In June 2007, SPARQL advanced to Candidate Recommendation once again. On 12th November 2007 the status of SPARQL changed into Proposed Recommendation. On 15th January 2008, SPARQL became an official W3C Recommendation.
The following simple SPARQL query returns all country capitals in Africa:
SELECT ?capital ?country
?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)