query: SELECT ?grouping (COUNT(DISTINCT ?entity) as ?count) (SAMPLE(?entity) as ?sample) WHERE { ?entity wdt:P734 ?fam . VALUES ?fam { wd:Q1158446 wd:Q1605060 wd:Q59853 wd:Q1688722 wd:Q15080511 wd:Q13421990 wd:Q1177810 wd:Q1260663 wd:Q1645480 wd:Q1158485 }. ?entity wdt:P734 ?grouping .} GROUP BY ?grouping HAVING (?count < 2000) ORDER BY DESC(?count) LIMIT 1000