convert method

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

Decodes a Turtle document into an RDF graph

This method parses a string containing Turtle syntax into an RDF graph structure. It delegates to the internal TurtleParser implementation to handle the actual parsing.

Parameters:

  • input The Turtle document to decode as a string.
  • documentUrl Optional base URI for the document, used for resolving relative IRIs in the Turtle content. If not provided, relative IRIs will result in an error unless there's a @base directive in the content.

Returns:

  • An RdfGraph containing the parsed triples.

Throws:

Implementation

@override
RdfGraph convert(String input, {String? documentUrl}) {
  final parser = TurtleParser(
    input,
    baseUri: documentUrl,
    parsingFlags: _options.parsingFlags,
    namespaceMappings: _namespaceMappings,
  );
  return RdfGraph.fromTriples(parser.parse());
}