Expand description
§Fabula
Incremental pattern matching over temporal graphs.
Fabula finds patterns in graphs where edges have validity intervals. You define patterns (“find a character whose loyalty dropped after an institutional failure, with no trust recovery in between”), register them with the engine, and it tracks partial matches incrementally as new edges arrive.
§Crate Structure
fabula(this crate) — core library with zero dependencies. Pattern types, theDataSourcetrait, Allen interval algebra, theSiftEngine.fabula-memory—MemGraph, a simple in-memoryDataSourcefor testing.fabula-petgraph—DataSourceadapter wrappingpetgraph::StableGraph.fabula-grafeo—DataSourceadapter for the Grafeo graph database.
§Quick Start
use fabula::prelude::*;
// Define a pattern: two betrayals by the same character
let pattern = PatternBuilder::<String, String>::new("double_betrayal")
.stage("e1", |s| s
.edge("e1", "eventType".to_string(), "betray".to_string())
.edge_bind("e1", "actor".to_string(), "char"))
.stage("e2", |s| s
.edge("e2", "eventType".to_string(), "betray".to_string())
.edge_bind("e2", "actor".to_string(), "char"))
.build();
assert_eq!(pattern.stages.len(), 2);
assert_eq!(pattern.name, "double_betrayal");For full evaluation examples, see fabula-memory which provides MemGraph.
Modules§
- builder
- Ergonomic builder API for constructing patterns.
- compose
- Pattern composition operators — build complex patterns from simpler ones.
- datasource
- The
DataSourcetrait — how fabula queries a temporal graph. - engine
- The sift engine — pattern registration, batch evaluation, incremental matching, and gap analysis.
- interval
- Allen’s interval algebra over generic time types.
- pattern
- Pattern types — the compiled representation of a sifting query.
- prelude
- Convenience re-exports for common usage.
- scoring
- Statistical surprise scoring for pattern matches.