Skip to main content

convert_with_loader

Function convert_with_loader 

Source
pub async fn convert_with_loader(
    root: &SyntaxNode<Lang>,
    loader: &mut dyn ContextLoader,
    base_iri: Option<String>,
) -> (Turtle, ActiveContext)
Expand description

Convert a parsed JSON-LD CST to RDF triples, using loader to fetch remote @context documents asynchronously.

base_iri sets the initial base IRI for resolving relative IRIs. When the document was fetched from a URL, pass that URL here. An explicit @base in the document’s @context will override this value.

Returns (turtle, context) where context is the accumulated ActiveContext built from all @context entries in the document.