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:rdf_core/rdf_core.dart';
final triple = Triple(subject, predicate, object);
Constructors
- RdfCore({required RdfCodecRegistry registry})
- Creates a new RDF library instance with the given components
-
RdfCore.withCodecs({List<
RdfGraphCodec> codecs = const []}) -
Creates a new RDF library instance with only the provided codecs registered
factory
-
RdfCore.withStandardCodecs({RdfNamespaceMappings? namespaceMappings, List<
RdfGraphCodec> additionalCodecs = const []}) -
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
Methods
-
codec(
{String? contentType, RdfGraphEncoderOptions? encoderOptions, RdfGraphDecoderOptions? decoderOptions}) → RdfGraphCodec - Get a codec for a specific content type
-
decode(
String content, {String? contentType, String? documentUrl, RdfGraphDecoderOptions? options}) → RdfGraph - Decode RDF content to create a graph
-
encode(
RdfGraph graph, {String? contentType, String? baseUri, RdfGraphEncoderOptions? options}) → String - Encode an RDF graph to a string representation
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited