JsonLdEncoderOptions class
Configuration options for JSON-LD encoding
This class provides configuration options for customizing the behavior of the JSON-LD encoder. It extends the base RDF encoder options to add JSON-LD specific functionality.
Currently, the main customization is the ability to provide custom prefixes for the JSON-LD context, allowing for more readable and application-specific compact IRIs in the output.
Potential future options might include:
- Control over formatting (compact vs. expanded form)
- Custom handling of complex datatypes
- Options for including/excluding @context
- Named graph serialization settings
Example usage:
final options = JsonLdEncoderOptions(
customPrefixes: {
'ex': 'http://example.org/',
'app': 'http://myapp.com/terms#'
}
);
final encoder = JsonLdEncoder(options: options);
- Inheritance
-
- Object
- RdfGraphEncoderOptions
- JsonLdEncoderOptions
Constructors
-
JsonLdEncoderOptions({Map<
String, String> customPrefixes = const {}}) -
Creates a new JSON-LD encoder options object
const
Properties
-
customPrefixes
→ Map<
String, String> -
Custom namespace prefixes to use during encoding.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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) → JsonLdEncoderOptions - Creates a JSON-LD encoder options object from generic RDF encoder options