query-519472b7a4b25d98e3a7ae96151855e8
.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.
MINUS { ?mouth wdt:P31/wdt:P279* wd:Q165. }
MINUS { ?mouth wdt:P31/wdt:P279* wd:Q9430. }
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((" "))
a4((" "))
c8(["wikibase:BestRank"]):::iri
c14(["bd:serviceParam"]):::iri
c4(["wd:Q4022"]):::iri
c12(["wd:Q9430"]):::iri
c16(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c11(["wd:Q165"]):::iri
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
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v3 --"p:direct/P31"--> a3
a3 --"p:direct/P279"--> c11
end
subgraph minus2["MINUS"]
style minus2 stroke-width:6px,fill:pink,stroke:red;
v3 --"p:direct/P31"--> a4
a4 --"p:direct/P279"--> c12
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c14 --"wikibase:language"--> c16
end
bind3[/"?lengthInM / '1000^^xsd:integer'"/]
v1 --o bind3
bind3 --as--o v5