select ?property ?object ?objectLabel (count(*) as ?count) { SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } VALUES ?isa { {% for isa in isa_list %} wd:{{ isa }} {% endfor %} } ?item wdt:P31 ?isa . ?item wdt:P18 ?image . {% for pid, qid in params %} ?item wdt:{{pid}} wd:{{qid}} . {% endfor %} values ?property { {% for pid in properties %} wdt:{{pid}}{% endfor %} } ?item ?property ?object . } group by ?property ?propertyLabel ?object ?objectLabel