query-6a0757b0bc5c969a204d22f01a7668b9

rq turtle/ttl

Location of Lithuanian cities with a population count greater than 10.000

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#filter:Location of Lithuanian cities with a population count greater than 10.000
#defaultView:Map
SELECT DISTINCT ?city ?cityLabel ?population ?location ?lon ?lat WHERE {
  # get cities (or classes based on city) in Lithuania
  ?city wdt:P31/wdt:P279* wd:Q515 ;
        wdt:P17 wd:Q37 .

  # get population and location of the city
  ?city wdt:P1082 ?population ;
        wdt:P625 ?location .

  # we're only interested in cities with a population count > 50.000
  FILTER (abs(?population) > 10000)

  # extract lat and lon
  ?city p:P625 ?coordinate.
  ?coordinate psv:P625 ?coordinate_node.
  ?coordinate_node wikibase:geoLongitude ?lon.
  ?coordinate_node wikibase:geoLatitude ?lat. 

  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?city"):::projected v4("?coordinate") v5("?coordinate_node") v7("?lat"):::projected v3("?location"):::projected v6("?lon"):::projected v1("?population"):::projected a1((" ")) c6(["wd:Q37"]):::iri c14(["bd:serviceParam"]):::iri c4(["wd:Q515"]):::iri c16(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["numeric-abs(?population) > '10000^^xsd:integer'"]] f0 --> v1 v2 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> c4 v2 --"p:direct/P17"--> c6 v2 --"p:direct/P1082"--> v1 v2 --"p:direct/P625"--> v3 v2 --"p:P625"--> v4 v4 --"p:statement/value/P625"--> v5 v5 --"wikibase:geoLongitude"--> v6 v5 --"wikibase:geoLatitude"--> v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 end