RdfCore class final
RDF Core Library
Entry point for core RDF data model types and utilities. Central facade for the RDF library, providing access to parsing and serialization.
This class serves as the primary entry point for the RDF library, offering a simplified interface for common RDF operations. It encapsulates the complexity of codec management, format registries, and plugin management behind a clean, user-friendly API.
The class follows IoC principles by accepting dependencies in its constructor, making it suitable for dependency injection and improving testability. For most use cases, the RdfCore.withStandardCodecs factory constructor provides a pre-configured instance with standard codecs registered.
Example usage:
import 'package:locorda_rdf_core/core.dart';
final triple = Triple(subject, predicate, object);
Constructors
- RdfCore({required RdfCodecRegistry registry, RdfDatasetCodecRegistry? datasetRegistry, RdfBinaryGraphCodecRegistry? binaryGraphRegistry, RdfBinaryDatasetCodecRegistry? binaryDatasetRegistry})
- Creates a new RDF library instance with the given components
-
RdfCore.withCodecs({List<
RdfGraphCodec> codecs = const [], List<RdfDatasetCodec> datasetCodecs = const [], List<RdfBinaryGraphCodec> binaryGraphCodecs = const [], List<RdfBinaryDatasetCodec> binaryDatasetCodecs = const []}) -
Creates a new RDF library instance with only the provided codecs registered
factory
-
RdfCore.withStandardCodecs({RdfNamespaceMappings? namespaceMappings, List<
RdfGraphCodec> additionalCodecs = const [], List<RdfDatasetCodec> additionalDatasetCodecs = const [], List<RdfBinaryGraphCodec> additionalBinaryGraphCodecs = const [], List<RdfBinaryDatasetCodec> additionalBinaryDatasetCodecs = const [], IriTermFactory iriTermFactory = IriTerm.validated}) -
Creates a new RDF library instance with standard codecs registered
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
supportedContentTypes
→ List<
RdfContentTypeInfo> -
Returns capability information for all registered content types.
no setter
Methods
-
binaryDatasetCodec(
{String? contentType, RdfBinaryEncoderOptions? encoderOptions, RdfBinaryDecoderOptions? decoderOptions}) → RdfBinaryCodec< RdfDataset> - Get a binary dataset codec for a specific content type.
-
binaryGraphCodec(
{String? contentType, RdfBinaryEncoderOptions? encoderOptions, RdfBinaryDecoderOptions? decoderOptions}) → RdfBinaryGraphCodec - Get a binary graph codec for a specific content type.
-
codec(
{String? contentType, RdfGraphEncoderOptions? encoderOptions, RdfGraphDecoderOptions? decoderOptions}) → RdfGraphCodec - Get a codec for a specific content type
-
contentTypeInfo(
String contentType) → RdfContentTypeInfo? -
Returns capability information for the given
contentType, ornullif no registered codec supports it. -
datasetCodec(
{String? contentType, RdfGraphEncoderOptions? encoderOptions, RdfGraphDecoderOptions? decoderOptions}) → RdfCodec< RdfDataset> - Get a dataset codec for a specific content type
-
decode(
String content, {String? contentType, String? documentUrl, RdfGraphDecoderOptions? options}) → RdfGraph - Decode RDF content to create a graph
-
decodeBinary(
Uint8List content, {String? contentType, RdfBinaryDecoderOptions? options}) → RdfGraph - Decode binary RDF content to create a graph.
-
decodeBinaryDataset(
Uint8List content, {String? contentType, RdfBinaryDecoderOptions? options}) → RdfDataset - Decode binary RDF content to create a dataset.
-
decodeDataset(
String content, {String? contentType, String? documentUrl, RdfGraphDecoderOptions? options}) → RdfDataset - Decode RDF dataset content to create a dataset
-
encode(
RdfGraph graph, {String? contentType, String? baseUri, RdfGraphEncoderOptions? options}) → String - Encode an RDF graph to a string representation
-
encodeBinary(
RdfGraph graph, {String? contentType, RdfBinaryEncoderOptions? options}) → Uint8List - Encode an RDF graph to binary.
-
encodeBinaryDataset(
RdfDataset dataset, {String? contentType, RdfBinaryEncoderOptions? options}) → Uint8List - Encode an RDF dataset to binary.
-
encodeDataset(
RdfDataset dataset, {String? contentType, String? baseUri, RdfGraphEncoderOptions? options}) → String - Encode an RDF dataset to a string representation
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
supportsContentType(
String contentType) → bool -
Returns
trueif any registered codec supportscontentType. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited