0

Can't seem to figure this out I want to generate a list from wiki data that shows all the languages found in a city

E.G South African languages and their locations

Country          Language           Province
South Africa --- Afrikaans -------- KwaZulu-Natal
South Africa --- Afrikaans -------- Cape Town
South Africa --- Northern Sotho ---- Free State
South Africa --- Swazi --------------Durban
South Africa --- Tsonga ------------- Lesotho 

I also don't want to limit the results to Official languages as many countries have several languages that are not officially recognized. as show here.

https://en.wikipedia.org/wiki/Languages_of_South_Africa

this is what I currently have

SELECT DISTINCT ?lang ?langLabel ?Country ?CountryLabel ?City ?CityLabel
WHERE
{
    ?lang  wdt:P31 wd:Q34770 .
    ?Country wdt:P31 wd:Q6256 . 
    VALUES ?Country {wd:Q258 }  

 VALUES ?Country {wd:Q258 }  

 SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }

}

LIMIT 100

I'm currently using the Javascript wikidata-sdk

24thDan
  • 113
  • 1
  • 9
  • and you're not able to get the cities of a country? I don't think that languages are attached to cities, at least I can't find such an information for [Pretoria](https://www.wikidata.org/wiki/Q3926) – UninformedUser Sep 09 '18 at 13:45
  • I’m open to ideas on a work around even if it involves using another api – 24thDan Sep 09 '18 at 20:52
  • Could https://www.wikidata.org/wiki/Property:P2936 be added to city items? Although I guess it'd be applied to the largest geographical entity (maybe that's the city, but maybe it's the region/state/etc.). – Sam Wilson Sep 10 '18 at 01:15

0 Answers0