public static void fmtSPARQL(IndentedWriter iOut, ExprList exprs) { fmtSPARQL(iOut, exprs, FmtUtils.sCxt()) ; }
public static void fmtSPARQL(IndentedWriter iOut, Expr expr) { fmtSPARQL(iOut, expr, FmtUtils.sCxt()) ; }
public static String fmtSPARQL(Expr expr) { IndentedLineBuffer buff = new IndentedLineBuffer() ; fmtSPARQL(buff, expr) ; return buff.toString() ; }
public static String fmtSPARQL(ExprList exprs) { IndentedLineBuffer buff = new IndentedLineBuffer() ; fmtSPARQL(buff, exprs) ; return buff.toString() ; }
public static String fmtSPARQL(ExprList exprs, SerializationContext sCxt) { IndentedLineBuffer buff = new IndentedLineBuffer() ; fmtSPARQL(buff, exprs, sCxt) ; return buff.toString() ; }
@Override protected void details(IndentedWriter out, SerializationContext cxt) { out.print(Lib.className(this)) ; out.print(" ") ; ExprUtils.fmtSPARQL(out, expr, cxt) ; }
@Override public String asSparqlExpr(SerializationContext sCxt) { IndentedLineBuffer x = new IndentedLineBuffer() ; x.append(getName()) ; x.append("(") ; if ( isDistinct ) x.append("DISTINCT ") ; if ( getExprList() != null ) ExprUtils.fmtSPARQL(x, getExprList(), sCxt) ; x.append(")") ; return x.asString() ; }
ByteArrayOutputStream bos = new ByteArrayOutputStream(); IndentedWriter iOut = new IndentedWriter(bos); ExprUtils.fmtSPARQL(iOut, expr, new SerializationContext(model)); iOut.flush(); sb.append(bos.toString());
ByteArrayOutputStream bos = new ByteArrayOutputStream(); IndentedWriter iOut = new IndentedWriter(bos); ExprUtils.fmtSPARQL(iOut, expr, new SerializationContext(model)); iOut.flush(); sb.append(bos.toString());
protected static String asSparqlExpr(boolean isDistinct, String separator, ExprList exprs, SerializationContext sCxt) { IndentedLineBuffer x = new IndentedLineBuffer() ; x.append("GROUP_CONCAT(") ; if ( isDistinct ) x.append("DISTINCT ") ; ExprUtils.fmtSPARQL(x, exprs, sCxt) ; if ( separator != null ) { x.append(" ; separator=") ; String y = StrUtils.escapeString(separator) ; x.append("'") ; x.append(y) ; x.append("'") ; } x.append(")") ; return x.asString() ; }
@Override public String asSparqlExpr(SerializationContext sCxt) { IndentedLineBuffer x = new IndentedLineBuffer(); if ( !AggregateRegistry.isRegistered(iri) ) { // If not registered and if parsed in again not registered, it becomes a // function. // AGG <iri>(...) syntax. It can't have been legal SPARQL 1.1 unless it got // unregistered in which case all bets are off anyway. x.append(getName()); x.append(" "); } String uriStr = FmtUtils.stringForURI(iri, sCxt) ; x.append(uriStr) ; x.append("("); if ( isDistinct ) x.append("DISTINCT "); x.incIndent(); ExprUtils.fmtSPARQL(x, getExprList(), sCxt); x.decIndent(); x.append(")"); return x.asString(); }
ExprUtils.fmtSPARQL(iOut, expr); iOut.ensureStartOfLine();
ExprUtils.fmtSPARQL(iOut, expr); iOut.ensureStartOfLine();