convert method

  1. @override
RdfDataset convert(
  1. String input, {
  2. String? documentUrl,
})

Decodes an RDF dataset document and returns an RDF dataset

This method transforms a textual RDF dataset document into a structured RdfDataset object containing quads parsed from the input and organized into default and named graphs. It implements the convert method from the Converter interface.

Parameters:

  • input The RDF dataset document to decode, as a string.
  • documentUrl The absolute URL of the document, used for resolving relative IRIs. If not provided, relative IRIs will be kept as-is or handled according to format-specific rules.

Returns:

  • An RdfDataset containing the quads parsed from the input, organized into graphs.

The specific decoding behavior depends on the implementation of this interface, which will handle format-specific details like prefix resolution, blank node handling, and graph context management, etc.

May throw format-specific parsing exceptions if the input is malformed.

Implementation

@override
RdfDataset convert(String input, {String? documentUrl}) {
  final result = decode(input, documentUrl: documentUrl);

  // Organize quads into default and named graphs
  return result.dataset;
}