turtle top-level property

TurtleCodec turtle
final

Global convenience variable for working with Turtle format

This variable provides direct access to a pre-configured Turtle codec for easy encoding and decoding of Turtle data without needing to create a codec instance manually.

Example:

final graph = turtle.decode(turtleString);
final serialized = turtle.encode(graph);

For custom configuration, you can create a new codec with specific options:

final customTurtle = TurtleCodec(
  namespaceMappings: myNamespaces,
  encoderOptions: TurtleEncoderOptions(generateMissingPrefixes: false),
);

Implementation

final turtle = TurtleCodec();