arrow-graph-core
Arrow-native graph store with configurable namespace partitioning.
Store RDF-like triples in Apache Arrow RecordBatches with:
- Configurable namespaces — partition your graph by any string key
- Optional layer column — sub-partition within namespaces (e.g., for knowledge layers)
- Provenance tracking — causal chains, source documents, confidence scores
- Zero-copy operations — queries filter Arrow RecordBatches without materialization
- Schema versioning — read-path migration when schemas evolve
Quick Start
use ;
// Create a store with your own namespace partitions
let mut store = new;
let triple = Triple ;
let id = store.add_triple.unwrap;
assert_eq!;
// Query by subject
let results = store.query.unwrap;
Three API Levels
| Level | Type | Use Case |
|---|---|---|
| Raw | ArrowGraphStore |
Full control over namespaces and layers |
| Simple | SimpleTripleStore |
Default namespace, simplified add/query/remove |
| KG | KgStore |
URI prefix management, keyword search, gap tracking |
SimpleTripleStore
use SimpleTripleStore;
let mut store = new;
let id = store.add.unwrap;
let results = store.query.unwrap;
store.remove.unwrap;
KgStore (Knowledge Graph)
use KgStore;
let mut store = new;
store.bind_prefix;
store.add_triple.unwrap;
// Keyword search (case-insensitive)
let results = store.search_by_keywords;
Causal Chains
Track provenance with caused_by and derived_from links:
use ;
let mut store = new;
let t0 = Triple ;
let id0 = store.add_triple.unwrap;
let t1 = Triple ;
let id1 = store.add_triple.unwrap;
// Traverse the causal chain
let chain = store.causal_chain;
assert_eq!; // t1 → t0
Schema
The triples table has 16 columns (v1.1.0):
| Column | Type | Description |
|---|---|---|
triple_id |
Utf8 | UUID (auto-generated) |
subject |
Utf8 | RDF subject |
predicate |
Utf8 | RDF predicate |
object |
Utf8 | RDF object |
graph |
Utf8? | Named graph / context |
namespace |
Utf8 | Partition key |
layer |
UInt8 | Sub-partition (0 if unused) |
confidence |
Float64? | Confidence score |
source_document |
Utf8? | Provenance path |
source_chunk_id |
Utf8? | FK to chunks table |
extracted_by |
Utf8? | Creator agent |
created_at |
Timestamp(ms) | Creation time |
caused_by |
Utf8? | Causal predecessor |
derived_from |
Utf8? | Derivation source |
consolidated_at |
Timestamp(ms)? | Consolidation time |
deleted |
Boolean | Logical delete flag |
Access columns by name constant: col::SUBJECT, col::PREDICATE, etc.
License
MIT