}
@Override
public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Join join, BindingSet bindings) throws QueryEvaluationException {
if(Thread.currentThread().isInterrupted()) {
throw new QueryEvaluationException("SPARQL evaluation has already been cancelled");
}
if(isSupported(join)) {
log.debug("applying KiWi JOIN optimizations on SPARQL query ...");
try {
return new ExceptionConvertingIteration<BindingSet, QueryEvaluationException>(connection.evaluateJoin(join, bindings, dataset)) {
@Override
protected QueryEvaluationException convert(Exception e) {
return new QueryEvaluationException(e);
}
};
} catch (SQLException e) {
throw new QueryEvaluationException(e.getMessage(),e);
} catch (IllegalArgumentException e) {
throw new QueryEvaluationException(e.getMessage(),e);
} catch (InterruptedException e) {
throw new QueryInterruptedException(e.getMessage());
}
} else {
return super.evaluate(join, bindings);