Skip to main content

Module temporal_knowledge_graph

Module temporal_knowledge_graph 

Source
Expand description

Temporal Knowledge Graph — tracks how facts and relationships evolve over time.

§Overview

A TemporalKnowledgeGraph stores nodes and edges along with a timeline of events, allowing queries that ask “what was true at time T?” as well as full history queries.

§Quick start

use ipfrs_tensorlogic::temporal_knowledge_graph::{
    TemporalKnowledgeGraph, TkgQuery,
};

let mut g = TemporalKnowledgeGraph::new();
let alice = g.add_node("Alice".to_string(), 0).expect("example: should succeed in docs");
let bob   = g.add_node("Bob".to_string(),   0).expect("example: should succeed in docs");
let edge  = g.add_edge(alice, bob, "knows".to_string(), 1.0, 0).expect("example: should succeed in docs");

let snap = g.snapshot_at(10);
assert_eq!(snap.nodes.len(), 2);
assert_eq!(snap.edges.len(), 1);

Structs§

EdgeId
Unique identifier for an edge (16 opaque bytes).
NodeId
Unique identifier for a node (16 opaque bytes).
TemporalKnowledgeGraph
A temporal knowledge graph that records how facts and relationships change.
TkgEdge
A directed edge in the temporal knowledge graph.
TkgGraphStats
Aggregate statistics for the graph.
TkgNode
A node in the temporal knowledge graph.
TkgSnapshot
A point-in-time snapshot of the graph.

Enums§

TkgError
Errors produced by temporal knowledge graph operations.
TkgEvent
An event recorded in the graph timeline.
TkgMergePolicy
Conflict-resolution policy when merging two graphs.
TkgQuery
Query types supported by TemporalKnowledgeGraph.
TkgQueryResult
The result of a TkgQuery.