boolean result = getResult(graph, queryEngine);
return new AskAnswerImpl(System.currentTimeMillis() - timeStarted, result);
}
private boolean getResult(Graph graph, QueryEngine queryEngine) {
EvaluatedRelation entireGraph = graphRelationFactory.createRelation(graph);
queryEngine.initialiseBaseRelation(entireGraph);
ExpressionSimplifier<Void> simplifier = new ExpressionSimplifierImpl();
expression.accept(simplifier);
expression = simplifier.getExpression();
if (simplifier.parseAgain()) {
expression.accept(simplifier);
expression = simplifier.getExpression();
}
EvaluatedRelation relation = expression.accept(queryEngine);
return !relation.isEmpty();
}