Search in sources :

Example 31 with IndentedWriter

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

the class dumpnodetable method dump.

public static void dump(OutputStream w, NodeTable nodeTable) {
    // Better to hack the indexes?
    Iterator<Pair<NodeId, Node>> iter = nodeTable.all();
    long count = 0;
    try (IndentedWriter iw = new IndentedWriter(w)) {
        for (; iter.hasNext(); ) {
            Pair<NodeId, Node> pair = iter.next();
            iw.print(pair.car().toString());
            iw.print(" : ");
            // iw.print(pair.cdr()) ;
            Node n = pair.cdr();
            String $ = stringForNode(n);
            iw.print($);
            iw.println();
            count++;
        }
        iw.println();
        iw.printf("Total: " + count);
        iw.println();
        iw.flush();
    }
}
Also used : IndentedWriter(org.apache.jena.atlas.io.IndentedWriter) Node(org.apache.jena.graph.Node) NodeId(org.apache.jena.tdb.store.NodeId) Pair(org.apache.jena.atlas.lib.Pair)

Example 32 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 33 with IndentedWriter

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

the class QueryValidator method output.

private void output(ServletOutputStream outStream, Query query, final Op op, boolean lineNumbers) throws IOException {
    final SerializationContext sCxt = new SerializationContext(query);
    Content c = new Content() {

        @Override
        public void print(IndentedWriter out) {
            op.output(out, sCxt);
        }
    };
    output(outStream, c, lineNumbers);
}
Also used : SerializationContext(org.apache.jena.sparql.serializer.SerializationContext) IndentedWriter(org.apache.jena.atlas.io.IndentedWriter)

Example 34 with IndentedWriter

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

the class BinRDF method dump.

/** Debug help - print details of a Thrift stream.
     * Destructive on the InputStream. 
     * @param out OutputStream 
     * @param in InputStream
     */
public static void dump(OutputStream out, InputStream in) {
    IndentedWriter iOut = new IndentedWriter(out);
    StreamRowTRDFPrinter printer = new StreamRowTRDFPrinter(iOut);
    TProtocol protocol = TRDF.protocol(in);
    BinRDF.applyVisitor(protocol, printer);
    iOut.flush();
}
Also used : IndentedWriter(org.apache.jena.atlas.io.IndentedWriter) TProtocol(org.apache.thrift.protocol.TProtocol)

Example 35 with IndentedWriter

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

the class DumpOps method dumpBPlusTree.

public static void dumpBPlusTree(PrintStream out, BPlusTree bpt) {
    IndentedWriter iw = new IndentedWriter(out);
    bpt.dump(iw);
}
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