use of org.apache.jena.sparql.serializer.SerializationContext in project jena by apache.
the class QueryOutputUtils method printPlan.
// ModQueryOut
public static void printPlan(Query query, QueryExecution qe) {
QueryEngineFactory f = QueryEngineRegistry.findFactory(query, qe.getDataset().asDatasetGraph(), ARQ.getContext());
if (f == null)
System.err.println("printPlan: Unknown engine type: " + Lib.className(qe));
Plan plan = f.create(query, qe.getDataset().asDatasetGraph(), BindingRoot.create(), ARQ.getContext());
SerializationContext sCxt = new SerializationContext(query);
IndentedWriter out = IndentedWriter.stdout;
plan.output(out, sCxt);
out.flush();
}
use of org.apache.jena.sparql.serializer.SerializationContext in project jena by apache.
the class QueryOutputUtils method toString.
// ---- PrintSerializable
public static String toString(PrintSerializable item, PrefixMapping pmap) {
IndentedLineBuffer buff = new IndentedLineBuffer();
SerializationContext sCxt = new SerializationContext(pmap);
item.output(buff, sCxt);
return buff.toString();
}
use of org.apache.jena.sparql.serializer.SerializationContext in project jena by apache.
the class WriterOp method output.
// Actual work
public static void output(final IndentedWriter iWriter, final Op op, SerializationContext sCxt) {
if (sCxt == null)
sCxt = new SerializationContext();
final SerializationContext sCxt2 = sCxt;
WriterBasePrefix.Fmt fmt = new WriterBasePrefix.Fmt() {
@Override
public void format() {
op.visit(new OpWriterWorker(iWriter, sCxt2));
}
};
WriterBasePrefix.output(iWriter, fmt, sCxt2.getPrologue());
}
use of org.apache.jena.sparql.serializer.SerializationContext in project jena by apache.
the class WriterOp method output.
public static void output(IndentedWriter iWriter, Op op, PrefixMapping pMap) {
if (pMap == null)
pMap = OpPrefixesUsed.used(op, ARQConstants.getGlobalPrefixMap());
SerializationContext sCxt = new SerializationContext(pMap);
output(iWriter, op, sCxt);
}
use of org.apache.jena.sparql.serializer.SerializationContext in project jena by apache.
the class WriterExpr method asString.
public static String asString(Expr expr) {
IndentedLineBuffer b = new IndentedLineBuffer();
output(b, expr, new SerializationContext());
return b.asString();
}
Aggregations