TriGDecoder class
Decoder for TriG format RDF documents
This decoder implements the RdfDatasetDecoder interface for parsing TriG syntax into RDF datasets with named graphs. It acts as an adapter that bridges the RdfDecoder interface to the implementation-specific TriGParser.
The TriG format is an extension of Turtle that supports named graphs, allowing multiple RDF graphs to be represented in a single document. This decoder handles standard TriG syntax as specified in the W3C recommendation.
Example:
final decoder = TriGDecoder(namespaceMappings: defaultNamespaces);
final dataset = decoder.convert('''
@prefix ex: <http://example.org/> .
ex:subject ex:predicate "object" .
GRAPH ex:graph1 { ex:s ex:p ex:o . }
''');
- Inheritance
-
- Object
- Converter<
String, RdfDataset> - RdfDecoder<
RdfDataset> - RdfDatasetDecoder
- TriGDecoder
Constructors
- TriGDecoder({TriGDecoderOptions options = const TriGDecoderOptions(), required RdfNamespaceMappings namespaceMappings, IriTermFactory iriTermFactory = IriTerm.validated, String format = "TriG"})
- Creates a new TriG decoder
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<RdfDataset> -
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}) → RdfDataset -
Decodes a TriG document into an RDF dataset
override
-
fuse<
TT> (Converter< RdfDataset, TT> other) → Converter<String, TT> -
Fuses
thiswithother.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
startChunkedConversion(
Sink< RdfDataset> sink) → Sink<String> -
Starts a chunked conversion.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
withOptions(
RdfGraphDecoderOptions options) → RdfDatasetDecoder -
Creates a new instance with the specified options
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited