query-54edff5787cdf62d52d0d4cba65bd56c
Top botanists by number of things named after them
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 ?b ?q ?qLabel (count(?t) AS ?taxa) (count(?o) AS ?other) WHERE {
?q wdt:P428 ?b.
?s wdt:P138 ?q
{?s wdt:P31 wd:Q16521. BIND(1 AS ?t) } UNION { BIND(1 AS ?o). MINUS {?s wdt:P31 wd:Q16521} }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
} GROUP BY ?b ?q ?qLabel
ORDER BY DESC(?taxa + ?other)
LIMIT 10
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?b"):::projected
v7("?o"):::projected
v8("?other")
v3("?q"):::projected
v5("?s")
v6("?t"):::projected
v8("?taxa")
c6(["bd:serviceParam"]):::iri
c8(["en"]):::literal
c4(["wd:Q16521"]):::iri
v3 --"wdt:P428"--> v4
v5 --"wdt:P138"--> v3
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
bind0[/"'1^^xsd:integer'"/]
bind0 --as--o v7
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v5 --"wdt:P31"--> c4
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v5 --"wdt:P31"--> c4
bind2[/"'1^^xsd:integer'"/]
bind2 --as--o v6
end
union0r <== or ==> union0l
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end
bind5[/"count(?t)"/]
v6 --o bind5
bind5 --as--o v8
bind6[/"count(?o)"/]
v7 --o bind6
bind6 --as--o v8