MarkLogicBooleanQuery extends MarkLogicQuery implements BooleanQuery,MarkLogicQueryDependent { @Override public boolean evaluate() throws QueryEvaluationException { try { sync(); return getMarkLogicClient().sendBooleanQuery(getQueryString(), getBindings(), getIncludeInferred(),getBaseURI()); }catch (RepositoryException e) { throw new QueryEvaluationException(e.getMessage(), e); }catch (MalformedQueryException e) { throw new QueryEvaluationException(e.getMessage(), e); }catch (IOException e) { throw new QueryEvaluationException(e.getMessage(), e); }catch(FailedRequestException e){ throw new QueryEvaluationException(e.getMessage(), e); } } MarkLogicBooleanQuery(MarkLogicClient client, SPARQLQueryBindingSet bindingSet, String baseUri, String queryString, GraphPermissions graphPerms, QueryDefinition queryDef, SPARQLRuleset[] rulesets); @Override boolean evaluate();  }
@Test public void testBooleanQuery() throws Exception { String queryString = "ASK {GRAPH <http: BooleanQuery booleanQuery = conn.prepareBooleanQuery(QueryLanguage.SPARQL, queryString); boolean results = booleanQuery.evaluate(); Assert.assertEquals(false, results); queryString = "ASK {GRAPH <http: booleanQuery = conn.prepareBooleanQuery(QueryLanguage.SPARQL, queryString); results = booleanQuery.evaluate(); Assert.assertEquals(true, results); }
@Test public void testBooleanQueryWithOverloadedMethods() throws Exception { String queryString = "ASK { <http: BooleanQuery booleanQuery = conn.prepareBooleanQuery(queryString); booleanQuery = conn.prepareBooleanQuery(queryString,"http: boolean results = booleanQuery.evaluate(); Assert.assertEquals(false, results); queryString = "ASK { <http: booleanQuery = conn.prepareBooleanQuery(QueryLanguage.SPARQL, queryString); results = booleanQuery.evaluate(); Assert.assertEquals(true, results); }
@Test(expected=org.openrdf.query.QueryEvaluationException.class) public void testBooleanQueryQueryEvaluationException() throws Exception { String queryString = "ASK GRAPH <http: BooleanQuery booleanQuery = conn.prepareBooleanQuery(QueryLanguage.SPARQL, queryString); boolean results = booleanQuery.evaluate(); }
@Test(expected=org.openrdf.query.QueryEvaluationException.class) public void testBooleanQueryMalformedException() throws Exception { String queryString = "ASK1 GRAPH <http: BooleanQuery booleanQuery = conn.prepareBooleanQuery(QueryLanguage.SPARQL, queryString); boolean results = booleanQuery.evaluate(); }
@Test public void testBooleanQueryWithOptimizeLevel() throws Exception { String queryString = "ASK {GRAPH <http: conn.setOptimizeLevel(0); BooleanQuery booleanQuery = conn.prepareBooleanQuery(QueryLanguage.SPARQL, queryString); boolean results = booleanQuery.evaluate(); Assert.assertEquals(false, results); conn.setOptimizeLevel(null); }
@Test(expected=org.eclipse.rdf4j.query.QueryEvaluationException.class) public void testBooleanQueryQueryEvaluationException() throws Exception { String queryString = "ASK GRAPH <http: BooleanQuery booleanQuery = conn.prepareBooleanQuery(QueryLanguage.SPARQL, queryString); boolean results = booleanQuery.evaluate(); }
@Test(expected=org.eclipse.rdf4j.query.QueryEvaluationException.class) public void testBooleanQueryMalformedException() throws Exception { String queryString = "ASK1 GRAPH <http: BooleanQuery booleanQuery = conn.prepareBooleanQuery(QueryLanguage.SPARQL, queryString); boolean results = booleanQuery.evaluate(); }