Class TurtleSerializer

All Implemented Interfaces:
Function<Object,String>, ThrowingFunction<Object,String>, RdfMetaProvider, XmlMetaProvider

public class TurtleSerializer extends RdfSerializer
Subclass of RdfSerializer for serializing POJOs to Turtle format.

Produces compact, human-readable RDF in W3C Turtle syntax. Turtle is widely used for RDF interchange and is often more readable than RDF/XML.

Examples:

// Serialize a bean to Turtle string. Person person = new Person("Alice", 30); String turtle = TurtleSerializer.DEFAULT.write(person);

// Or use the Turtle marshaller for convenience. String turtle = Turtle.DEFAULT.write(person);

// Custom serializer with swaps. TurtleSerializer s = TurtleSerializer.create().swaps(DateSwap.class).build(); String turtle = s.write(bean);

Example output (bean with name/age):