decodeDataset method

RdfDataset decodeDataset(
  1. String content, {
  2. String? contentType,
  3. String? documentUrl,
  4. RdfGraphDecoderOptions? options,
})

Decode RDF dataset content to create a dataset

Converts a string containing serialized RDF dataset data into an in-memory RDF dataset. The format can be explicitly specified using the contentType parameter, or automatically detected from the content if not specified.

The content parameter is the RDF dataset content to parse as a string.

The contentType parameter is an optional MIME type to specify the format (e.g., "application/n-quads").

The documentUrl parameter is an optional base URI for resolving relative references in the document.

The options parameter contains optional format-specific decoder options.

Returns an RdfDataset containing the parsed quads organized into default and named graphs.

Throws codec-specific exceptions for parsing errors. Throws CodecNotSupportedException if the codec is not supported and cannot be detected.

Implementation

RdfDataset decodeDataset(
  String content, {
  String? contentType,
  String? documentUrl,
  RdfGraphDecoderOptions? options,
}) =>
    datasetCodec(
      contentType: contentType,
      decoderOptions: options,
    ).decode(content, documentUrl: documentUrl);