convert method
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:
- RdfSyntaxException if the syntax is invalid or cannot be parsed.
- RdfInvalidIriException if relative IRIs are used without a base URI.
Implementation
@override
RdfGraph convert(String input, {String? documentUrl}) {
final parser = TurtleParser(
input,
baseUri: documentUrl,
parsingFlags: _options.parsingFlags,
namespaceMappings: _namespaceMappings,
);
return RdfGraph.fromTriples(parser.parse());
}