query-2a347ac6d8d26f65cf039de351dfde73
gene (Q7187) uses instance of (P31) differently from rest of Wikidata
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?parent2 (count(?item) as ?number)
WHERE
{
?item wdt:P279 ?parent1 .
?parent1 wdt:P279 ?parent2 .
?item wdt:P31 ?parent2 . # strange relation, avoids ?parent1
}
GROUP BY ?parent2
ORDER BY DESC (?number)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v5("?number")
v3("?parent1")
v4("?parent2"):::projected
v2 --"wdt:P279"--> v3
v3 --"wdt:P279"--> v4
v2 --"wdt:P31"--> v4
bind1[/"count(?item)"/]
v2 --o bind1
bind1 --as--o v5