TriGEncoderOptions class

Configuration options for TriG serialization.

This class provides configuration settings that control how RDF datasets are serialized to the TriG format, including namespace prefix handling and automatic prefix generation.

Example:

final options = TriGEncoderOptions(
  customPrefixes: {'ex': 'http://example.org/'},
  generateMissingPrefixes: true
);
final encoder = TriGEncoder(options: options);
Inheritance

Constructors

TriGEncoderOptions({Map<String, String> customPrefixes = const {}, IriRelativizationOptions iriRelativization = const IriRelativizationOptions.full(), bool generateMissingPrefixes = true, bool useNumericLocalNames = false, bool includeBaseDeclaration = true, bool renderFragmentsAsPrefixed = true, bool useGraphKeyword = true, bool prettyPrintCollections = true, int collectionItemBreakAfter = 10, int objectListBreakAfter = 10, int inlineBlankNodeMaxWidth = 80, int inlineBlankNodeMaxTriples = 3})
Creates a new TriGEncoderOptions instance.
const

Properties

collectionItemBreakAfter int
Maximum number of collection items before forcing a multi-line layout.
final
customPrefixes Map<String, String>
Custom namespace prefixes to use during encoding.
finalinherited
generateMissingPrefixes bool
Controls automatic generation of namespace prefixes for IRIs without matching prefixes.
final
hashCode int
The hash code for this object.
no setterinherited
includeBaseDeclaration bool
Whether to include base URI declarations in the output
final
inlineBlankNodeMaxTriples int
Maximum number of triples inside an inline blank node before forcing multi-line layout.
final
inlineBlankNodeMaxWidth int
Maximum inline length (in characters) for blank nodes.
final
iriRelativization IriRelativizationOptions
Options for controlling IRI relativization behavior.
finalinherited
objectListBreakAfter int
Maximum number of objects before breaking object lists across lines.
final
prettyPrintCollections bool
Controls whether RDF collections are formatted across multiple lines when they contain complex items (nested collections or blank nodes with their own predicates).
final
renderFragmentsAsPrefixed bool
Controls how fragment IRIs are rendered in the output.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
useGraphKeyword bool
Whether to use the explicit GRAPH keyword for named graphs.
final
useNumericLocalNames bool
Controls whether local names that start with a digit are written using prefix notation.
final

Methods

copyWith({Map<String, String>? customPrefixes, bool? generateMissingPrefixes, bool? useNumericLocalNames, bool? includeBaseDeclaration, bool? renderFragmentsAsPrefixed, bool? useGraphKeyword, bool? prettyPrintCollections, int? collectionItemBreakAfter, int? objectListBreakAfter, int? inlineBlankNodeMaxWidth, int? inlineBlankNodeMaxTriples, IriRelativizationOptions? iriRelativization}) TriGEncoderOptions
This method allows creating a new TriGEncoderOptions instance based on the current options, selectively overriding specific fields while keeping all other settings unchanged.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

from(RdfGraphEncoderOptions options) TriGEncoderOptions
Creates a TriGEncoderOptions instance from generic RdfGraphEncoderOptions.