Expand description
RocksGraph — a Gremlin-inspired property graph database engine backed by RocksDB.
§Quick start
use rocksgraph::{Graph, TraversalBuilder, Value};
// Read-write transaction
let mut tx = graph.begin();
tx.g().addV("person").property("id", 1).property("name", "alice").next().unwrap();
tx.g().addV("person").property("id", 2).property("name", "bob").next().unwrap();
tx.g().addE("knows").from(1).to(2).property("weight", 0.9f64).next().unwrap();
tx.commit().unwrap();
// Read-only snapshot query
let mut snap = graph.read();
let count = snap.g().V([1]).out(["knows"]).count().next().unwrap().unwrap();
assert_eq!(count, Value::Int64(1));
let names = snap.g().V([1]).out(["knows"]).values(["name"]).to_list().unwrap();
assert_eq!(names, vec![Value::String("bob".into())]);
for v in snap.g().V([]).out(["knows"]).iter().unwrap() { println!("{:?}", v.unwrap()); }§Architecture
Graph::open / graph.read() / graph.begin() ← api (pub)
│ session.g() → ReadTraversal / WriteTraversal
│ step methods: self → Self (move semantics)
│ terminals: .next()? / .to_list()? / .iter()?
▼
gremlin::traversal fluent builder → LogicalPlan AST
▼
planner AST → LogicalPlan IR + optimizer
▼
engine::volcano pull-based Volcano iterator pipeline
▼
graph query-scoped overlay (OCC dirty tracking)
▼
store / RocksDB OptimisticTransactionDBAll modules below api are pub(crate) — users only interact through
Graph, ReadSession, TxSession, and the traversal types re-exported
at the crate root.
Re-exports§
pub use api::Graph;pub use api::ReadSession;pub use api::TxSession;
Modules§
Structs§
- Built
Traversal - The result of building a traversal — a pull-based lazy iterator over results.
- Bulk
Edge - Bulk
Load Stats - Bulk
Schema - Bulk
Vertex - Edge
- A fully materialized directed edge with all its properties.
- Edge
List Source - Reads a SNAP-format edge list (one
src dstpair per line, comment lines start with#). - Map
- An ordered key-value map (output of
valueMap(),elementMap(), etc.). - Path
- A sequence of traversal positions, each tagged with zero or more step labels.
- Property
- A property element flowing through the pipeline (output of
.properties("name")). - Read
Traversal - A read-only traversal bound to a
ReadSessioncontext. - Rocks
Options - Storage-tuning options for the RocksDB backend.
- SstBulk
Loader - Loads a graph dataset into RocksDB at disk-write speed via SST ingestion.
- Vertex
- A fully materialized vertex with all its properties.
- Write
Traversal - A read-write traversal bound to a
TxSessioncontext.
Enums§
- Predicate
- A filter predicate for
.has()and.is()steps. - Primitive
- A scalar value that can appear as a property value or standalone scalar.
- Store
Error - Value
- The single user-facing value type for all traversal inputs and outputs.
Traits§
- Traversal
Builder - Shared read pipeline steps for both
ReadTraversalandWriteTraversal.
Functions§
- __
- Entry point for anonymous sub-traversals (mirrors Gremlin’s
__). - between
- Filter:
lo≤ value <hi. - eq
- Filter: equal to
v. - gt
- Filter: greater than
v. - gte
- Filter: greater than or equal to
v. - lt
- Filter: less than
v. - lte
- Filter: less than or equal to
v. - ne
- Filter: not equal to
v. - within
- Filter: value is one of
vs. - without
- Filter: value is none of
vs.