pub struct ProvenancedTriple {
pub subject: String,
pub predicate: String,
pub object: String,
pub source_id: String,
pub confidence: f64,
pub timestamp: u64,
}Expand description
A knowledge triple with provenance and confidence metadata.
Fields§
§subject: StringSubject.
predicate: StringPredicate.
object: StringObject.
source_id: StringSource identifier that contributed this triple.
confidence: f64Confidence in [0, 1] from the originating source.
timestamp: u64Timestamp of the triple (epoch seconds, 0 if unknown).
Implementations§
Source§impl ProvenancedTriple
impl ProvenancedTriple
Sourcepub fn new(
subject: impl Into<String>,
predicate: impl Into<String>,
object: impl Into<String>,
source_id: impl Into<String>,
confidence: f64,
) -> Self
pub fn new( subject: impl Into<String>, predicate: impl Into<String>, object: impl Into<String>, source_id: impl Into<String>, confidence: f64, ) -> Self
Create a new provenanced triple.
Sourcepub fn with_timestamp(self, ts: u64) -> Self
pub fn with_timestamp(self, ts: u64) -> Self
Set the timestamp.
Sourcepub fn triple_key(&self) -> (String, String, String)
pub fn triple_key(&self) -> (String, String, String)
Canonical key for deduplication: (subject, predicate, object).
Trait Implementations§
Source§impl Clone for ProvenancedTriple
impl Clone for ProvenancedTriple
Source§fn clone(&self) -> ProvenancedTriple
fn clone(&self) -> ProvenancedTriple
Returns a duplicate of the value. Read more
1.0.0 · 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 ProvenancedTriple
impl Debug for ProvenancedTriple
Source§impl PartialEq for ProvenancedTriple
impl PartialEq for ProvenancedTriple
impl StructuralPartialEq for ProvenancedTriple
Auto Trait Implementations§
impl Freeze for ProvenancedTriple
impl RefUnwindSafe for ProvenancedTriple
impl Send for ProvenancedTriple
impl Sync for ProvenancedTriple
impl Unpin for ProvenancedTriple
impl UnsafeUnpin for ProvenancedTriple
impl UnwindSafe for ProvenancedTriple
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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