long start = System.currentTimeMillis();
try {
RepositoryConnection connection = sesameService.getConnection();
try {
connection.begin();
Query sparqlQuery = connection.prepareQuery(language, query);
if (sparqlQuery instanceof TupleQuery) {
query((TupleQuery)sparqlQuery, output, format);
} else if (sparqlQuery instanceof BooleanQuery) {
query((BooleanQuery)sparqlQuery, output, format);