components_rs/context/mod.rs
1//! JSON-LD context resolution: expanding compact IRIs to full IRIs and back.
2//!
3//! Components.js files use a layered context system: a package's `lsd:contexts` map registers
4//! context documents by IRI, and individual `components.jsonld` / `config/*.jsonld` files
5//! reference those IRIs in their `@context` arrays. This module resolves that chain so that
6//! short terms like `"Class"` or `"oo:parameter"` can be expanded to their canonical IRIs.
7//!
8//! # Key types
9//!
10//! - [`expand::ContextResolver`] — per-file resolver built from a single document's `@context`.
11//! Used during component and config extraction to expand IRIs found in that file.
12//! - [`expand::IriCompactor`] — project-wide, built by merging *all* known contexts.
13//! Used by the LSP to compact full IRIs back to their shortest display form for hover cards
14//! and completion labels.
15
16pub mod expand;