@jeswr/pretty-turtle
v1.5.0
Published
A pretty serializer for turtle RDF syntax
Downloads
471
Readme
Pretty Turtle
A pretty turtle syntax writer (including support for RDF-star)
Usage
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/"
}
});
License
©2023–present Jesse Wright, MIT License.