@Test public void Handle() { List<UID> predicates = new ArrayList<UID>(10); for (int i = 0; i < 10; i++) { predicates.add(new UID(TEST.NS, "pred" + i)); } List<STMT> stmts = new ArrayList<STMT>(140); for (int i = 0; i < 14; i++) { ID sub = new UID(TEST.NS, "e" + UUID.randomUUID()); stmts.add(new STMT(sub, predicates.get(0), new LIT(UUID.randomUUID().toString()))); stmts.add(new STMT(sub, predicates.get(1), new LIT("1", XSD.intType))); stmts.add(new STMT(sub, predicates.get(2), sub)); stmts.add(new STMT(sub, predicates.get(3), new BID())); stmts.add(new STMT(sub, predicates.get(4), new LIT(UUID.randomUUID().toString()))); stmts.add(new STMT(sub, predicates.get(5), new LIT("2", XSD.intType))); stmts.add(new STMT(sub, predicates.get(6), sub)); stmts.add(new STMT(sub, predicates.get(7), new BID())); stmts.add(new STMT(sub, predicates.get(8), new LIT(UUID.randomUUID().toString()))); stmts.add(new STMT(sub, predicates.get(9), new LIT("3", XSD.intType))); } writer.begin(); for (STMT stmt : stmts) { writer.handle(stmt); } writer.end(); System.out.println(writer.toString()); String str = writer.toString(); assertTrue(str.contains(" ; ns1:pred1")); assertTrue(str.contains("@prefix ns1: <http: assertTrue(str.contains("@prefix xsd: <http: assertTrue(str.contains("\"3\"^^xsd:int")); }
@Override public String toString() { ((StringBuilder) appendable).insert(0, prefixesString.toString()); prefixesString.setLength(0); return appendable.toString(); }
TurtleStringWriter extends TurtleWriter { @Override public String toString() { ((StringBuilder) appendable).insert(0, prefixesString.toString()); prefixesString.setLength(0); return appendable.toString(); } }
TurtleStringWriter extends TurtleWriter { @Override public String toString() { ((StringBuilder) appendable).insert(0, prefixesString.toString()); prefixesString.setLength(0); return appendable.toString(); } TurtleStringWriter();  TurtleStringWriter(boolean blankNodeAsURI); }
TurtleStringWriter extends TurtleWriter { @Override public String toString() { ((StringBuilder) appendable).insert(0, prefixesString.toString()); prefixesString.setLength(0); return appendable.toString(); } TurtleStringWriter();  TurtleStringWriter(boolean blankNodeAsURI); @Override String toString(); }
TurtleStringWriter extends TurtleWriter { @Override public String toString() { ((StringBuilder) appendable).insert(0, prefixesString.toString()); prefixesString.setLength(0); return appendable.toString(); } TurtleStringWriter();  TurtleStringWriter(boolean blankNodeAsURI); @Override String toString();  }