What is the average installed capacity for each energy source considered in 5 year intervals?
SELECT ?rangeId ?energy_sources_labels (AVG(?installed_cap_value AS ?avg_installed_cap_value))
WHERE {
  orkgr:R153801 orkgp:compareContribution ?contrib.
  ?paper orkgp:P31 ?contrib;
         orkgp:P29 ?year.
  BIND(xsd:int(?year) AS ?y).
  VALUES(?rangeId ?min ?max) {
    ("2001-2005" 2001 2005)
    ("2006-2010" 2006 2010)
    ("2011-2015" 2011 2015)
    ("2016-2020" 2016 2020)
  }
  FILTER(?min <= ?y && ?y <= ?max).
  ?contrib orkgp:P43135 ?energy_sources.
  ?energy_sources rdfs:label ?energy_sources_labels;
                  orkgp:P43133 ?installed_capacity.
  ?installed_capacity orkgp:HAS_VALUE ?value.
  BIND(xsd:float(?value) AS ?installed_cap_value).
}
ORDER BY ASC(?rangeId)