TurtleDecoder class
Decoder for Turtle format RDF documents
This decoder implements the RdfGraphDecoder interface for parsing Turtle syntax into RDF graphs. It acts as an adapter that bridges the RdfDecoder interface to the implementation-specific TurtleParser.
The Turtle format (Terse RDF Triple Language) is a textual syntax for RDF that allows writing down RDF graphs in a compact and natural text form. This decoder handles standard Turtle syntax as specified in the W3C recommendation.
Example:
final decoder = TurtleDecoder(namespaceMappings: defaultNamespaces);
final graph = decoder.convert('@prefix ex: <http://example.org/> . ex:subject ex:predicate "object" .');
- Inheritance
-
- Object
- Converter<
String, RdfGraph> - RdfGraphDecoder
- TurtleDecoder
Constructors
- TurtleDecoder({TurtleDecoderOptions options = const TurtleDecoderOptions(), required RdfNamespaceMappings namespaceMappings})
- Creates a new Turtle 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<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 a Turtle document into 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 instance with the specified options
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited