Fix bug in sparql_query