query-7f8597eb228cc2950bf9b0bbb27f3b38

rq turtle/ttl

(P2043)length

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX psn: <http://www.wikidata.org/prop/statement/value-normalized/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?ent ?val ?valLabel

WHERE
{

{
  SELECT DISTINCT ?val ?amount
  WHERE
  {

{
  SELECT ?class
  WHERE
  {
    VALUES ?label1 { rdfs:label skos:altLabel }
    ?class ?label1 "river"@en .
  }
}  

    ?val wdt:P31/wdt:P279* ?class .
    ?val p:P2043/psn:P2043/wikibase:quantityAmount ?amount.
  }
  ORDER BY DESC(?amount)
  LIMIT 10
}  BIND(?amount / 1000 AS ?ent)
  OPTIONAL
  {
    ?val rdfs:label ?valLabel .
    FILTER(LANG(?valLabel) = "en")
  } 
}
ORDER BY DESC(?ent)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?amount") v5("?class") v7("?ent"):::projected v4("?label1") v6("?val"):::projected v2("?valLabel"):::projected a1((" ")) a2((" ")) a3((" ")) c2([sriver^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"]):::literal bind0[/VALUES ?label1/] bind0-->v4 bind00(["rdfs:label"]) bind00 --> bind0 bind01(["skos:altLabel"]) bind01 --> bind0 v5 -->v4--> c2 v6 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> v5 v6 --"p:P2043"--> a2 a2 --"p:statement/value-normalized/P2043"--> a3 a3 --"wikibase:quantityAmount"--> v3 bind1[/"?amount / '1000^^xsd:integer'"/] v3 --o bind1 bind1 --as--o v7 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v6 -."rdfs:label".-> v2 end