Expand description
Implementation of the JSON-LD context processing algorithm.
Context processing turns a @context as it appears in a document — a
syntactic jsonld_syntax::context::Context — into an active context: a
Context holding the term definitions, base IRI, vocabulary mapping,
default language and default base direction that expansion and compaction
consult. Remote contexts referenced by IRI are fetched through a
Loader, and @import is resolved by merging the imported definition
underneath the importing one.
The entry point is the Process trait, implemented for
jsonld_syntax::context::Context. Process::process uses a fresh
active context and the default Options;
Process::process_full takes every parameter, including the warning
handler. Documents that reuse the same @context across many nodes should
go through Process::process_with_cache with a ProcessingCache, which
collapses repeated processing of an identical context to a single run.
Modules§
- algorithm
- The context processing algorithm itself, and the pieces it is built from.
- warning
- Warnings raised by the algorithms.
Structs§
- Context
- Active context: everything the algorithms need to expand or compact against the current scope.
- Options
- Options of the context processing algorithm.
- Processed
- An active context paired with a borrow of the
@contextit was built from. - Processed
Owned - An active context paired with an owned copy of the
@contextit was built from. - Processed
Ref - A borrowed active context paired with a borrow of the
@contextit was built from. - Processing
Cache - Cache of processed contexts.
- Processing
Stack - The chain of remote context URLs currently being processed.
Enums§
- Error
- Errors that can happen during context processing.
- Processing
Mode - Processing mode.
- Warning
- Warnings that can be raised during context processing.
Constants§
- MAX_
REMOTE_ CONTEXTS - Maximum depth of the remote context chain.
Traits§
- Process
- Contexts that can be processed into an active context.
- Warning
Handler - Handlers that can receive the
Warnings raised during context processing.
Type Aliases§
- Processing
Result - Result of context processing: the active context paired with the
@contextit was built from, or the error that stopped the algorithm.