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 | Description |
24//! | --------------- | ----------- |
25//! | `PROPERTY_DESCRIPTORS_*` | Per-layer descriptor records (header + records + string table) |
26//! | `PROPERTY_DATA_*` | Concatenated Arrow IPC value and sparse-default streams |
27//!
28//! The `_U16` / `_U32` / `_U64` suffix selects the descriptor metadata word
29//! width. The payload format is owned by this crate and remains an
30//! OxGraph-internal ABI candidate while snapshot v1 bytes are not stable. All
31//! section-kind constants are `perf: unspecified` — compile-time `u32` tags.
32// kani-skip: property layers depend on Arrow heap arrays and snapshot byte streams outside Kani's
33// bounded no-std proof scope.
34
35pub mod model;
36pub mod rekey;
37pub mod snapshot;
38pub mod weights;
39pub mod width;
40
41pub use model::{
42    IdFamily, IdentityMapMode, IdentityModeRecord, IdentityModeSummary, IdentitySnapshotSummary,
43    LayerId, LayerName, LayerRole, MissingPolicy, PropertyError, PropertyLayer, PropertyLayerData,
44    PropertyLayerDescriptor, StorageMode,
45};
46pub use rekey::{rekey_layer_to_local, validate_unique_layer_ids, validate_unique_names};
47pub use snapshot::{
48    DecodedPropertyData, DecodedPropertyLayer, EncodedPropertySnapshot, PropertySnapshotRecord,
49    PropertySnapshotSummary, encode_graph_property_snapshot, encode_hyper_property_snapshot,
50    encode_property_snapshot, validate_identity_snapshot, validate_property_sections,
51    validate_property_snapshot,
52};
53pub use weights::{DenseWeights, GraphPropertyLayers, HyperPropertyLayers, SparseWeights};
54pub use width::{
55    AxisIndex, ElementAxis, IncidenceAxis, PropertyAxis, PropertyIndex, PropertySnapshotMetaWord,
56    RelationAxis, SNAPSHOT_KIND_ELEMENT_IDENTITY_MAP_U16, SNAPSHOT_KIND_ELEMENT_IDENTITY_MAP_U32,
57    SNAPSHOT_KIND_ELEMENT_IDENTITY_MAP_U64, SNAPSHOT_KIND_IDENTITY_MODES_U16,
58    SNAPSHOT_KIND_IDENTITY_MODES_U32, SNAPSHOT_KIND_IDENTITY_MODES_U64,
59    SNAPSHOT_KIND_INCIDENCE_IDENTITY_MAP_U16, SNAPSHOT_KIND_INCIDENCE_IDENTITY_MAP_U32,
60    SNAPSHOT_KIND_INCIDENCE_IDENTITY_MAP_U64, SNAPSHOT_KIND_PROPERTY_DATA_U16,
61    SNAPSHOT_KIND_PROPERTY_DATA_U32, SNAPSHOT_KIND_PROPERTY_DATA_U64,
62    SNAPSHOT_KIND_PROPERTY_DESCRIPTORS_U16, SNAPSHOT_KIND_PROPERTY_DESCRIPTORS_U32,
63    SNAPSHOT_KIND_PROPERTY_DESCRIPTORS_U64, SNAPSHOT_KIND_RELATION_IDENTITY_MAP_U16,
64    SNAPSHOT_KIND_RELATION_IDENTITY_MAP_U32, SNAPSHOT_KIND_RELATION_IDENTITY_MAP_U64,
65    SNAPSHOT_PROPERTY_VERSION,
66};
67
68#[cfg(test)]
69mod tests;