query-09c78f47a501f742e8cc13435aa619fc
.on Mastodon and on TwitterOriginally posted
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 ?river ?riverLabel (?lengthInM/1000 AS ?lengthInKm) ?mouthLabel WHERE {
{
SELECT DISTINCT ?river ?lengthInM ?mouth WHERE {
?river wdt:P31/wdt:P279* wd:Q4022;
wdt:P403 ?mouth;
p:P2043 ?lengthStatement. ?lengthStatement a wikibase:BestRank; psn:P2043/wikibase:quantityAmount ?lengthInM.
?mouth wdt:P31/wdt:P279* wd:Q4022.
FILTER(?lengthInM > 1000000)
}
ORDER BY DESC(?lengthInM)
LIMIT 10
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?lengthInM)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?lengthInKm")
v1("?lengthInM"):::projected
v4("?lengthStatement")
v3("?mouth")
v2("?river"):::projected
a1((" "))
a2((" "))
a3((" "))
c8(["wikibase:BestRank"]):::iri
c12(["bd:serviceParam"]):::iri
c4(["wd:Q4022"]):::iri
c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["?lengthInM > '1000000^^xsd:integer'"]]
f0 --> v1
v2 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c4
v2 --"p:direct/P403"--> v3
v2 --"p:P2043"--> v4
v4 --"a"--> c8
v4 --"p:statement/value-normalized/P2043"--> a2
a2 --"wikibase:quantityAmount"--> v1
v3 --"p:direct/P31"--> a3
a3 --"p:direct/P279"--> c4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end
bind1[/"?lengthInM / '1000^^xsd:integer'"/]
v1 --o bind1
bind1 --as--o v5