query-328075e123d072fa03d69e46a7235ea7

rq turtle/ttl

SPARQL basicsA simple SPARQL query looks like this: } .?c f ?b .?b n m .?a y x { WHERE ?c ?b ?a SELECT clause contains restrictions on them, mostly in the form of triples. All information in Wikidata (and similar knowledge databases) is stored in the form of triples; when you run the query, the query service tries to fill in the variables with actual values so that the resulting triples appear in the knowledge database, and returns one result for each combination of variables it finds. WHERE clause lists variables that you want returned (variables start with a question mark), and the SELECTThe : object, and an predicate, a subjectA triple can be read like a sentence (which is why it ends with a full stop), with a } .sour tastes ?fruit .yellow hasColour ?fruit { WHERE ?fruit SELECTThe results for this query could include, for example, “lemon”. In Wikidata, most properties are “has”-kind properties, so the query might instead read:

Use at

SELECT ?fruit
WHERE
{
  ?fruit colour yellow.
  ?fruit taste sour.
}

Query found at