Search code examples
sparqlwikidata

Get count of articles in other languages from Wikidata


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.


Solution

  • @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) 
    }