Class TriGSerializer

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

public class TriGSerializer extends RdfSerializer
Subclass of RdfSerializer for serializing POJOs to TriG format.

Produces RDF datasets in TriG notation, extending Turtle with support for multiple named graphs. Useful for representing RDF datasets (collections of RDF graphs).

Examples:

// Serialize a bean to TriG string. Person person = new Person("Alice", 30); String triG = TriGSerializer.DEFAULT.write(person);

// Or use the TriG marshaller for convenience. String triG = TriG.of(person);

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

Example output (bean with name/age):

  • Field Details

  • Constructor Details

  • Method Details