What is SPARCool ?

SPARCool offers a way to run SPARQL queries about any URI that follows the Linked Data principles by calling a simple URL based on the http://sparcool.net/format/predicate[;l=lang]/URI pattern.

For instance, http://sparcool.net/j/dbp:abstract;l=en/http://dbpedia.org/resource/Semantic_Web will return answer(s) for the following query, using JSON serialization format for SPARQL Query results:


PREFIX dbp: <http://dbpedia.org/property/>

SELECT DISTINCT ?value
FROM <http://dbpedia.org/resource/Semantic_Web>
WHERE {
  <http://dbpedia.org/resource/Semantic_Web> dbpedia:abstract ?value .
  FILTER (lang(?value) = "en") .
}

Which formats are supported ?

The following values are supported for the format parameter:

x
XML
j
JSON
h
HTML view, without headers for inclusion in existing pages
r
Redirects to the first answer of the query, can be used for hyperlinks or images, as in http://sparcool.net/r/foaf:img/http://dbpedia.org/resource/Ramones

Which prefixes are supported ?

Predicate must be written using a prefix:value syntax. The supported prefixes are retrieved from prefix.cc. Hence, you can add you own prefixes there.

Please, more examples !

Redirecting to (one of) the foaf:homepage of TimBL
http://sparcool.net/r/foaf:homepage/http://www.w3.org/People/Berners-Lee/card%2523i (note that # must be urlencoded)
English abstract about "SPARQL" on DBpedia (JSON)
http://sparcool.net/j/dbp:abstract;l=en/http://dbpedia.org/resource/SPARQL
Past members of the only band that matters - oh yeah ! - (HTML View)
http://sparcool.net/h/dbo:pastMembers/http://dbpedia.org/resource/The_Clash
And the same list included in an HTML page thanks to JSONP callback (check page source)