pub struct KnowledgeRelation { /* private fields */ }Expand description
Evidence-backed directed edge between two knowledge entities.
Implementations§
Source§impl KnowledgeRelation
impl KnowledgeRelation
Sourcepub fn new(
from: EntityId,
to: EntityId,
kind: RelationKind,
confidence: ConfidenceScore,
evidence_id: EvidenceId,
) -> Self
pub fn new( from: EntityId, to: EntityId, kind: RelationKind, confidence: ConfidenceScore, evidence_id: EvidenceId, ) -> Self
Creates a directed relation backed by one evidence record.
Sourcepub fn with_id(
id: RelationId,
from: EntityId,
to: EntityId,
kind: RelationKind,
confidence: ConfidenceScore,
evidence_id: EvidenceId,
) -> Self
pub fn with_id( id: RelationId, from: EntityId, to: EntityId, kind: RelationKind, confidence: ConfidenceScore, evidence_id: EvidenceId, ) -> Self
Creates a directed relation with a caller-supplied stable identifier.
Sourcepub fn add_evidence(&mut self, evidence_id: EvidenceId)
pub fn add_evidence(&mut self, evidence_id: EvidenceId)
Adds provenance without counting the same evidence twice.
Sourcepub fn id(&self) -> &RelationId
pub fn id(&self) -> &RelationId
Returns the relation identifier.
Sourcepub fn kind(&self) -> &RelationKind
pub fn kind(&self) -> &RelationKind
Returns the relation category.
Sourcepub fn confidence(&self) -> ConfidenceScore
pub fn confidence(&self) -> ConfidenceScore
Returns the relation confidence score.
Sourcepub fn evidence_ids(&self) -> &BTreeSet<EvidenceId>
pub fn evidence_ids(&self) -> &BTreeSet<EvidenceId>
Returns the evidence records supporting this edge.
Trait Implementations§
Source§impl Clone for KnowledgeRelation
impl Clone for KnowledgeRelation
Source§fn clone(&self) -> KnowledgeRelation
fn clone(&self) -> KnowledgeRelation
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 KnowledgeRelation
impl Debug for KnowledgeRelation
Source§impl<'de> Deserialize<'de> for KnowledgeRelation
impl<'de> Deserialize<'de> for KnowledgeRelation
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 KnowledgeRelation
Source§impl PartialEq for KnowledgeRelation
impl PartialEq for KnowledgeRelation
Source§impl Serialize for KnowledgeRelation
impl Serialize for KnowledgeRelation
impl StructuralPartialEq for KnowledgeRelation
Auto Trait Implementations§
impl Freeze for KnowledgeRelation
impl RefUnwindSafe for KnowledgeRelation
impl Send for KnowledgeRelation
impl Sync for KnowledgeRelation
impl Unpin for KnowledgeRelation
impl UnsafeUnpin for KnowledgeRelation
impl UnwindSafe for KnowledgeRelation
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
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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.