query-03fc0f5b0e10e0cfa3eb7a3bfea2f6b0

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psn: <http://www.wikidata.org/prop/statement/value-normalized/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?place ?placeLabel ?elev ?ulabel #?unit
WHERE {
   {
  SELECT ?place (SAMPLE(?elev_st_) AS ?elev_st)
  WHERE {
    #?place wdt:P17 wd:Q34 . # Reduce the working set.
    #?place wdt:P31 wd:Q8502 .

    ?place p:P2044 ?elev_st_ .
    ?elev_st_ a wikibase:BestRank .
  }
  GROUP BY ?place
  LIMIT 100
}  ?elev_st psn:P2044 [ wikibase:quantityAmount ?elev; wikibase:quantityUnit ?unit ] .
  BIND(IF(ABS(?elev) >= 2, "meter", "meter") AS ?ulabel)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "sv,en" }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?elev"):::projected v3("?elev_st") v2("?elev_st_") v1("?place"):::projected v6("?ulabel"):::projected v5("?unit") a1((" ")) c8(["bd:serviceParam"]):::iri c10(["sv,en"]):::literal c3(["wikibase:BestRank"]):::iri v1 --"p:P2044"--> v2 v2 --"a"--> c3 bind1[/"sample(?elev_st_)"/] v2 --o bind1 bind1 --as--o v3 a1 --"wikibase:quantityAmount"--> v4 a1 --"wikibase:quantityUnit"--> v5 v3 --"p:statement/value-normalized/P2044"--> a1 bind2[/"if(numeric-abs(?elev) >= '2^^xsd:integer','meter','meter')"/] v4 --o bind2 bind2 --as--o v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end