pub struct GraphEdge {Show 14 fields
pub id: EdgeId,
pub source: MemoryId,
pub target: MemoryId,
pub relation: EdgeRelation,
pub weight: f32,
pub co_retrieval_count: u64,
pub created_at: Timestamp,
pub updated_at: Timestamp,
pub valid_from: Option<Timestamp>,
pub valid_until: Option<Timestamp>,
pub metadata: Metadata,
pub resolved: bool,
pub namespace: Namespace,
pub causal: Option<Box<CausalEdgeData>>,
}Expand description
A typed, weighted edge in the property graph.
Fields§
§id: EdgeId§source: MemoryId§target: MemoryId§relation: EdgeRelation§weight: f32§co_retrieval_count: u64§created_at: Timestamp§updated_at: Timestamp§valid_from: Option<Timestamp>§valid_until: Option<Timestamp>§metadata: Metadata§resolved: boolWhether this contradiction has been resolved by ABA reconsolidation.
namespace: NamespaceNamespace of the source node (inherited at edge creation).
causal: Option<Box<CausalEdgeData>>Causal-specific metadata. None for non-causal edges, keeping the
struct small (16 bytes vs ~128 bytes with 7 inlined optionals).
Implementations§
Source§impl GraphEdge
impl GraphEdge
Sourcepub fn confidence(&self) -> Option<f32>
pub fn confidence(&self) -> Option<f32>
Causal confidence, or None if this is not a causal edge.
Sourcepub fn evidence_count(&self) -> Option<u32>
pub fn evidence_count(&self) -> Option<u32>
Evidence count, or None if this is not a causal edge.
Sourcepub fn confounders(&self) -> Option<&[String]>
pub fn confounders(&self) -> Option<&[String]>
Confounders slice, or None if this is not a causal edge.
Sourcepub fn provenance(&self) -> Option<&str>
pub fn provenance(&self) -> Option<&str>
Provenance, or None if this is not a causal edge or provenance is unset.
Sourcepub fn mechanism(&self) -> Option<&str>
pub fn mechanism(&self) -> Option<&str>
Mechanism, or None if this is not a causal edge or mechanism is unset.
Sourcepub fn direction(&self) -> Option<CausalDirection>
pub fn direction(&self) -> Option<CausalDirection>
Causal direction, or None if this is not a causal edge or direction is unset.
Sourcepub fn relevance_score(&self) -> Option<f32>
pub fn relevance_score(&self) -> Option<f32>
Causal relevance score: strength × confidence × ln(1 + evidence_count).
Returns None if this edge has no causal metadata. A higher score
indicates stronger, more certain causal evidence.
Sourcepub fn is_valid_at(&self, as_of: Timestamp) -> bool
pub fn is_valid_at(&self, as_of: Timestamp) -> bool
Whether this edge is valid at the given point in time.
An edge is valid at as_of when:
valid_fromisNoneORvalid_from <= as_of, ANDvalid_untilisNoneORvalid_until > as_of
Sourcepub fn is_currently_active(&self) -> bool
pub fn is_currently_active(&self) -> bool
Whether this edge is currently active (not yet expired).
Equivalent to is_valid_at(Timestamp::now()).