use of org.apache.jena.sparql.sse.SSE_ParseException in project jena by apache.
the class QueryUtils method checkOp.
public static void checkOp(Query query, boolean optimizeAlgebra) {
IndentedLineBuffer buff = new IndentedLineBuffer();
Op op = Algebra.compile(query);
if (optimizeAlgebra)
op = Algebra.optimize(op);
WriterSSE.out(buff, op, query);
String str = buff.toString();
try {
Op op2 = SSE.parseOp(str);
if (op.hashCode() != op2.hashCode()) {
op.hashCode();
op2.hashCode();
dump(op, op2);
throw new QueryCheckException("reparsed algebra expression hashCode does not equal algebra from query");
}
if (!op.equals(op2)) {
dump(op, op2);
throw new QueryCheckException("reparsed algebra expression does not equal query algebra");
}
} catch (SSE_ParseException | SSE_BuildException ex) {
throw ex;
}
}
Aggregations