LATC/24-7-platform — Issue #29: sparql endpoint exception handling
Author: nurainir
Created: 2012-01-27 10:36:16+00:00
State: open

public static boolean connection (String endpoint)
{
boolean up=false;

Query query = QueryFactory.create("ASK { }");
System.out.println("ASK "+endpoint);
QueryExecution qe = QueryExecutionFactory.sparqlService(endpoint, query);
try {
if (qe.execAsk()) {
up=true;
}
} catch (ResultSetException e) {
up=false;
} finally {
qe.close();
} // end try/catch/finally
return up;
}