Skip to main content

Module agtype

Module agtype 

Source
Expand description

Canonical Apache AGE agtype value model and text rendering.

AGE renders every Cypher result as agtype text: JSON-like output with JSONB object-key ordering (shorter keys first, ties bytewise), ::vertex / ::edge / ::path suffixes on graph entities, PostgreSQL float8out shortest-round-trip float formatting (plus a trailing .0 when the output would otherwise look integral), and ", " / ": " separators. This module reproduces that rendering byte-for-byte against AGE 1.6.0 and defines the total ordering agtype uses for ORDER BY and comparison operators: path < edge < vertex < object < list < string < bool < number < null.

Graph entities travel through the Cypher pipeline as tagged Value::Map envelopes (see AGTYPE_KIND_KEY) so vertices, edges, and paths survive WITH projections, collect(...), and map/list nesting without a dedicated enum variant in uqa_core.

Enums§

AgtypeConversionError
EntityKind
Entity kind carried by an agtype envelope map.

Constants§

AGTYPE_KIND_KEY
Reserved map key that tags a Value::Map as a graph-entity envelope. The key cannot be produced by Cypher map literals (map keys are identifiers or quoted names without @ in this dialect).

Functions§

agtype_type_name
Human-readable agtype type name used in cast error messages (cannot cast agtype integer to type boolean).
agtype_type_ordinal
AGE agtype_value_type enum ordinal, used verbatim inside AGE error messages such as abs() unsupported argument agtype 1.
cmp
Total order over agtype values, matching AGE’s ORDER BY semantics (ascending; null sorts last, so DESC puts it first).
edge_end_id
end_id of an edge envelope.
edge_start_id
start_id of an edge envelope.
edge_to_value
Wrap an Edge into its agtype envelope value.
entity_id
Graph id of a vertex / edge envelope.
entity_kind
Entity kind of an envelope value, or None for plain values.
entity_label
Label of a vertex / edge envelope.
entity_properties
Property map of a vertex / edge envelope.
eq
agtype equality (= / <> with non-null operands): numbers compare by value across int / float, everything else structurally via the total order.
format_float_agtype
agtype float rendering: float8out plus a trailing .0 when the output has no . / exponent / special marker, so floats stay visually distinct from integers (100.0, -0.0, 1e+15, NaN).
format_float_pg
PostgreSQL float8out shortest-round-trip formatting: fixed notation while the decimal exponent is in [-4, 15), scientific (1e+15, 1e-05) otherwise, NaN / Infinity spelled out.
jsonb_key_cmp
JSONB object-key ordering: shorter keys first, ties bytewise.
path_elements
Ordered elements of a path envelope.
path_to_value
Wrap an ordered vertex/edge element sequence into a path envelope. Elements must already be vertex / edge envelopes.
render
Canonical agtype text of a value. Top-level SQL NULL handling is the caller’s concern; a bare Value::Null renders as null (the in-container spelling).
vertex_to_value
Wrap a Vertex into its agtype envelope value.