query: SELECT
    (wd:Q2481549 as ?item) 
    ("pie" as ?type)
    ("100" as ?height) 
    ("100" as ?width) 
    ("identifiers" as ?legend) 
    ("fontsize:10,offset:10,angle:0" as ?showValues)
    (GROUP_CONCAT(?group;separator=",") as ?x)
    (GROUP_CONCAT(?count;separator=",") as ?y)
  WHERE
  {
    { SELECT ?group (COUNT(DISTINCT ?p) as ?count)
  {
      ?p wdt:P1343 wd:Q665807 .
      ?p wikibase:identifiers ?st .
      ?p wdt:P31 wd:Q5 .
      BIND(
           IF(?st = 0 , " 0" , 
           IF(?st = 1 , " 1" , 
           IF(?st = 2 , " 2" , 
           IF(?st = 3 , " 3" , 
           IF(?st < 7 , " 4-6" , 
           IF(?st < 10 , " 7-9" , 
           IF(?st < 20 , "10-19" , 
           IF(?st < 50 , "20-49" , "50+"
          ) ) ) ) ) ) ) ) as ?group)
  }
  GROUP BY ?group
  ORDER BY DESC(?group)  
   }
  }