Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/kleene

crates/kleene-gar/src/lib.rs

//! X.gar tables for DataFusion, read in place.
//!
//! An X.gar directory is a graph-ar integer graph (`mapped` layout): one Arrow IPC file per
//! vertex column and per edge order, mapped from disk. [`GarGraph`] opens one; each vertex
//! type and each edge type becomes a [`GarTable`], a DataFusion `TableProvider` whose
//! columns are the mapped Arrow arrays themselves (no value is copied; the files stay mapped
//! while a table or a batch from it lives). [`GarSchema`] serves them as a DataFusion schema.
//!
//! | Table | Columns |
//! |---|---|
//! | vertex type `t` | `id` (the row number, made on scan) and every stored column of `t` |
//! | edge type `s_e_d` | `src` (made on scan from the by-source offsets), `dst` (the stored neighbours) and every edge property, in by-source row order |
//!
//! The graph path does not go through DataFusion: [`GarGraph::adjacency`] hands an edge
//! type's offsets and neighbours, both orders, as buffers that share the mapping.
//!
//! [`GarGraph::catalog`] reads the set's schema as kleene-plan's `Catalog` (labels, id blocks,
//! edge labels, node and edge properties by their Arrow types, refused columns by name), so
//! both query clients bind a set's relations and properties by name.
//!
//! Rows of two vertex types share their numbers; [`IdSpace`] numbers the set's types one
//! after the other ([`GarGraph::id_space`]), so a reader that joins nodes of two types
//! keys them by id ([`GarGraph::vertex_ids`] for a type's properties, the two ends' bases
//! for an edge type).

mod catalog;
mod chunked;
mod graph;
mod ids;
mod table;

pub use catalog::{ListRows, column_type, list_rows, unsigned_value, value_code};
pub use graph::{EdgeAdjacency, EdgeType, GarGraph};
pub use ids::IdSpace;
pub use table::{GarSchema, GarTable, TableKind};

pub use graphar::GraphArError;

/// The README's example, run as a doctest.
#[cfg(doctest)]
#[doc = include_str!("../README.md")]
struct ReadmeDoctests;