repaired sparql query and added more interface functions