query-a4d6e474f1708f11c374298c372fcd3a
A derived query is interesting. It’s intended to find the instance incomplete classes we short miss of knowing all the instances :
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
select (count(distinct ?instances) as ?count) ?class ?number_of_instances (?number_of_instances - ?count as ?missingnumber) {
?instances wdt:P31/wdt:P279* ?class .
?class wdt:P1114 ?number_of_instances .
} group by ?class ?number_of_instances having (?number_of_instances != ?count) order by ?missingnumber
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?class"):::projected
v6("?count"):::projected
v4("?instances"):::projected
v6("?missingnumber")
v2("?number_of_instances"):::projected
a1((" "))
f0[["?number_of_instances != ?count"]]
f0 --> v2
f0 --> v6
v4 --"wdt:P31"--> a1
a1 --"wdt:P279"--> v5
v5 --"wdt:P1114"--> v2
bind2[/"count(?instances)"/]
v4 --o bind2
bind2 --as--o v6
bind3[/"?number_of_instances - ?count"/]
v2 --o bind3
v6 --o bind3
bind3 --as--o v6