Skip to main content

Crate arrow_graph_git

Crate arrow_graph_git 

Source
Expand description

arrow-git — Graph-native git primitives for Arrow-based knowledge graphs.

Provides 8 git primitives operating on Arrow RecordBatches, designed for versioning RDF-like knowledge graphs stored in arrow-graph-core.

§Primitives

  1. Object Store — the live GitObjectStore wrapping ArrowGraphStore
  2. Commit — snapshot state to Parquet + record in CommitsTable
  3. Checkout — restore state from a commit’s Parquet snapshot
  4. History DAG — traverse parent_ids for log and ancestors
  5. Branch/Head (Refs) — lightweight branch pointers via RefsTable
  6. Diff — object-level comparison between commits via diff()
  7. Merge — 3-way merge with conflict detection/resolution via merge()
  8. Save — crash-safe persistence without creating a commit via save()

§Performance (10K triples)

OperationMeasuredGate
Commit~3ms< 25ms
Checkout~1.3ms< 25ms
Commit+Checkout (H-GIT-1)~4.3ms< 50ms
Save+Restore (M-SAVE)~4.3ms< 100ms
Awakening (M-119)~1.3ms< 200ms
Batch add 10K~4.3ms< 10ms

§Merge Conflict Resolution

The merge() function detects conflicts (same subject+predicate with different objects across branches). Use merge_with_strategy for automatic resolution via MergeStrategy::Ours, MergeStrategy::Theirs, MergeStrategy::LastWriterWins, or a custom closure.

§Crash-Safe Persistence

save() uses a WAL marker + atomic file rename pattern. If a save is interrupted, the previous Parquet files remain valid. save_with_options adds zstd compression and incremental saves (only dirty namespaces).

Re-exports§

pub use blame::BlameEntry;
pub use blame::blame;
pub use checkout::checkout;
pub use cherry_pick::cherry_pick;
pub use commit::Commit;
pub use commit::CommitsTable;
pub use commit::create_commit;
pub use diff::DiffEntry;
pub use diff::DiffResult;
pub use diff::diff;
pub use diff::diff_nondestructive;
pub use history::ancestors;
pub use history::find_common_ancestor;
pub use history::log;
pub use merge::Conflict;
pub use merge::MergeResult;
pub use merge::MergeStrategy;
pub use merge::Resolution;
pub use merge::merge;
pub use merge::merge_with_strategy;
pub use object_store::GitConfig;
pub use object_store::GitObjectStore;
pub use rebase::RebaseResult;
pub use rebase::rebase;
pub use refs::Ref;
pub use refs::RefType;
pub use refs::RefsTable;
pub use remote::RemoteError;
pub use remote::Snapshot;
pub use remote::bytes_to_snapshot;
pub use remote::restore_snapshot;
pub use remote::snapshot_state;
pub use remote::snapshot_to_bytes;
pub use revert::revert;
pub use save::SaveMetrics;
pub use save::SaveOptions;
pub use save::persist_commits;
pub use save::restore;
pub use save::restore_commits;
pub use save::restore_full;
pub use save::restore_named_batches;
pub use save::save;
pub use save::save_full;
pub use save::save_named_batches;
pub use save::save_with_options;

Modules§

blame
Blame — per-triple provenance history.
checkout
Checkout — load a Parquet snapshot back into the ArrowGraphStore.
cherry_pick
Cherry-pick — apply a specific commit’s changes to the current branch.
commit
Commit — snapshot current graph state to Parquet + record in CommitsTable.
compat
Compatibility types for Namespace and Layer.
diff
Diff — object-level comparison between two commits.
history
History DAG — traversal of commit parent_ids to form a directed acyclic graph.
merge
Merge — 3-way merge with conflict detection.
object_store
Object Store — the live in-memory Arrow tables from arrow-graph-core.
rebase
Rebase — replay a sequence of commits onto a new base.
refs
Refs — branch and HEAD management.
remote
Remote — Push/Pull Graph State Over Any Transport
revert
Revert — create a new commit that undoes the changes from a target commit.
save
Save — persist current state without creating a commit (crash recovery).