A pretty turtle syntax writer (including support for RDF-star)
import { write } from '@jeswr/pretty-turtle';
// Convert RDF/JS quads into a pretty turtle string
const str = await write(quads);
This library also supports writing in Notation3 format
import { write } from '@jeswr/pretty-turtle';
// Convert RDF/JS quads into a Notation3 string
const str = await write(quads, {
format: 'text/n3'
});
An additional prefixes
parameter is supported to allow compacting of URIs
import { write } from '@jeswr/pretty-turtle';
// Convert RDF/JS quads into a Notation3 string
const str = await write(quads, {
prefixes: {
ex: "http://example.org/"
}
});
©2023–present Jesse Wright, MIT License.