1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! Knowledge graph: entities, relations, temporal versioning,
//! causal traversal, community detection, and external references.
//!
//! Implementations:
//! - [`adapters::MemoryGraphAdapter`] — full in-process graph (no external deps)
//! - `adapters::PostgresGraphAdapter` — Postgres-backed (stubbed)
//!
//! # Architecture
//!
//! The graph is **bitemporal** — each record carries both valid-time
//! (when the fact was true in the world) and system-time (when it was
//! recorded). Records are never deleted; they are retracted or superseded,
//! preserving full history.
//!
//! Causal traversal uses DFS with cycle detection. Shortest-path computation
//! uses Dijkstra via `petgraph`.
//!
//! Community detection supports connected-components (built-in) and the
//! Leiden algorithm (via a native extension, stubbed).
//!
//! # Quick start
//!
//! ```rust,no_run
//! use fornix::graph::{GraphAdapter, GraphConfig, adapters::MemoryGraphAdapter};
//! use fornix::graph::adapter::{EntitySearchOptions, CausalOptions};
//!
//! # async fn _doc() {
//! let g = MemoryGraphAdapter::connect(GraphConfig::default()).await.unwrap();
//!
//! let rain = g.create_entity("Heavy Rain", "Weather", None, None).await.unwrap();
//! let flood = g.create_entity("Flooding", "Event", None, None).await.unwrap();
//! g.create_relation(rain.id, flood.id, "CAUSES", None, None).await.unwrap();
//!
//! let paths = g.causal_descendants(rain.id, CausalOptions::default(), None).await.unwrap();
//! assert_eq!(paths[0].edges[0].relation_type, "CAUSES");
//! # }
//! ```
pub use ;
pub use GraphConfig;
pub use ;
pub use ;