query: SELECT   ?item 
           ?itemLabel
           (replace(group_concat(distinct ?type;separator="; "), "http://www.wikidata.org/entity/", "") as ?types)  #Strip the path in order to get only the Q-number.
           (group_concat(distinct ?typeLabel_en;separator="; ") as ?typeLabels_en)
  WHERE 
  {
    ?item wdt:P31/wdt:P279* wd:Q24354.
    ?item wdt:P31 ?type.
    ?item wdt:P3820 ?value.
    OPTIONAL { ?item wdt:P31/rdfs:label ?typeLabel_en . FILTER (lang(?typeLabel_en) = "en") }
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  }
  group by ?item                          #List all the variables for which the values are not concatenated!
           ?itemLabel
  order by desc (COUNT(?type))