use crate::{JsonLdProcessingMode, algorithms::context_processing::JsonLdContextProcessingOptions};
#[derive(Clone, Copy, Default)]
pub struct JsonLdExpansionOptions {
pub processing_mode: JsonLdProcessingMode,
pub policy: JsonLdExpansionPolicy,
pub ordered: bool,
}
impl JsonLdExpansionOptions {
pub fn unordered(self) -> Self {
Self {
ordered: false,
..self
}
}
}
impl From<JsonLdExpansionOptions> for JsonLdContextProcessingOptions {
fn from(options: JsonLdExpansionOptions) -> JsonLdContextProcessingOptions {
JsonLdContextProcessingOptions {
processing_mode: options.processing_mode,
..Default::default()
}
}
}
#[derive(Clone, Copy, PartialEq, Eq, Debug, Default)]
pub enum JsonLdExpansionPolicy {
Relaxed,
#[default]
Standard,
Strict,
Strictest,
}
impl JsonLdExpansionPolicy {
pub fn is_strict(&self) -> bool {
matches!(self, Self::Strict | Self::Strictest)
}
}