FmtUtils { public static String stringForQuad(Quad quad, PrefixMapping prefixMap) { return stringForQuad(quad, sCxt(prefixMap)) ; }  static SerializationContext sCxt(); static SerializationContext sCxt(PrefixMapping pmap); static String stringForTriple( Triple triple ); static String stringForTriple(Triple triple, PrefixMapping prefixMap); static String stringForTriple(Triple triple, SerializationContext sCxt); static void stringForTriple(StringBuilder result, Triple triple, SerializationContext sCxt); static String stringForQuad(Quad quad, PrefixMapping prefixMap); static String stringForQuad(Quad quad); static String stringForQuad(Quad quad, SerializationContext sCxt); static void stringForQuad(StringBuilder sb, Quad quad, SerializationContext sCxt); static void formatPattern(IndentedWriter out, BasicPattern pattern, SerializationContext sCxt); static String stringForObject(Object obj); static String stringForRDFNode(RDFNode obj); static String stringForRDFNode(RDFNode obj, SerializationContext context); static String stringForLiteral(Node_Literal literal, SerializationContext context); static void stringForLiteral(StringBuilder result, Node_Literal literal, SerializationContext context); static String stringForString(String str); static String stringForResource(Resource r); static String stringForResource(Resource r, SerializationContext context); static String stringForNode(Node n); static void stringForNode(StringBuilder result, Node n); static String stringForNode(Node n, PrefixMapping prefixMap); static void stringForNode(StringBuilder result, Node n, PrefixMapping prefixMap); static String stringForNode(Node n, Prologue prologue); static String stringForNode(Node n, SerializationContext context); static void stringForNode(StringBuilder result, Node n, SerializationContext context); static String stringForURI(String uri); static void stringForURI(StringBuilder target, String uri); static String stringForURI(String uri, Prologue prologue); static String stringForURI(String uri, String baseIRI); static String stringForURI(String uri, SerializationContext context); static void stringForURI(StringBuilder result, String uri, SerializationContext context); static String stringForURI(String uri, PrefixMapping mapping); static String stringForURI(String uri, String base, PrefixMapping mapping); static void stringForURI(StringBuilder result, String uri, String base, PrefixMapping mapping); static String abbrevByBase(String uri, String base); static String stringEsc(String s); static String stringEsc(String s, boolean singleLineString); static void stringEsc(StringBuilder sbuff, String s); static void stringEsc(StringBuilder sbuff, String s, boolean singleLineString); static void resetBNodeLabels(); static boolean multiLineExpr; static boolean printOpName; }
@Test public void stringForQuadEncoding() { Node n1 = NodeFactory.createURI("q1") ; Quad quad = new Quad(n1, getTriple()) ; assertEquals("<q1> <n1> <n2> \"l3\"", stringForQuad(quad)) ; }
@Test public void stringForQuad_WithPrefixMapping() { Node n1 = NodeFactory.createURI("q1") ; Quad quad = new Quad(n1, getPrefixedTriple()) ; assertEquals("<q1> zz:abs <n2> \"l3\"", stringForQuad(quad, getPrefixMapping())) ; }