Skip to main content

Module schemas

Module schemas 

Source
Expand description

Canonical Arrow schemas for every Parquet file GraphForge reads or writes.

These constants are the single source of truth for column names, types, and nullability. All TableProvider implementations, relational lowering, and language bindings must reference these schemas rather than defining their own.

§Dual-key identity

Every node and edge row carries two identity columns:

ColumnTypePurpose
*_uuidFixedSizeBinary(16)Canonical UUIDv7 — stable, globally unique, never changes
*_idUInt64Surrogate assigned at scan time — used for DataFusion joins, never in API outputs

§File layout

topology/nodes.parquet            → TOPOLOGY_NODES_SCHEMA
topology/edges/TYPENAME.parquet   → TYPED_EDGE_SCHEMA
topology/edges/_exploratory.parquet → EXPLORATORY_EDGE_SCHEMA
properties/ENTITY_TYPE.parquet    → property_schema(entity_type, defs)
indexes/adjacency/index_manifest.parquet → ADJACENCY_MANIFEST_SCHEMA
indexes/adjacency/REL.out.csr     → ADJACENCY_CSR_SCHEMA (Arrow IPC, not Parquet)

Statics§

ADJACENCY_CSR_SCHEMA
Schema for indexes/adjacency/<REL_TYPE>.<dir>.csr (Arrow IPC, ADR 0005).
ADJACENCY_DELTA_SCHEMA
Schema for indexes/adjacency/deltas/<generation>.parquet (#765).
ADJACENCY_MANIFEST_SCHEMA
Schema for indexes/adjacency/index_manifest.parquet (ADR 0005).
EDGE_PROPERTY_BASE_SCHEMA
Minimal schema for edge_properties/REL_TYPE.parquet before per-relation columns are added. Contains only the join key (edge_uuid).
EXPLORATORY_EDGE_SCHEMA
Schema for topology/edges/_exploratory.parquet.
PROPERTY_BASE_SCHEMA
Minimal schema for properties/ENTITY_TYPE.parquet before per-type columns are added. Contains only the join key (node_uuid).
TOPOLOGY_NODES_SCHEMA
Schema for topology/nodes.parquet.
TYPED_EDGE_SCHEMA
Schema for topology/edges/TYPENAME.parquet.

Functions§

date_struct_fields
Struct{epoch_day: Int64} — a Cypher date typed value (ADR 0012): i64 days since the Unix epoch, spanning the full openCypher year range −999,999,999..+999,999,999. A self-describing one-field struct (a bare Int64 would be indistinguishable from an integer property on decode); orders chronologically. The single source of truth shared by storage and graphforge-rel. (#1011)
datetime_struct_fields
Struct{date: Int64, time: Time64(ns), offset: Int32, zone: Utf8} — a Cypher datetime typed value: a date+time (date = i64 days, #1011), its UTC offset in seconds, and an optional named IANA zone (null when offset-only) (ADR 0009/0012). Shared by storage and graphforge-rel.
duration_struct_fields
The Arrow fields of a typed Cypher duration value (ADR 0009): signed Struct{months: Int64, days: Int64, seconds: Int64, nanos: Int64}. A struct (not Arrow Interval) because Parquet cannot persist Interval(MonthDayNano); the single source of truth shared by storage and the graphforge-rel query value. months/days/seconds are Int64 and seconds is split from nanos so billion-year duration.between/inSeconds spans fit (#920/#1011); nanos is nanoseconds-of-second, sharing the sign of seconds.
localdatetime_struct_fields
Struct{date: Int64, time: Time64(ns)} — a Cypher localdatetime typed value (ADR 0009/0012). A two-field struct (not an epoch instant) so it spans the full openCypher year range at nanosecond precision; date is i64 days (#1011). The single source of truth shared by storage and the graphforge-rel value.
property_schema
Build a properties/ENTITY_TYPE.parquet schema for entity_type.
property_type_to_arrow
Map a PropertyValueType to its Arrow DataType.
result_schema
Build a query result schema with GraphForge pipeline metadata attached.
time_struct_fields
Struct{time: Time64(ns), offset: Int32} — a Cypher time typed value: a time-of-day plus its UTC offset in seconds (ADR 0009). Shared by storage and graphforge-rel. (#920)