RdfBinaryGraphCodec class abstract
A binary codec for RDF graph serialization formats.
Extends RdfBinaryCodec specialized for RdfGraph. Implementations provide binary encoding and decoding of RDF graphs (e.g., Jelly TRIPLES streams).
To add support for a new binary graph format, extend this class and register an instance with RdfBinaryGraphCodecRegistry.
Example:
class MyBinaryCodec extends RdfBinaryGraphCodec {
@override
String get primaryMimeType => 'application/x-my-binary';
@override
Set<String> get supportedMimeTypes => {primaryMimeType};
@override
RdfBinaryGraphDecoder get decoder => MyBinaryDecoder();
@override
RdfBinaryGraphEncoder get encoder => MyBinaryEncoder();
@override
bool canParseBytes(Uint8List content) => /* check magic bytes */;
@override
RdfBinaryGraphCodec withOptions({
RdfBinaryEncoderOptions? encoder,
RdfBinaryDecoderOptions? decoder,
}) => this;
}
Constructors
- RdfBinaryGraphCodec()
-
const
Properties
- decoder → RdfBinaryGraphDecoder
-
Returns the decoder of
this, converting fromTtoS.no setteroverride - encoder → RdfBinaryGraphEncoder
-
Returns the encoder from
StoT.no setteroverride - hashCode → int
-
The hash code for this object.
no setterinherited
-
inverted
→ Codec<
Uint8List, RdfGraph> -
Inverts
this.no setterinherited - primaryMimeType → String
-
The primary MIME type for this codec.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
supportedMimeTypes
→ Set<
String> -
All MIME types supported by this codec.
no setterinherited
Methods
-
canParseBytes(
Uint8List content) → bool -
Tests if the provided binary content is likely in this codec's format.
inherited
-
decode(
Uint8List input, {RdfBinaryDecoderOptions? options}) → RdfGraph -
Decodes binary RDF data into an RDF data structure.
inherited
-
encode(
RdfGraph input, {RdfBinaryEncoderOptions? options}) → Uint8List -
Encodes an RDF data structure to binary.
inherited
-
fuse<
R> (Codec< Uint8List, R> other) → Codec<RdfGraph, R> -
Fuses
thiswithother.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
withOptions(
{RdfBinaryEncoderOptions? encoder, RdfBinaryDecoderOptions? decoder}) → RdfBinaryGraphCodec -
Creates a new codec instance with the specified options.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited