query-0291955045d9286456c8697f568af2d4
country (P17), subclass of (P279), instance of (P31): Properties07:02, 21 July 2017 (UTC)) talk (Innocent bystanderWe really need a good definition of City here. -- ).contribs • talk (Widauser comment was added byunsignedThe preceding – Thanks, it works! Now how Can I select the cities bigger than 10000 people ? I tryed "?c wdt:P1082 ?population > 10000." but no... About definition of City, When I asked "all the cities in the world" I ment also the small towns. "human settlement" is what I needed but its not very user-friendly... I'd call it 'cities and towns', and a mall in the desert is another thing I think... 17:36, 24 July 2017 (UTC)) talk (Innocent bystanderWe have several definitions in Swedish only, some of them not fiting with subclasses of "human settlement". -- Finally I used this query:
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 DISTINCT ?c ?cLabel ?official_name ?country ?population WHERE {
?c (wdt:P31/wdt:P279*) wd:Q486972.
?c wdt:P17 wd:Q38.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
OPTIONAL { ?c wdt:P1448 ?official_name. }
OPTIONAL { ?c wdt:P17 ?country. }
?c wdt:P1082 ?population.
FILTER ( ?population > 14999)
}