Expand description
Borrowed compressed-sparse-row graph views.
oxgraph-csr provides the first concrete graph layout for the substrate. A
CsrGraph borrows validated CSR offset and target slices and implements
storage-agnostic graph traits from oxgraph-graph.
CSR is optimized for outgoing traversal. Incoming traversal requires a CSC index or another reverse index and is intentionally not implemented here.
§Optional builder
The build feature enables append-only [build::GraphBuilder] and
[build::WeightedGraphBuilder] types, plus snapshot export helpers, in
the [build] submodule. The additional build-property-arrow feature
enables property-snapshot export via oxgraph-property.
§Snapshot section kinds
| Family | Description |
|---|---|
CSR_OFFSETS_* | CSR offsets array (node_count + 1 little-endian words) |
CSR_TARGETS_* | CSR targets array (one little-endian word per edge) |
The _U16 / _U32 / _U64 suffix selects the little-endian word width.
All section-kind constants are perf: unspecified — compile-time u32
tags.
Structs§
- CsrEdge
Id - Local edge ID for
CsrGraph. - CsrGraph
- Borrowed compressed-sparse-row graph view.
- CsrNode
Id - Local node ID for
CsrGraph. - CsrOut
Edges - Iterator over outgoing CSR edge slots.
- CsrOut
Neighbors - Iterator over outgoing CSR target nodes.
Enums§
- CsrError
- CSR validation error.
- CsrSnapshot
Error - Error returned when a snapshot cannot be opened as a CSR graph.
Constants§
- SNAPSHOT_
KIND_ CSR_ OFFSETS_ U16 - Section kind for a CSR
u16offsets array. - SNAPSHOT_
KIND_ CSR_ OFFSETS_ U32 - Section kind for a CSR
u32offsets array. - SNAPSHOT_
KIND_ CSR_ OFFSETS_ U64 - Section kind for a CSR
u64offsets array. - SNAPSHOT_
KIND_ CSR_ TARGETS_ U16 - Section kind for a CSR
u16targets array. - SNAPSHOT_
KIND_ CSR_ TARGETS_ U32 - Section kind for a CSR
u32targets array. - SNAPSHOT_
KIND_ CSR_ TARGETS_ U64 - Section kind for a CSR
u64targets array.
Traits§
- CsrIndex
- Unsigned native index type usable as a CSR node, edge, offset, and target.
- CsrSnapshot
Index - Portable index width usable for persisted CSR snapshot payloads.
- CsrSnapshot
Word - Little-endian zerocopy word usable when opening CSR data from a snapshot.
- CsrWord
- Integer word usable in borrowed CSR sections.
Type Aliases§
- CsrNative
Graph - Native borrowed CSR graph alias.
- CsrSnapshot
Graph - Snapshot-backed little-endian CSR graph alias.