SPARQL Examples

Revision as of 18:44, 2 January 2023 by Eduards (talk | contribs) (Created page with "=== PREFIXES === ''in Wikidata prefixes don't need to be specified explicitly in SPARQL queries''. However, in our Wikibase.cloud instance, prefixes must be explicitly stated, as [https://kbtestwikibase.wikibase.cloud/wiki/Project:SPARQL/examples#Federated_querying:_mixing_data_from_this_Wikibase_with_data_from_Wikidata this example] shows. Please note and mind the distinction between PREFIX kbwdt, kbwd, wdt and wd.<BR> <sparql list="1" tryit="1"> PREFIX rlwd: <https://...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

PREFIXES

in Wikidata prefixes don't need to be specified explicitly in SPARQL queries. However, in our Wikibase.cloud 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: <https://riga-literata.wikibase.cloud/entity/>
PREFIX rlwdt: <https://riga-literata.wikibase.cloud/prop/direct/>

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

Try it!