use of org.apache.jena.sparql.algebra.Op in project jena by apache.
the class sse_query method exec.
@Override
protected void exec() {
Op op = modAlgebra.getOp();
if (op == null) {
System.err.println("No query expression to execute");
throw new TerminationException(9);
}
Dataset dataset = modDataset.getDataset();
// Check there is a dataset.
if (dataset == null)
dataset = DatasetFactory.createGeneral();
modTime.startTimer();
DatasetGraph dsg = dataset.asDatasetGraph();
if (printOp || printPlan) {
if (printOp) {
divider();
IndentedWriter out = new IndentedWriter(System.out, true);
op.output(out);
out.flush();
}
if (printPlan) {
QueryIterator qIter = Algebra.exec(op, dsg);
Plan plan = new PlanOp(op, null, qIter);
divider();
IndentedWriter out = new IndentedWriter(System.out, false);
plan.output(out);
out.flush();
}
//return ;
}
// Do not optimize. Execute as-is.
QueryExecUtils.execute(op, dsg, modResults.getResultsFormat());
long time = modTime.endTimer();
if (modTime.timingEnabled())
System.out.println("Time: " + modTime.timeStr(time));
}
use of org.apache.jena.sparql.algebra.Op in project jena by apache.
the class QueryValidatorHTML method outputAlgebra.
private static void outputAlgebra(ServletOutputStream outStream, final Query query, boolean lineNumbers) throws IOException {
outStream.println("<p>Algebra structure:</p>");
// No optimization
final Op op = Algebra.compile(query);
outputQueryOp(outStream, query, op, lineNumbers);
}
use of org.apache.jena.sparql.algebra.Op in project jena by apache.
the class QueryValidatorHTML method outputAlgebraOpt.
private static void outputAlgebraOpt(ServletOutputStream outStream, final Query query, boolean lineNumbers) throws IOException {
outStream.println("<p>Alebgra, with general triple optimizations:</p>");
final Op op = Algebra.optimize(Algebra.compile(query));
outputQueryOp(outStream, query, op, lineNumbers);
}
use of org.apache.jena.sparql.algebra.Op in project jena by apache.
the class QueryValidatorHTML method outputAlgebraQuads.
private static void outputAlgebraQuads(ServletOutputStream outStream, final Query query, boolean lineNumbers) throws IOException {
outStream.println("<p>Quad structure:</p>");
final Op op = Algebra.toQuadForm(Algebra.compile(query));
outputQueryOp(outStream, query, op, lineNumbers);
}
use of org.apache.jena.sparql.algebra.Op in project jena by apache.
the class QueryValidatorJSON method algebraQuads.
private static void algebraQuads(JsonBuilder obj, Query query) {
Op op = Algebra.compile(query);
op = Algebra.toQuadForm(op);
obj.key(jAlgebraQuads).value(string(query, op));
}
Aggregations