Added group by into sparql queries to avoid duplicates