query-57b641ad4ef7a360ca9ec98be0d9b0f0
TODO
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 psn: <http://www.wikidata.org/prop/statement/value-normalized/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?point ?pointLabel ?height ?countyLabel WHERE
{
{
SELECT ?county (MAX(?height_) AS ?height) WHERE {
?point p:P2044 ?stat .
?stat psn:P2044/wikibase:quantityAmount ?height_.
?stat a wikibase:BestRank.
?point wdt:P131 ?county.
?county wdt:P17 wd:Q33.
} GROUP BY ?county } ?point p:P2044 ?stat2 .
?stat2 psn:P2044/wikibase:quantityAmount ?height.
?stat2 a wikibase:BestRank.
?point wdt:P131 ?county.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fi,en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?county")
v5("?height"):::projected
v3("?height_")
v1("?point"):::projected
v2("?stat")
v6("?stat2")
a1((" "))
a2((" "))
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,fi,en"]):::literal
c5(["wikibase:BestRank"]):::iri
c8(["wd:Q33"]):::iri
v1 --"p:P2044"--> v2
v2 --"p:statement/value-normalized/P2044"--> a1
a1 --"wikibase:quantityAmount"--> v3
v2 --"a"--> c5
v1 --"p:direct/P131"--> v4
v4 --"p:direct/P17"--> c8
bind1[/"max(?height_)"/]
v3 --o bind1
bind1 --as--o v5
v1 --"p:P2044"--> v6
v6 --"p:statement/value-normalized/P2044"--> a2
a2 --"wikibase:quantityAmount"--> v5
v6 --"a"--> c5
v1 --"p:direct/P131"--> v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end