query-0291955045d9286456c8697f568af2d4

rq turtle/ttl

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

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

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?c"):::projected v4("?country"):::projected v3("?official_name"):::projected v1("?population"):::projected a1((" ")) c4(["wd:Q486972"]):::iri c6(["wd:Q38"]):::iri c8(["bd:serviceParam"]):::iri c10(["en"]):::literal f0[["?population > '14999^^xsd:integer'"]] f0 --> v1 v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c4 v2 --"wdt:P17"--> c6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P1448".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P17".-> v4 end v2 --"wdt:P1082"--> v1