pub struct Q42Lexicon {
pub terms: HashMap<String, u64>,
pub reverse: HashMap<u64, String>,
pub version: LexiconVersion,
pub context_uri: String,
pub vocabulary: HashMap<String, String>,
}Expand description
Q42 Lexicon for CBOR-LD semantic processing
Fields§
§terms: HashMap<String, u64>Term to hash mapping (forward lookup)
reverse: HashMap<u64, String>Hash to term mapping (reverse lookup)
version: LexiconVersionLexicon version
context_uri: StringContext URI
vocabulary: HashMap<String, String>Vocabulary prefixes
Implementations§
Source§impl Q42Lexicon
impl Q42Lexicon
Sourcepub fn from_volume(volume: &Q42Volume) -> Result<Self, LexError>
pub fn from_volume(volume: &Q42Volume) -> Result<Self, LexError>
Load lexicon from a Q42 volume
Sourcepub fn resolve_term(&self, term: &str) -> Option<u64>
pub fn resolve_term(&self, term: &str) -> Option<u64>
Resolve term to hash (zero-allocation)
Sourcepub fn resolve_hash(&self, hash: u64) -> Option<&str>
pub fn resolve_hash(&self, hash: u64) -> Option<&str>
Resolve hash to term (zero-allocation)
Sourcepub fn contains_term(&self, term: &str) -> bool
pub fn contains_term(&self, term: &str) -> bool
Check if term exists in lexicon
Sourcepub fn contains_hash(&self, hash: u64) -> bool
pub fn contains_hash(&self, hash: u64) -> bool
Check if hash exists in lexicon
Sourcepub fn expand_iri(&self, compact_iri: &str) -> Option<String>
pub fn expand_iri(&self, compact_iri: &str) -> Option<String>
Expand compact IRI to full IRI
Sourcepub fn vocabulary(&self) -> &HashMap<String, String>
pub fn vocabulary(&self) -> &HashMap<String, String>
Get vocabulary prefixes
Trait Implementations§
Source§impl Clone for Q42Lexicon
impl Clone for Q42Lexicon
Source§fn clone(&self) -> Q42Lexicon
fn clone(&self) -> Q42Lexicon
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Q42Lexicon
impl Debug for Q42Lexicon
Auto Trait Implementations§
impl Freeze for Q42Lexicon
impl RefUnwindSafe for Q42Lexicon
impl Send for Q42Lexicon
impl Sync for Q42Lexicon
impl Unpin for Q42Lexicon
impl UnsafeUnpin for Q42Lexicon
impl UnwindSafe for Q42Lexicon
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.