Skip to main content

Crate jsonld_context_processing

Crate jsonld_context_processing 

Source
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 @context it was built from.
ProcessedOwned
An active context paired with an owned copy of the @context it was built from.
ProcessedRef
A borrowed active context paired with a borrow of the @context it was built from.
ProcessingCache
Cache of processed contexts.
ProcessingStack
The chain of remote context URLs currently being processed.

Enums§

Error
Errors that can happen during context processing.
ProcessingMode
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.
WarningHandler
Handlers that can receive the Warnings raised during context processing.

Type Aliases§

ProcessingResult
Result of context processing: the active context paired with the @context it was built from, or the error that stopped the algorithm.