query: SELECT ?item ?yr  ?sitelinks2 WHERE { { SELECT ?yr (MAX(?count) As ?sitelinks2) WHERE { SELECT ?item2 ?yr (COUNT(distinct ?sitelink) as ?count) WHERE { VALUES ?filmtype {wd:Q11424 wd:Q24862 wd:Q20667187 wd:Q226730} . ?item2 wdt:P31 ?filmtype . ?sitelink <http://schema.org/about> ?item2 . ?item2 wdt:P577 ?released BIND(YEAR(?released) As ?yr) }  GROUP BY ?item2 ?yr HAVING (?count>10) ORDER BY DESC(?count) LIMIT 10000 } GROUP BY ?yr ORDER BY ?yr DESC(?count) LIMIT 150} {SELECT ?item ?yr2 (COUNT(distinct ?sitelink) as ?count2) WHERE { VALUES ?filmtype {wd:Q11424 wd:Q24862 wd:Q20667187 wd:Q226730} . ?item wdt:P31 ?filmtype . ?sitelink <http://schema.org/about> ?item . ?item wdt:P577 ?released BIND(YEAR(?released) As ?yr2) } GROUP BY ?item ?yr2 HAVING (?count2>10) ORDER BY DESC(?count2) LIMIT 10000  } FILTER(?count2 = ?sitelinks2) FILTER(?yr = ?yr2) } ORDER BY ?yr ?item