[][src]Trait json_ld::context::Context

pub trait Context<T: Id = IriBuf>: Clone {
    type LocalContext: Local<T>;
    fn new(base_iri: Option<Iri>) -> Self;
fn get(&self, term: &str) -> Option<&TermDefinition<T, Self>>;
fn original_base_url(&self) -> Option<Iri>;
fn base_iri(&self) -> Option<Iri>;
fn vocabulary(&self) -> Option<&Term<T>>;
fn default_language(&self) -> Option<&str>;
fn default_base_direction(&self) -> Option<Direction>;
fn previous_context(&self) -> Option<&Self>;
fn definitions<'a>(
        &'a self
    ) -> Box<dyn Iterator<Item = (&'a String, &'a TermDefinition<T, Self>)> + 'a>; fn get_opt(&self, term: Option<&str>) -> Option<&TermDefinition<T, Self>> { ... } }

JSON-LD active context.

An active context holds all the term definitions used to expand a JSON-LD value.

Associated Types

type LocalContext: Local<T>

The type of local contexts associated to this type of contexts.

Loading content...

Required methods

fn new(base_iri: Option<Iri>) -> Self

Create a newly-initialized active context with the given base IRI.

fn get(&self, term: &str) -> Option<&TermDefinition<T, Self>>

Get the definition of a term.

fn original_base_url(&self) -> Option<Iri>

Original base URL of the context.

fn base_iri(&self) -> Option<Iri>

Current base IRI of the context.

fn vocabulary(&self) -> Option<&Term<T>>

Optional vocabulary mapping.

fn default_language(&self) -> Option<&str>

Optional default language.

fn default_base_direction(&self) -> Option<Direction>

Optional default base direction.

fn previous_context(&self) -> Option<&Self>

Get the previous context.

fn definitions<'a>(
    &'a self
) -> Box<dyn Iterator<Item = (&'a String, &'a TermDefinition<T, Self>)> + 'a>

Loading content...

Provided methods

fn get_opt(&self, term: Option<&str>) -> Option<&TermDefinition<T, Self>>

Loading content...

Implementors

impl<T: Id> Context<T> for JsonContext<T>[src]

type LocalContext = JsonValue

Loading content...