query: #number of animated feature films by country and year
  #defaultView:BarChart
  SELECT (STR(?minDate) AS ?year) (COUNT(DISTINCT(?item)) AS ?itemCount) ?countryLabel
  
  WHERE
  {
    FILTER(BOUND(?minDate))
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
    {
    SELECT DISTINCT ?item (MIN(YEAR(?date)) AS ?minDate) ?country
    WHERE 
    {
      {?item (wdt:P31|wdt:P136)/wdt:P279* wd:Q202866; (wdt:P577|wdt:P2754) ?date; wdt:P495 ?country} UNION
      {?item (wdt:P31|wdt:P136)/wdt:P279* wd:Q1107; (wdt:P577|wdt:P2754) ?date; wdt:P495 ?country}
      
      {?item wdt:P31/wdt:P279* wd:Q24869} UNION
      {?item p:P2047/psn:P2047/wikibase:quantityAmount ?duration.
      MINUS {?item wdt:P31/wdt:P279* wd:Q24869}
      MINUS {?item wdt:P31/wdt:P279* wd:Q24862}
      FILTER(?duration >= 2700)
      }
      
      #excluding film series
      MINUS{?item wdt:P31/wdt:P279* wd:Q24856}
      MINUS{?item wdt:P31/wdt:P279* wd:Q5398426}
      
    }
      GROUP BY ?item ?country
    } 
  }
  GROUP BY ?minDate ?countryLabel