sparql count all distinct instances code example Example: sparql count distinct SELECT ?a (count(distinct ?a) as ?count) WHERE { ?a ?b ?c }