query-18ee4457f541692bbd02af6377f2da9c
List only the highest valueI would like to have this query returning only the highest number of followers for each person:
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 bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?personLabel ?followers
WHERE
{
?person wdt:P106 wd:Q937857 .
?person wdt:P8687 ?followers .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
} GROUP BY ?personLabel ?followers
ORDER BY DESC (?followers)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?followers"):::projected
v2("?person")
c5(["bd:serviceParam"]):::iri
c2(["wd:Q937857"]):::iri
c7(["en"]):::literal
v2 --"wdt:P106"--> c2
v2 --"wdt:P8687"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end