query: SELECT ?item ?yr ?ct WHERE{ {SELECT (YEAR(?year) as ?yr) (COUNT(DISTINCT(?film)) As ?ct) WHERE { VALUES ?filmtype {wd:Q11424 wd:Q24862 wd:Q20667187 wd:Q226730} ?film wdt:P31 ?filmtype . ?film wdt:P364 wd:Q21686005 . ?film wdt:P577 ?year } GROUP BY ?year ORDER BY DESC(?ct) LIMIT 12} ?item wdt:P31 wd:Q577 . ?item wdt:P585 ?pointintime . FILTER (year(?pointintime) = ?yr) } GROUP BY ?yr ?item ?ct ORDER BY DESC(?ct) LIMIT 12