RdfCore constructor

RdfCore({
  1. required RdfCodecRegistry registry,
  2. RdfDatasetCodecRegistry? datasetRegistry,
  3. RdfBinaryGraphCodecRegistry? binaryGraphRegistry,
  4. RdfBinaryDatasetCodecRegistry? binaryDatasetRegistry,
})

Creates a new RDF library instance with the given components

This constructor enables full dependency injection, allowing for:

  • Custom codec registries
  • Mock implementations for testing

For standard usage, see RdfCore.withStandardCodecs.

The registry parameter is the codec registry that manages available RDF graph codecs.

The datasetRegistry parameter is the codec registry that manages available RDF dataset codecs. If not provided, an empty registry is created.

The binaryGraphRegistry parameter is the codec registry that manages available binary RDF graph codecs. If not provided, an empty registry is created.

The binaryDatasetRegistry parameter is the codec registry that manages available binary RDF dataset codecs. If not provided, an empty registry is created.

Implementation

RdfCore({
  required RdfCodecRegistry registry,
  RdfDatasetCodecRegistry? datasetRegistry,
  RdfBinaryGraphCodecRegistry? binaryGraphRegistry,
  RdfBinaryDatasetCodecRegistry? binaryDatasetRegistry,
})  : _registry = registry,
      _datasetRegistry = datasetRegistry ?? RdfDatasetCodecRegistry(),
      _binaryGraphRegistry =
          binaryGraphRegistry ?? RdfBinaryGraphCodecRegistry(),
      _binaryDatasetRegistry =
          binaryDatasetRegistry ?? RdfBinaryDatasetCodecRegistry();