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 %} filter (strstarts(str(?property), "http://www.wikidata.org/prop/direct/P") ) ?item ?property ?object . } group by ?property ?object ?objectLabel