pub struct KnowledgeEntity { /* private fields */ }Expand description
A minimal entity model used by early graph-building code.
Implementations§
Source§impl KnowledgeEntity
impl KnowledgeEntity
Sourcepub fn new(id: impl Into<String>, label: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, label: impl Into<String>) -> Self
Creates a new knowledge entity with a stable identifier and display label.
Sourcepub fn from_ontology(
identity: OntologyIdentity,
label: impl Into<String>,
) -> Result<Self, DomainError>
pub fn from_ontology( identity: OntologyIdentity, label: impl Into<String>, ) -> Result<Self, DomainError>
Creates a typed entity whose id is derived from scoped ontology identity, not its label.
Sourcepub const fn entity_kind(&self) -> OntologyEntityKind
pub const fn entity_kind(&self) -> OntologyEntityKind
Returns untyped for legacy label-only entities and the ontology type otherwise.
Sourcepub fn ontology_identity(&self) -> Option<&OntologyIdentity>
pub fn ontology_identity(&self) -> Option<&OntologyIdentity>
Returns scoped ontology identity when this is a typed entity.
Trait Implementations§
Source§impl Clone for KnowledgeEntity
impl Clone for KnowledgeEntity
Source§fn clone(&self) -> KnowledgeEntity
fn clone(&self) -> KnowledgeEntity
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 KnowledgeEntity
impl Debug for KnowledgeEntity
Source§impl<'de> Deserialize<'de> for KnowledgeEntity
impl<'de> Deserialize<'de> for KnowledgeEntity
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for KnowledgeEntity
Source§impl PartialEq for KnowledgeEntity
impl PartialEq for KnowledgeEntity
Source§impl Serialize for KnowledgeEntity
impl Serialize for KnowledgeEntity
impl StructuralPartialEq for KnowledgeEntity
Auto Trait Implementations§
impl Freeze for KnowledgeEntity
impl RefUnwindSafe for KnowledgeEntity
impl Send for KnowledgeEntity
impl Sync for KnowledgeEntity
impl Unpin for KnowledgeEntity
impl UnsafeUnpin for KnowledgeEntity
impl UnwindSafe for KnowledgeEntity
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.