Skip to main content

Module expand

Module expand 

Source
Expand description

JSON-LD term expansion, context resolution, and IRI compaction.

§ContextResolver

A per-file resolver built from a single document’s @context value (string URL, inline object, or array of both). Call ContextResolver::from_context_value with the parsed @context and the project’s preloaded context map, then use ContextResolver::expand_term to turn short terms into full IRIs during component or config extraction.

§IriCompactor

A project-wide compactor built by merging all context documents from ModuleState. Used by the LSP at display time — e.g., to show oo:Class in a hover card instead of the full https://linkedsoftwaredependencies.org/…#Class IRI.

§extract_graph_nodes

Extracts the @graph entries (or the document root if there is no @graph) from a parsed JsonLdVal document, expanding all term keys to full IRIs. The returned ExpandedNode values form the input to the two-phase component collection in crate::components::registry.

Structs§

ContextResolver
A resolved JSON-LD context that maps short terms to full IRIs.
ExpandedNode
An expanded JSON-LD node with full IRIs as keys.
IriCompactor
Project-wide bidirectional IRI translator.
TermDef

Functions§

extract_graph_nodes
Extract the @graph entries from a JSON-LD document, expanding all terms.