JsonLdGraphDecoderOptions class

Configuration options for JSON-LD graph decoding

This class provides configuration options for customizing the behavior of the JSON-LD graph decoder, particularly around handling named graphs.

Since JsonLdGraphDecoder produces an RdfGraph (which doesn't support named graphs) from JSON-LD input (which may contain named graphs), this class allows you to configure how that mismatch is handled.

Example:

// Strict mode - throw exception on named graphs
final strictDecoder = JsonLdGraphDecoder(
  options: JsonLdGraphDecoderOptions(
    namedGraphHandling: NamedGraphHandling.strict,
  ),
);

// Merge mode with custom logging
final mergeDecoder = JsonLdGraphDecoder(
  options: JsonLdGraphDecoderOptions(
    namedGraphHandling: NamedGraphHandling.mergeIntoDefault,
    logLevel: NamedGraphLogLevel.info,
  ),
);

Constructors

JsonLdGraphDecoderOptions({NamedGraphHandling namedGraphHandling = NamedGraphHandling.strict, NamedGraphLogLevel? logLevel, JsonLdContextDocumentProvider? contextDocumentProvider, String? baseUri, JsonValue? expandContext, RdfDirection? rdfDirection, JsonLdProcessingMode processingMode = JsonLdProcessingMode.jsonLd11, bool skipInvalidRdfTerms = false})
Creates a new JSON-LD decoder options object
const

Properties

baseUri String?
Overrides the document URL as the effective base for resolving relative IRIs.
final
contextDocumentProvider JsonLdContextDocumentProvider?
Provider for resolving external @context documents referenced by IRI.
final
expandContext → JsonValue?
An optional context that is applied before the document's own @context.
final
hashCode int
The hash code for this object.
no setterinherited
logLevel NamedGraphLogLevel?
The log level to use when handling named graphs
final
namedGraphHandling NamedGraphHandling
How to handle named graphs when decoding to RdfGraph
final
processingMode JsonLdProcessingMode
JSON-LD processing mode used for version-gated features.
final
rdfDirection RdfDirection?
Optional RDF direction serialization mode for value objects containing @direction.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
skipInvalidRdfTerms bool
Controls how invalid RDF terms produced during JSON-LD to RDF conversion are handled.
final

Methods

copyWith({NamedGraphHandling? namedGraphHandling, NamedGraphLogLevel? logLevel, JsonLdContextDocumentProvider? contextDocumentProvider, String? baseUri, JsonValue? expandContext, RdfDirection? rdfDirection, JsonLdProcessingMode? processingMode, bool? skipInvalidRdfTerms}) JsonLdGraphDecoderOptions
Creates a copy of this JsonLdGraphDecoderOptions with the given fields replaced by new values.
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(RdfGraphDecoderOptions options) JsonLdGraphDecoderOptions
Creates a JSON-LD decoder options object from generic RDF decoder options