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§
- Agtype
Conversion Error - Entity
Kind - Entity kind carried by an agtype envelope map.
Constants§
- AGTYPE_
KIND_ KEY - Reserved map key that tags a
Value::Mapas 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_typeenum ordinal, used verbatim inside AGE error messages such asabs() unsupported argument agtype 1. - cmp
- Total order over agtype values, matching AGE’s
ORDER BYsemantics (ascending;nullsorts last, soDESCputs it first). - edge_
end_ id end_idof an edge envelope.- edge_
start_ id start_idof an edge envelope.- edge_
to_ value - Wrap an
Edgeinto its agtype envelope value. - entity_
id - Graph id of a vertex / edge envelope.
- entity_
kind - Entity kind of an envelope value, or
Nonefor 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:
float8outplus a trailing.0when the output has no./ exponent / special marker, so floats stay visually distinct from integers (100.0,-0.0,1e+15,NaN). - format_
float_ pg PostgreSQLfloat8outshortest-round-trip formatting: fixed notation while the decimal exponent is in[-4, 15), scientific (1e+15,1e-05) otherwise,NaN/Infinityspelled 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::Nullrenders asnull(the in-container spelling). - vertex_
to_ value - Wrap a
Vertexinto its agtype envelope value.