@Override protected boolean matchesSPARQL(RepositoryConnection con) throws MalformedQueryException, RepositoryException, QueryEvaluationException { final BooleanQuery booleanQuery = con.prepareBooleanQuery(QueryLanguage.SPARQL, query, baseUri); return booleanQuery.evaluate(); }
@Override public boolean getBoolean() { try { return booleanQuery.evaluate(); } catch (QueryEvaluationException e) { throw new RepositoryException(e); } }
@Override protected boolean matchesSPARQL(RepositoryConnection con) throws MalformedQueryException, RepositoryException, QueryEvaluationException { final BooleanQuery booleanQuery = con.prepareBooleanQuery(QueryLanguage.SPARQL, query, baseUri); return booleanQuery.evaluate(); }
/** * "ASK" query with an empty KB. */ public void test_ASK() throws Exception { final String queryStr = "ASK where {?s ?p ?o}"; final BooleanQuery query = cxn.prepareBooleanQuery(QueryLanguage.SPARQL, queryStr); assertEquals(false, query.evaluate()); }
private void query(BooleanQuery query, BooleanQueryResultWriter writer) throws QueryEvaluationException { try { writer.handleBoolean(query.evaluate()); } catch (QueryResultHandlerException e) { throw new QueryEvaluationException("error while writing query boolean result: ",e); } }
private void query(BooleanQuery query, BooleanQueryResultWriter writer) throws QueryEvaluationException { try { writer.handleBoolean(query.evaluate()); } catch (QueryResultHandlerException e) { throw new QueryEvaluationException("error while writing query boolean result: ",e); } }
public void test1000() throws Exception { populate(1000); String sparql = "ASK { <urn:test:root> <urn:test:hasChild>* <urn:test:node-end> }"; assertTrue(con.prepareBooleanQuery(QueryLanguage.SPARQL, sparql).evaluate()); }
public void test100000() throws Exception { populate(100000); String sparql = "ASK { <urn:test:root> <urn:test:hasChild>* <urn:test:node-end> }"; assertTrue(con.prepareBooleanQuery(QueryLanguage.SPARQL, sparql).evaluate()); }
public void test10000() throws Exception { populate(10000); String sparql = "ASK { <urn:test:root> <urn:test:hasChild>* <urn:test:node-end> }"; assertTrue(con.prepareBooleanQuery(QueryLanguage.SPARQL, sparql).evaluate()); }
public void test10() throws Exception { populate(10); String sparql = "ASK { <urn:test:root> <urn:test:hasChild>* <urn:test:node-end> }"; assertTrue(con.prepareBooleanQuery(QueryLanguage.SPARQL, sparql).evaluate()); }
public void test100() throws Exception { populate(100); String sparql = "ASK { <urn:test:root> <urn:test:hasChild>* <urn:test:node-end> }"; assertTrue(con.prepareBooleanQuery(QueryLanguage.SPARQL, sparql).evaluate()); }
public boolean asBoolean() throws OpenRDFException { if (query.isBooleanQuery()) return prepareBooleanQuery().evaluate(); return asResult(Boolean.class).singleResult().booleanValue(); }
@Override public boolean sparqlAsk(String queryString) throws ModelRuntimeException { this.assertModel(); BooleanQuery booleanQuery; try { booleanQuery = this.connection.prepareBooleanQuery(QueryLanguage.SPARQL, queryString); boolean result = booleanQuery.evaluate(); return result; } catch(OpenRDFException e) { throw new ModelRuntimeException(e); } }
@Override public boolean sparqlAsk(String queryString) throws ModelRuntimeException { this.assertModel(); BooleanQuery booleanQuery; try { booleanQuery = this.connection.prepareBooleanQuery( QueryLanguage.SPARQL, queryString); boolean result = booleanQuery.evaluate(); return result; } catch (OpenRDFException e) { throw new ModelRuntimeException(e); } }
/** * "ASK" query with an empty KB. */ public void test_ASK() throws Exception { final String queryStr = "ASK where {?s ?p ?o}"; final BooleanQuery query = cxn.prepareBooleanQuery(QueryLanguage.SPARQL, queryStr); assertEquals(false, query.evaluate()); }
public void test1000() throws Exception { populate(1000); String sparql = "ASK { <urn:test:root> <urn:test:hasChild>* <urn:test:node-end> }"; assertTrue(con.prepareBooleanQuery(QueryLanguage.SPARQL, sparql).evaluate()); }
public void test100000() throws Exception { populate(100000); String sparql = "ASK { <urn:test:root> <urn:test:hasChild>* <urn:test:node-end> }"; assertTrue(con.prepareBooleanQuery(QueryLanguage.SPARQL, sparql).evaluate()); }
public void test10() throws Exception { populate(10); String sparql = "ASK { <urn:test:root> <urn:test:hasChild>* <urn:test:node-end> }"; assertTrue(con.prepareBooleanQuery(QueryLanguage.SPARQL, sparql).evaluate()); }
public void test100() throws Exception { populate(100); String sparql = "ASK { <urn:test:root> <urn:test:hasChild>* <urn:test:node-end> }"; assertTrue(con.prepareBooleanQuery(QueryLanguage.SPARQL, sparql).evaluate()); }
public void test10000() throws Exception { populate(10000); String sparql = "ASK { <urn:test:root> <urn:test:hasChild>* <urn:test:node-end> }"; assertTrue(con.prepareBooleanQuery(QueryLanguage.SPARQL, sparql).evaluate()); }