Closed edwardsph closed 11 months ago
I wouldn't think so as the design goal of this library is stream writing rather than pretty-printing.
I think it would still fit with the design if there was something like addBlank()
.
There are test cases where the blank node and its contents are a subject, or the blank node is a graph: https://github.com/rdfjs/N3.js/blob/075e606cb76463a2e1617fe7e4c6ff390cb7ec4c/test/N3Writer-test.js#L511-L533
The output I am looking for is:
[ ] <a> <b> ; <c> <d> .
This one should have worked:
import { Writer, DataFactory } from './lib/index.js';
const writer = new Writer();
const { namedNode } = DataFactory;
const blank = writer.blank();
writer.addQuad(blank, namedNode('a'), namedNode('b'));
writer.addQuad(blank, namedNode('c'), namedNode('d'));
writer.end((err, result) => console.log(result));
but it returns this at the moment:
[] <a> <b>.
[] <c> <d>.
Let me check if this is an easy fix.
Fix published as v1.17.1.
The output I am looking for is:
or
The workaround I have found is obviously not intended as it uses internal functions:
This produces the second style output.