query-2c4cc94a4e81c7a8fcd9737d1ca13c2b

rq turtle/ttl

Map of languagesElection map of FinlandHi I'm working on a proposal for a project to try and improve coverage of languages on Wikidata and Wikipedia and want to create a prototype to visualise languages on a map as a way to explore them. Is there some way to create a map which shows which languages are present in which countries? I know there are some issues with lack of shape files for countries and country regions. But I've also seen maps like this? I'm very happy for it to work for a very small region, all I want to show is that its is possible and you can click a button to get to the Wikipedia article for that language. This could either be a map to show all the languages in a region or which countries a language is spoken in or both. Thanks very much 10:11, 15 May 2018 (UTC)) talk (John Cummings--Here's a query that can start to answer this question: a map showing every sovereign state and its official languages. Issues that still need to be fixed are: using shape polygons to cover the countries instead of using a point coordinate per country, and linking to the wiki pages of the languages instead of just showing them in a concatenated field. I'm pretty sure those issues can be fixed with Kartographer, but I haven't worked with Kartographer in the past so I can't be of help there.

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
 SELECT 
 ?country
 ?countryLabel
 ?coordinates
 (group_concat(?languagesLabel;separator=" , ") as ?official_languages)
 WHERE {
   ?country wdt:P31 wd:Q3624078.
   ?country wdt:P37 ?languages .
   ?country wdt:P625 ?coordinates .
   OPTIONAL { 
        ?languages rdfs:label ?languagesLabel.
        FILTER(LANG(?languagesLabel) = "en").
    }
   SERVICE wikibase:label { bd:serviceParam wikibase:language 'en'. }
 } GROUP BY ?country ?countryLabel ?coordinates

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?coordinates"):::projected v2("?country"):::projected v3("?languages") v1("?languagesLabel"):::projected v5("?official_languages") c3(["wd:Q3624078"]):::iri c8(["bd:serviceParam"]):::iri c1(["en"]):::literal v2 --"wdt:P31"--> c3 v2 --"wdt:P37"--> v3 v2 --"wdt:P625"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."rdfs:label".-> v1 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c1 end bind1[/"?languagesLabel"/] v1 --o bind1 bind1 --as--o v5