Struct stam::WebAnnoConfig
source · pub struct WebAnnoConfig {
pub default_annotation_iri: String,
pub generate_annotation_iri: bool,
pub default_set_iri: String,
pub default_resource_iri: String,
pub extra_context: Vec<String>,
pub auto_generated: bool,
pub auto_generator: bool,
pub context_namespaces: Vec<(String, String)>,
}Fields§
§default_annotation_iri: StringIRI prefix for Annotation Identifiers. Will be prepended if the annotations public ID is not an IRI yet.
generate_annotation_iri: boolGenerate a random annotation IRI if it does not exist yet? (non-deterministic!)
default_set_iri: StringIRI prefix for Annotation Data Sets. Will be prepended if the annotation data set public ID is not an IRI yet.
default_resource_iri: StringIRI prefix for Text Resources. Will be prepended if the resource public ID is not an IRI yet.
extra_context: Vec<String>Extra JSON-LD context to export, these must be URLs to JSONLD files.
auto_generated: boolAutomatically add a ‘generated’ triple for each annotation, with the timestamp of serialisation
auto_generator: boolAutomatically add a ‘generator’ triple for each annotation, with the software details
context_namespaces: Vec<(String, String)>Automatically generate a JSON-LD context alias for all URIs in keys, maps URI prefixes to namespace prefixes
Implementations§
source§impl WebAnnoConfig
impl WebAnnoConfig
pub fn with_namespace(self, prefix: String, uri: String) -> Self
pub fn uri_to_namespace<'a>(&self, s: &'a str) -> Cow<'a, str>
sourcepub fn serialize_context(&self) -> String
pub fn serialize_context(&self) -> String
Generates a JSON-LD string to use for @context
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WebAnnoConfig
impl RefUnwindSafe for WebAnnoConfig
impl Send for WebAnnoConfig
impl Sync for WebAnnoConfig
impl Unpin for WebAnnoConfig
impl UnwindSafe for WebAnnoConfig
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more