JsonLdDecoder class
Decoder for JSON-LD format
Adapter that bridges the RdfDecoder base class to the implementation-specific JsonLdParser. This class is responsible for:
- Adapting the RDF Core decoder interface to the JSON-LD parser
- Converting parsed triples into an RdfGraph
- Managing configuration options for the parsing process
The decoder creates a flat RDF Graph from the JSON-LD input. When the
input contains a top-level @graph
property (representing a named graph
in JSON-LD), all triples from the graph are extracted into the same RDF Graph,
losing the graph name information but preserving the triple data.
Example usage:
final decoder = JsonLdDecoder();
final graph = decoder.convert(jsonLdString);
- Inheritance
-
- Object
- Converter<
String, RdfGraph> - RdfGraphDecoder
- JsonLdDecoder
Constructors
- JsonLdDecoder({JsonLdDecoderOptions options = const JsonLdDecoderOptions()})
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
bind(
Stream< String> stream) → Stream<RdfGraph> -
Transforms the provided
stream
.inherited -
cast<
RS, RT> () → Converter< RS, RT> -
Provides a
Converter<RS, RT>
view of this stream transformer.inherited -
convert(
String input, {String? documentUrl}) → RdfGraph -
Decodes an RDF document and returns an RDF graph
override
-
fuse<
TT> (Converter< RdfGraph, TT> other) → Converter<String, TT> -
Fuses
this
withother
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
startChunkedConversion(
Sink< RdfGraph> sink) → Sink<String> -
Starts a chunked conversion.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
withOptions(
RdfGraphDecoderOptions options) → RdfGraphDecoder -
Creates a new decoder with the specified options
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited