From Riga Literata
Jump to navigation Jump to search


in Wikidata prefixes don't need to be specified explicitly in SPARQL queries. However, in our instance, prefixes must be explicitly stated, as this example shows. Please note and mind the distinction between PREFIX kbwdt, kbwd, wdt and wd.

The following query uses these:

PREFIX rlwd: <>
PREFIX rlwdt: <>

SELECT ?item ?itemLabel
  ?item rlwdt:P1 rlwd:Q6.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,[AUTO_LANGUAGE]". }

Try it!

Highlighting and color-coding SPARQL query

ISSUE: the Wikidata SPARQL template for query syntax highlighting is not implemented in this Wikibase.

SOLUTION: Instead one must use a <sparql tryit="1">...</sparql> wrapper, as demonstrated in this example.
Look example above

Exact URL

The exact URL, as well as the correct formatting of this page, are important to correctly display these query examples in the query services interface