query: SELECT ?grouping (COUNT(DISTINCT ?entity) as ?count) (SAMPLE(?entity) as ?sample) WHERE { ?entity wdt:P5008 wd:Q104665671; wdt:P31 wd:Q5  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }. ?entity wdt:P21 ?grouping .} GROUP BY ?grouping HAVING (?count >= 0) ORDER BY DESC(?count) LIMIT 1000