SPARQL { public static boolean isEndpointAlive(final String endpoint) { QueryExecutionFactory qef = new QueryExecutionFactoryHttp(endpoint); try { QueryExecution qe = qef.createQueryExecution("PREFIX foaf: <http: qe.execAsk(); return true; } catch (Exception e) { } finally { closeExecFactory(qef); } return false; } SPARQL();  SPARQL(final String endpoint); Set<RDFNode> sparql(final String query); static Set<String> extractAnswerStrings(final Set<RDFNode> answers); static Results executeSelect(final String query, final String endpoint); static Boolean executeAsk(final String query, final String endpoint); long getCacheTimeToLive(); void setCacheTimeToLive(final long timeToLive); static boolean isValidSparqlQuery(final String sparql); static boolean isEndpointAlive(final String endpoint); public QueryExecutionFactory qef; }
@Test public void testEndpointAlive() { assertTrue(SPARQL.isEndpointAlive("http: assertFalse(SPARQL.isEndpointAlive("http: }