convert method
Decodes a TriG document into an RDF dataset
This method parses a string containing TriG syntax into an RDF dataset structure with support for named graphs. It delegates to the internal TriGParser implementation to handle the actual parsing.
Parameters:
inputThe TriG document to decode as a string.documentUrlOptional base URI for the document, used for resolving relative IRIs in the TriG content. If not provided, relative IRIs will result in an error unless there's a @base directive in the content.
Returns:
- An RdfDataset containing the parsed quads organized into default and named graphs.
Throws:
- RdfSyntaxException if the syntax is invalid or cannot be parsed.
- RdfInvalidIriException if relative IRIs are used without a base URI.
Implementation
@override
RdfDataset convert(String input, {String? documentUrl}) {
final parser = TriGParser(
input,
baseUri: documentUrl,
parsingFlags: _options.parsingFlags,
namespaceMappings: _namespaceMappings,
iriTermFactory: _iriTermFactory,
format: _format,
);
return RdfDataset.fromQuads(parser.parse());
}