SELECT DISTINCT ?item ?itemLabel ?itemDescription (MAX(?billion) as ?billions) ?locationLabel (SAMPLE(?image) AS ?picture) ?page_titleEN
WHERE
{
?item wdt:P2218 ?worth.
OPTIONAL {?item wdt:P19 ?location .}
FILTER(?worth>1000000000).
BIND(?worth/1000000000 AS ?billion).
OPTIONAL {
?article schema:about ?item;
schema:isPartOf <https://en.wikipedia.org/>;
schema:name ?page_titleEN.
?item rdfs:label ?LabelEN.
FILTER((LANG(?LabelEN)) = "en")
}
OPTIONAL { ?item wdt:P18 ?image. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?item ?itemLabel ?itemDescription ?billions ?locationLabel ?picture ?page_titleEN
ORDER BY DESC(?billions)
Asked
Active
Viewed 44 times
0

underscore_d
- 6,309
- 3
- 38
- 64
-
Do I need to use some other function? I want to pick the maximum of the net worth of billionaires – Bipasha Parashar Sep 04 '20 at 08:54
-
Show sample query output and explain what you think is wrong. – underscore_d Sep 04 '20 at 08:59
-
I guess he refers to the fact, that e.g. Bill Gates has an entry of 96,5 billion but in the result only the second highest with 86 is shown – UninformedUser Sep 04 '20 at 09:05
-
It's just a matter of [truthy statements](https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format#Truthy_statements). Do `?item p:P2218/ps:P2218 ?worth.` and you're done. – UninformedUser Sep 04 '20 at 09:09