Search in sources :

Example 1 with BooleanQuery

use of org.openrdf.query.BooleanQuery in project gocd by gocd.

the class SesameGraph method getBooleanQueryResult.

private boolean getBooleanQueryResult(String sparqlSelect) {
    try {
        BooleanQuery booleanQuery = conn.prepareBooleanQuery(QueryLanguage.SPARQL, sparqlSelect);
        contextualize(booleanQuery);
        return booleanQuery.evaluate();
    } catch (UnsupportedSPARQLStatementException e) {
        throw e;
    } catch (Exception e) {
        throw new ShineRuntimeException(e);
    }
}
Also used : BooleanQuery(org.openrdf.query.BooleanQuery) ShineRuntimeException(com.thoughtworks.studios.shine.ShineRuntimeException) UnsupportedSPARQLStatementException(com.thoughtworks.studios.shine.semweb.UnsupportedSPARQLStatementException) ShineRuntimeException(com.thoughtworks.studios.shine.ShineRuntimeException) RepositoryException(org.openrdf.repository.RepositoryException) TupleQueryResultHandlerException(org.openrdf.query.TupleQueryResultHandlerException) MoreThanOneResultFoundException(com.thoughtworks.studios.shine.semweb.MoreThanOneResultFoundException) MalformedSPARQLException(com.thoughtworks.studios.shine.semweb.MalformedSPARQLException) QueryEvaluationException(org.openrdf.query.QueryEvaluationException) OpenRDFException(org.openrdf.OpenRDFException) NoSuchElementException(java.util.NoSuchElementException) MalformedQueryException(org.openrdf.query.MalformedQueryException) RDFHandlerException(org.openrdf.rio.RDFHandlerException) IOException(java.io.IOException) UnsupportedSPARQLStatementException(com.thoughtworks.studios.shine.semweb.UnsupportedSPARQLStatementException)

Aggregations

ShineRuntimeException (com.thoughtworks.studios.shine.ShineRuntimeException)1 MalformedSPARQLException (com.thoughtworks.studios.shine.semweb.MalformedSPARQLException)1 MoreThanOneResultFoundException (com.thoughtworks.studios.shine.semweb.MoreThanOneResultFoundException)1 UnsupportedSPARQLStatementException (com.thoughtworks.studios.shine.semweb.UnsupportedSPARQLStatementException)1 IOException (java.io.IOException)1 NoSuchElementException (java.util.NoSuchElementException)1 OpenRDFException (org.openrdf.OpenRDFException)1 BooleanQuery (org.openrdf.query.BooleanQuery)1 MalformedQueryException (org.openrdf.query.MalformedQueryException)1 QueryEvaluationException (org.openrdf.query.QueryEvaluationException)1 TupleQueryResultHandlerException (org.openrdf.query.TupleQueryResultHandlerException)1 RepositoryException (org.openrdf.repository.RepositoryException)1 RDFHandlerException (org.openrdf.rio.RDFHandlerException)1