Querying: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 30: | Line 30: | ||
PREFIX wd-wd: <http://www.wikidata.org/entity/> | PREFIX wd-wd: <http://www.wikidata.org/entity/> | ||
PREFIX wd-wdt: <http://www.wikidata.org/prop/direct/> | PREFIX wd-wdt: <http://www.wikidata.org/prop/direct/> | ||
SELECT ?sancak ?vilayet | SELECT ?sancak ?vilayet | ||
WHERE | WHERE |
Revision as of 02:19, 1 October 2022
Run SPARQL queries via the Ottgaz Query Service.
Remember: SPARQL is currently case sensitive, as elastic search is disabled in wikibase.cloud.
Namespace
Declare these namespaces at the start of every query:
PREFIX wd: <https://ottgaz.org/entity/> PREFIX wdt: <https://ottgaz.org/prop/direct/>
Sample queries
Label
All items that are vilayets, as well as their English language label. run
SELECT ?vilayet ?vilayetLabel WHERE { ?vilayet wdt:P6 wd:Q5 . SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } }
Federated query with Wikidata
This is not working. run
PREFIX wd: <https://ottgaz.org/entity/> PREFIX wdt: <https://ottgaz.org/prop/direct/> PREFIX wd-wd: <http://www.wikidata.org/entity/> PREFIX wd-wdt: <http://www.wikidata.org/prop/direct/> SELECT ?sancak ?vilayet WHERE { ?sancak wdt:P4 ?link . SERVICE <https://query.wikidata.org/sparql> { ?link wd-wdt:P131 ?vilayet . } }