query-49862236ebcc3b69bfe2eb635b66cff1
Query for all entities that have a page in the Wikipedia of a given languageHi! I would like to make a query to retrieve all the entities that have a Wikipedia page in a given language. My goal is to make a dictionary with entries {'title_in_the_given_wiki': 'QID'}, for a given language. E.g. for eswiki: {..., 'Varsovia': 'Q270', ..., 'Siglo_X': 'Q8052', Edit: this is my current best attempt, but I'm not quite there yet:
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel
WHERE
{
?item wdt:P31 wd:Q35120 .
SERVICE wikibase:label { bd:serviceParam wikibase:language "es" }
}
LIMIT 5
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
c4(["bd:serviceParam"]):::iri
c2(["wd:Q35120"]):::iri
c6(["es"]):::literal
v1 --"wdt:P31"--> c2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c4 --"wikibase:language"--> c6
end