Skip to content

jeswr/pretty-turtle

Repository files navigation

Pretty Turtle

A pretty turtle syntax writer (including support for RDF-star)

GitHub license npm version Dependabot semantic-release

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.