added properly handling of sparql queries