changed sparql query to handle literals