pub struct Options<I = Index, M = Location<I>, C = Value<M>> {
pub base: Option<I>,
pub compact_arrays: bool,
pub compact_to_relative: bool,
pub expand_context: Option<RemoteDocumentReference<I, M, C>>,
pub ordered: bool,
pub processing_mode: ProcessingMode,
}
Expand description
JSON-LD Processor options.
Fields§
§base: Option<I>
The base IRI to use when expanding or compacting the document.
If set, this overrides the input document’s IRI.
compact_arrays: bool
If set to true, the JSON-LD processor replaces arrays with just one element with that element during compaction.
If set to false, all arrays will remain arrays even if they have just one element.
Defaults to true
.
compact_to_relative: bool
Determines if IRIs are compacted relative to the base option or document location when compacting.
Defaults to true
.
expand_context: Option<RemoteDocumentReference<I, M, C>>
A context that is used to initialize the active context when expanding a document.
ordered: bool
If set to true
, certain algorithm processing steps where indicated are
ordered lexicographically.
If false
, order is not considered in processing.
Defaults to false
.
processing_mode: ProcessingMode
Sets the processing mode.
Defaults to ProcessingMode::JsonLd1_1
.
Implementations§
source§impl<I, M, C> Options<I, M, C>
impl<I, M, C> Options<I, M, C>
sourcepub fn unordered(self) -> Self
pub fn unordered(self) -> Self
Returns these options with the ordered
flag set to false
.
This means entries will not be ordered by keys before being processed.
sourcepub fn context_processing_options(&self) -> Options
pub fn context_processing_options(&self) -> Options
Builds options for the context processing algorithm from these options.
sourcepub fn expansion_options(&self) -> Options
pub fn expansion_options(&self) -> Options
Builds options for the expansion algorithm from these options.
sourcepub fn compaction_options(&self) -> Options
pub fn compaction_options(&self) -> Options
Builds options for the compaction algorithm from these options.