Class TriGParser

All Implemented Interfaces:
RdfMetaProvider, XmlMetaProvider

public class TriGParser extends RdfParser
Subclass of RdfParser for parsing TriG into POJOs.

Accepts RDF datasets in TriG format (Turtle with named graphs) and converts them to Java beans, maps, collections, and primitive types. Date/time literals are parsed via ISO 8601.

Examples:

// Parse TriG string into a bean. String triG = ...; // TriG content Person person = TriGParser.DEFAULT.read(triG, Person.class);

// Or use the TriG marshaller for convenience. Person person = TriG.to(triG, Person.class);

// Custom parser with swaps. TriGParser p = TriGParser.create().swaps(DateSwap.class).build(); MyBean bean = p.read(triG, MyBean.class);

Example input (bean with name/age):

  • Field Details

    • DEFAULT

      public static final TriGParser DEFAULT
      Default TriG parser, all default settings.
  • Constructor Details

    • TriGParser

      public TriGParser(RdfParser.Builder<?> builder)
      Constructor.
      Parameters:
      builder - The builder for this object.
      Cannot be null.
  • Method Details

    • create

      public static RdfParser.Builder<?> create()
      Creates a new builder for this object.
      Returns:
      A new builder.