@Override public Sink<Triple> createSerializer(OutputStream out) { return new SinkTripleOutput(out, null, NodeToLabel.createBNodeByLabelEncoded()) ; }
@Override public Sink<Quad> createSerializer(OutputStream out) { return new SinkQuadOutput(out, null, NodeToLabel.createBNodeByLabelEncoded()) ; }
/** Allocation as per internal label */ public static NodeToLabel createBNodeByIRI() { return new NodeToLabel(new SingleScopePolicy(), new AllocatorBNodeAsIRI()) ; }
public static void serialize(IndentedWriter w, Node n, String base, PrefixMap prefixMap) { NodeFormatter formatter ; if ( base == null && prefixMap == null ) formatter = plainFormatter ; else formatter = new NodeFormatterTTL(base, prefixMap) ; formatter.format(w, n) ; }
private static void test(Node node, String output) { String x = NodeFmtLib.str(node) ; assertEquals(output, x) ; }
public static void serialize(IndentedWriter w, Node n, String base, PrefixMap prefixMap) { if ( prefixMap == null ) prefixMap = dftPrefixMap ; NodeFormatter formatter = new NodeFormatterTTL(base, prefixMap) ; formatter.format(w, n) ; }
private static void testDisplay(Node node, String output) { String x = NodeFmtLib.displayStr(node) ; assertEquals(output, x) ; }
private void testPrefix(String prefix, String local) { assertTrue(NodeFormatterTTL.safeForPrefix(prefix)) ; assertTrue(NodeFormatterTTL.safeForPrefixLocalname(local)) ; }
private void testencdec(String input) { String x = NodeFmtLib.encodeBNodeLabel(input) ; String y = NodeFmtLib.decodeBNodeLabel(x) ; assertEquals(input, y) ; }
/** Allocation from a single scope; just the label matters. */ static public NodeToLabel createScopeByDocument() { return new NodeToLabel(new SingleScopePolicy(), new AllocatorIncLabel()) ; }
/** Allocation as per internal label, with an encoded safe label. */ public static NodeToLabel createBNodeByLabelEncoded() { return new NodeToLabel(new SingleScopePolicy(), new AllocatorInternalSafe()) ; }
/** Allocation as per internal label */ public static NodeToLabel createBNodeByLabelAsGiven() { return new NodeToLabel(new SingleScopePolicy(), new AllocatorInternalRaw()) ; }
static public NodeFormatter createNodeFormatter(PrefixMap pmap, String baseURI, Context context) { if ( context != null && context.isTrue(RIOT.multilineLiterals) ) return new NodeFormatterTTL_MultiLine(baseURI, pmap, NodeToLabel.createScopeByDocument()) ; else return new NodeFormatterTTL(baseURI, pmap, NodeToLabel.createScopeByDocument()) ; }
/** * Creates a new writer using the given character space * * @param writer * Writer * @param charSpace * Character space */ public NTriplesWriter(Writer writer, CharSpace charSpace) { super(writer, new NodeFormatterNT(charSpace)); } }
private void testenc(String input, String expected) { String x = NodeFmtLib.encodeBNodeLabel(input) ; assertEquals(expected, x) ; }
@Override public Sink<Triple> createSerializer(OutputStream out) { return new SinkTripleOutput(out, null, NodeToLabel.createBNodeByLabelEncoded()) ; }
@Override public Sink<Quad> createSerializer(OutputStream out) { return new SinkQuadOutput(out, null, NodeToLabel.createBNodeByLabelEncoded()) ; }
/** * Creates a new writer using the default NTriples node formatter * * @param writer * Writer */ public AbstractLineBasedQuadWriter(Writer writer) { this(writer, new NodeFormatterNT()); }
/** * Creates a new tuple writer using the default NTriples node formatter * * @param writer * Writer */ public AbstractNodeWriter(Writer writer) { this(writer, new NodeFormatterNT()); }
/** * Creates a new writer using the default NTriples node formatter * * @param writer * Writer */ public AbstractLineBasedTripleWriter(Writer writer) { this(writer, new NodeFormatterNT()); }