decode method
- String input, {
- String? documentUrl,
- RdfGraphDecoderOptions? options,
override
Decodes a string containing RDF data into an RDF graph
This is a convenience method that delegates to the codec's decoder. It transforms a textual RDF document into a structured RdfGraph object containing triples parsed from the input.
The input
parameter is the RDF content to decode as a string.
The documentUrl
parameter is an optional base URI for resolving relative references in the document.
If not provided, relative IRIs will be kept as-is or handled according to
codec-specific rules.
The options
parameter contains optional decoder options for this operation.
Returns an RdfGraph containing the parsed triples.
Example:
final turtle = TurtleCodec();
final graph = turtle.decode(turtleString);
Throws codec-specific exceptions for syntax errors or other parsing problems.
Implementation
RdfGraph decode(
String input, {
String? documentUrl,
RdfGraphDecoderOptions? options,
}) {
return (options == null ? decoder : decoder.withOptions(options)).convert(
input,
documentUrl: documentUrl,
);
}