I'm new to querying Wikidata, and I have a list of Wikidata IDs for which I would like to get the count of non-English page versions. For example, for the ID referring to "Rivers State" (page here) I would like to get the count of all non-English languages to which the page has been translated (the "in more languages" list at the top of the "Rivers State" page). I can't figure out what property the "in more languages" is, otherwise I would just query for that property.
Asked
Active
Viewed 415 times
1
-
Not sure whether it reflects the information you need, but try it: `SELECT (count(?lang) as ?numLang) WHERE { wd:Q503923 rdfs:label ?label . filter(!langmatches(lang(?label), 'en')) bind(lang(?label) as ?lang) }` – UninformedUser Feb 02 '18 at 04:33
-
1@istewart, unlike Wikipedia, there are no language versions of articles in Wikidata. An Wikidata "article" is translating not as a whole, but, so to speak, property by property. For different (string literal) properties, the number of "translations" may be different. In your questions, you are interested in the number of translations of the article "title". Perhaps you could be interested in the number of corresponding Wikipedia articles for this Wikidata entry. – Stanislav Kralin Feb 02 '18 at 06:47
-
@AKSW that is exactly what I need, thank you! And I was indeed interested in the number of corresponding Wikipedia articles; sorry for the confusion. – istewart Feb 02 '18 at 15:36
1 Answers
2
@AKSW got it! I wanted the number of corresponding labels in different languages for a given Wikidata entry.
SELECT (count(?lang) as ?numLang) WHERE {
wd:Q503923 rdfs:label ?label .
filter(!langmatches(lang(?label), 'en')) bind(lang(?label) as ?lang)
}

istewart
- 437
- 5
- 18
-
1The number of labels in different languages and the number of corresponding Wikipedia articles are different numbers. For example, look at the tables in [this answer](https://stackoverflow.com/a/48484919/7879193). – Stanislav Kralin Feb 02 '18 at 18:59