Added support for sparql and fixed bug