variation of the official World Wide Web Consortium Icon | |
Paradigm | Query language |
---|---|
Developer | W3C |
First appeared | 2008; 11 years ago |
Stable release | |
Website | www.w3.org/TR/sparql11-query/ |
Major implementations | |
Jena,[1]OpenLink Virtuoso[1] |
JOIN
, SORT
, AGGREGATE
for data whose schema is intrinsically part of the data rather than requiring a separate schema definition. However, schema information (the ontology) is often provided externally, to allow joining of different datasets unambiguously. In addition, SPARQL provides specific graph traversal syntax for data that can be thought of as a graph.foaf
('friend of a friend').a
', is a person (foaf:Person
), and the person has one or more names (foaf:name
) and mailboxes (foaf:mbox
).?person
' for readable clarity. Since the first element of the triple is always the subject, the author could have just as easily used any variable name, such as '?subj
' or '?x
'. Whatever name is chosen, it must be the same on each line of the query to signify that the query engine is to join triples with the same subject.?person
, ?name
, ?email
. This query returns the ?name
and ?email
because ?person
is often a complex URI rather than a human-friendly string. Note that any ?person
may have multiple mailboxes, so in the returned set, a ?name
row may appear multiple times, once for each mailbox.SELECT
queryCONSTRUCT
queryASK
queryDESCRIBE
queryWHERE
block to restrict the query, although, in the case of the DESCRIBE
query, the WHERE
is optional.?
or $
prefix. Bindings for ?capital
and the ?country
will be returned. When a triple ends with a semicolon, the subject from this triple will implicitly complete the following pair to an entire triple. So for example ex:isCapitalOf ?y
is short for ?x ex:isCapitalOf ?y
.ex
' stands for “http://example.com/exampleOntology#”.INSERT
and DELETE
methods.Wikimedia Commons has media related to SPARQL. |