Search in sources :

Example 6 with IndentedWriter

use of org.apache.jena.atlas.io.IndentedWriter in project jena by apache.

the class QueryOutputUtils method printOp.

public static void printOp(Query query, boolean optimize) {
    IndentedWriter out = IndentedWriter.stdout;
    // Flush done
    printOp(out, query, optimize);
}
Also used : IndentedWriter(org.apache.jena.atlas.io.IndentedWriter)

Example 7 with IndentedWriter

use of org.apache.jena.atlas.io.IndentedWriter 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)
        Log.error(QueryOutputUtils.class, "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();
}
Also used : SerializationContext(org.apache.jena.sparql.serializer.SerializationContext) IndentedWriter(org.apache.jena.atlas.io.IndentedWriter) QueryEngineFactory(org.apache.jena.sparql.engine.QueryEngineFactory) Plan(org.apache.jena.sparql.engine.Plan)

Example 8 with IndentedWriter

use of org.apache.jena.atlas.io.IndentedWriter in project jena by apache.

the class shacl_parse method printText.

private boolean printText(PrintStream out, PrintStream err, Shapes shapes) {
    IndentedWriter iOut = new IndentedWriter(out);
    ShLib.printShapes(iOut, shapes);
    iOut.ensureStartOfLine();
    iOut.flush();
    int numShapes = shapes.numShapes();
    int numRootShapes = shapes.numRootShapes();
    if (isVerbose()) {
        System.out.println();
        System.out.println("Target shapes: ");
        shapes.getShapeMap().forEach((n, shape) -> {
            if (shape.hasTarget())
                System.out.println("  " + ShLib.displayStr(shape.getShapeNode()));
        });
        System.out.println("Other Shapes: ");
        shapes.getShapeMap().forEach((n, shape) -> {
            if (!shape.hasTarget())
                System.out.println("  " + ShLib.displayStr(shape.getShapeNode()));
        });
    }
    return true;
}
Also used : IndentedWriter(org.apache.jena.atlas.io.IndentedWriter)

Example 9 with IndentedWriter

use of org.apache.jena.atlas.io.IndentedWriter in project jena by apache.

the class CmdGeneral method usage.

public void usage(PrintStream pStr) {
    IndentedWriter out = new IndentedWriter(pStr);
    out.println(getSummary());
    usage.output(out);
}
Also used : IndentedWriter(org.apache.jena.atlas.io.IndentedWriter)

Example 10 with IndentedWriter

use of org.apache.jena.atlas.io.IndentedWriter in project jena by apache.

the class TurtleWriterBase method write.

@Override
public void write(Writer out, Graph graph, PrefixMap prefixMap, String baseURI, Context context) {
    IndentedWriter iOut = RiotLib.create(out);
    output$(iOut, graph, prefixMap, baseURI, context);
}
Also used : IndentedWriter(org.apache.jena.atlas.io.IndentedWriter)

Aggregations

IndentedWriter (org.apache.jena.atlas.io.IndentedWriter)57 SerializationContext (org.apache.jena.sparql.serializer.SerializationContext)5 TerminationException (org.apache.jena.cmd.TerminationException)4 Node (org.apache.jena.graph.Node)4 PrefixMapping (org.apache.jena.shared.PrefixMapping)4 CmdException (org.apache.jena.cmd.CmdException)3 Triple (org.apache.jena.graph.Triple)3 Syntax (org.apache.jena.query.Syntax)3 IOException (java.io.IOException)2 ServletOutputStream (javax.servlet.ServletOutputStream)2 Pair (org.apache.jena.atlas.lib.Pair)2 RiotException (org.apache.jena.riot.RiotException)2 RiotNotFoundException (org.apache.jena.riot.RiotNotFoundException)2 NodeFormatter (org.apache.jena.riot.out.NodeFormatter)2 NodeFormatterTTL (org.apache.jena.riot.out.NodeFormatterTTL)2 JenaException (org.apache.jena.shared.JenaException)2 ARQException (org.apache.jena.sparql.ARQException)2 Var (org.apache.jena.sparql.core.Var)2 Plan (org.apache.jena.sparql.engine.Plan)2 Expr (org.apache.jena.sparql.expr.Expr)2