Skip to main content

oxgraph_property/
lib.rs

1//! Arrow-backed named property layers for `OxGraph` topology views.
2//!
3//! `oxgraph-property` is a higher layer than topology. It stores named typed
4//! Arrow arrays keyed by topology ID family and adapts selected total primitive
5//! layers into topology weight capabilities. Foundation crates do not depend on
6//! this crate, Arrow, or named properties.
7//!
8//! # Module layout
9//!
10//! The crate is split into focused modules and re-exports its full public API
11//! from this facade:
12//!
13//! | Module | Responsibility |
14//! | ------ | -------------- |
15//! | [`width`] | Index/metadata width contracts, axis markers, section-kind constants |
16//! | [`model`] | Layer data model, error type, identity records |
17//! | [`weights`] | Dense/sparse topology weight adapters and layer partitions |
18//! | [`rekey`] | Descriptor uniqueness checks and canonical-to-local rekeying |
19//! | [`snapshot`] | Snapshot encode/validate/decode and wire records |
20//!
21//! # Snapshot section kinds
22//!
23//! | Constant family | Base | Description |
24//! | --------------- | ---- | ----------- |
25//! | `PROPERTY_DESCRIPTORS` | [`SNAPSHOT_KIND_PROPERTY_DESCRIPTORS_BASE`] | Per-layer descriptor records (header + records + string table) |
26//! | `PROPERTY_DATA` | [`SNAPSHOT_KIND_PROPERTY_DATA_BASE`] | Concatenated Arrow IPC value and sparse-default streams |
27//!
28//! Each persisted kind is `BASE | WIDTH_CODE`, where the two-bit width code
29//! (`0b00` = `u16`, `0b01` = `u32`, `0b10` = `u64`) selects the descriptor
30//! metadata word width; [`PropertySnapshotMetaWord`] derives the per-width
31//! kinds. The payload format is owned by this crate and remains an
32//! OxGraph-internal ABI candidate while the snapshot bytes are not stable. All
33//! section-kind constants are `perf: unspecified` — compile-time `u32` tags.
34// kani-skip: property layers depend on Arrow heap arrays and snapshot byte streams outside Kani's
35// bounded no-std proof scope.
36
37pub mod export;
38pub mod model;
39pub mod rekey;
40pub mod snapshot;
41pub mod weights;
42pub mod width;
43
44pub use model::{
45    IdFamily, IdentityMapMode, IdentityModeRecord, IdentityModeSummary, IdentitySnapshotSummary,
46    LayerId, LayerName, LayerRole, MissingPolicy, PropertyError, PropertyLayer, PropertyLayerData,
47    PropertyLayerDescriptor, StorageMode,
48};
49pub use rekey::{rekey_layer_to_local, validate_unique_layer_ids, validate_unique_names};
50pub use snapshot::{
51    DecodedPropertyData, DecodedPropertyLayer, EncodedPropertySnapshot, PropertySnapshotRecord,
52    PropertySnapshotSummary, encode_graph_property_snapshot, encode_hyper_property_snapshot,
53    encode_property_snapshot, validate_identity_snapshot, validate_property_sections,
54    validate_property_snapshot,
55};
56pub use weights::{DenseWeights, GraphPropertyLayers, HyperPropertyLayers, SparseWeights};
57pub use width::{
58    AxisIndex, ElementAxis, IncidenceAxis, PropertyAxis, PropertyIndex, PropertySnapshotMetaWord,
59    RelationAxis, SNAPSHOT_KIND_ELEMENT_IDENTITY_MAP_BASE, SNAPSHOT_KIND_IDENTITY_MODES_BASE,
60    SNAPSHOT_KIND_INCIDENCE_IDENTITY_MAP_BASE, SNAPSHOT_KIND_PROPERTY_DATA_BASE,
61    SNAPSHOT_KIND_PROPERTY_DESCRIPTORS_BASE, SNAPSHOT_KIND_RELATION_IDENTITY_MAP_BASE,
62    SNAPSHOT_PROPERTY_VERSION,
63};
64
65#[cfg(test)]
66mod tests;