public static String str(Node n) { IndentedLineBuffer sw = new IndentedLineBuffer() ; str(sw, n) ; return sw.toString() ; }
public static String fmtSPARQL(ExprList exprs) { IndentedLineBuffer buff = new IndentedLineBuffer() ; fmtSPARQL(buff, exprs) ; return buff.toString() ; }
/** Convert the query to a string in the given syntax * @param syntax */ public String serialize(Syntax syntax) { IndentedLineBuffer buff = new IndentedLineBuffer() ; serialize(buff, syntax) ; return buff.toString(); }
public static String str(Node n, String base, PrefixMap prefixMap) { IndentedLineBuffer sw = new IndentedLineBuffer() ; serialize(sw, n, base, prefixMap) ; return sw.toString() ; }
public static String toString(Printable f) { IndentedLineBuffer buff = new IndentedLineBuffer() ; f.output(buff) ; return buff.toString() ; } }
public static String fmtSPARQL(Expr expr) { IndentedLineBuffer buff = new IndentedLineBuffer() ; fmtSPARQL(buff, expr) ; return buff.toString() ; }
/** Convert the query to a string */ public String serialize() { IndentedLineBuffer buff = new IndentedLineBuffer() ; serialize(buff) ; return buff.toString(); }
public static String fmtSPARQL(ExprList exprs, SerializationContext sCxt) { IndentedLineBuffer buff = new IndentedLineBuffer() ; fmtSPARQL(buff, exprs, sCxt) ; return buff.toString() ; }
public static String toString(Printable f) { IndentedLineBuffer buff = new IndentedLineBuffer() ; f.output(buff) ; return buff.toString() ; } }
public static String fmtSPARQL(Expr expr) { IndentedLineBuffer buff = new IndentedLineBuffer() ; fmtSPARQL(buff, expr) ; return buff.toString() ; }
public static String toString(PrintSerializable item, PrefixMapping pmap) { IndentedLineBuffer buff = new IndentedLineBuffer() ; SerializationContext sCxt = new SerializationContext(pmap) ; item.output(buff, sCxt) ; return buff.toString() ; }
public static String asString(Template template) { SerializationContext cxt = new SerializationContext() ; IndentedLineBuffer b = new IndentedLineBuffer() ; FmtTemplate.format(b, cxt, template) ; return b.toString() ; }
public static String asString(Element el) { SerializationContext cxt = new SerializationContext(); IndentedLineBuffer b = new IndentedLineBuffer(); FormatterElement.format(b, cxt, el); return b.toString(); }
public static String asSQL(SqlExpr expr) { IndentedLineBuffer buff = new IndentedLineBuffer() ; SqlExprVisitor v = new SqlExprGenerateSQL(buff) ; expr.visit(v) ; return buff.toString() ; }
public static String asString(Element el) { SerializationContext cxt = new SerializationContext() ; IndentedLineBuffer b = new IndentedLineBuffer() ; FormatterElement.format(b, cxt, el) ; return b.toString() ; }
public static String strNodes(Node ... nodes) { IndentedLineBuffer sw = new IndentedLineBuffer() ; boolean first = true ; for ( Node n : nodes ) { if ( ! first ) sw.append(" ") ; first = false ; str(sw, n) ; } return sw.toString() ; }
public static void explain(String message, BasicPattern bgp, Context context) { if ( explaining(InfoLevel.ALL, logExec, context) ) { try (IndentedLineBuffer iBuff = new IndentedLineBuffer()) { if ( MultiLinesForPatterns ) iBuff.incIndent() ; formatTriples(iBuff, bgp) ; iBuff.flush() ; String str = iBuff.toString() ; _explain(logExec, message, str, false) ; } } }
public static void explain(String message, QuadPattern quads, Context context) { if ( explaining(InfoLevel.ALL, logExec, context) ) { try (IndentedLineBuffer iBuff = new IndentedLineBuffer()) { if ( MultiLinesForPatterns ) iBuff.incIndent() ; formatQuads(iBuff, quads) ; iBuff.flush() ; String str = iBuff.toString() ; _explain(logExec, message, str, false) ; } } }
@Test public void testFormatBGP_1() { IndentedLineBuffer b = new IndentedLineBuffer() ; BasicPattern bgp = SSE.parseBGP("(prefix ((zz: <"+aUri+">)) (bgp (zz:s zz:p zz:o)))") ; FmtUtils.formatPattern(b, bgp, getContext()) ; assertEquals("zz:s zz:p zz:o .", b.toString()) ; }
@Test public void testFormatBGP_2() { IndentedLineBuffer b = new IndentedLineBuffer() ; BasicPattern bgp = SSE.parseBGP("(prefix ((zz: <"+aUri+">)) (bgp (zz:s zz:p zz:o) (zz:s zz:p 123) ))") ; FmtUtils.formatPattern(b, bgp, getContext()) ; assertEquals("zz:s zz:p zz:o .\nzz:s zz:p 123 .", b.toString()) ; }