Data Types and Collections in the Graph Server (PGX)

This guide provides you the list of the supported data types and collections in the graph server (PGX).

Primitive Data Types

The following section explains the primitive data types supported by the graph server (PGX) and their limitations.

PGX supports the following primitive data types.:

Note:

All properties and scalar variables must be one of the above preceding data types. See Managing Transient Data for more information on handling transient properties and scalar variables.

The following table presents the overview of the supported data types, their integration in different languages and APIs and their minimum and maximum value limitations.

Note:

Table: Overview of Data types

Data Type Loading & Storing PGX Java API PGQL and Filter Expression Minimum Value Limitation Maximum Value Limitation
string string String STRING - -
int/integer int/integer int INT/INTEGER -2147483648 2147483647
long long long LONG -9223372036854775808 -9223372036854775807
float float float FLOAT 1.4E-45 3.4028235e+38
double double double DOUBLE 4.9E-324 1.7976931348623157E308
boolean boolean boolean BOOLEAN - -
date local_date LocalDate DATE -5877641-06-23 5881580-07-11
time time LocalTime TIME 00:00:00.000 23:59:59.999
timestamp timestamp LocalDateTime TIMESTAMP -292275055-05-17 00:00:00.000 292278994-08-17 07:12:55.807
time with time zone time_with_timezone OffsetTime TIME WITH TIME ZONE 00:00:00.000+18:00 23:59:59.999-18:00
timestamp with time zone timestamp_with_timezone OffsetDateTime TIMESTAMP WITH TIME ZONE -292275055-05-17 00:00:00.000+18:00 292278994-08-17 07:12:55.807-18:00
vertex - PgxVertex - - -
edge - PgxEdge - - -

Collections

The graph server (PGX) supports three different collection types: sequence, set and order. All of these collections can contain values of the vertex type, but each has different semantics regarding uniqueness and preserving the order of its elements:

See Collection Data Types for examples on creation and usage of the different collections.

Immutable Collections

Some operations, like PgxGraph.getVertices() and PgxGraph.getEdges() return immutable collections. These collections behave like normal collections, but cannot be modified by operations like addAll or removeAll and clear.

An immutable collection can be transformed into a mutable collection by using the toMutable method, which returns a mutable copy of the collection. If toMutable is called on a collection that is already mutable, the method has the same result as the method clone.

To check if a collection is mutable, use the isMutable method.

Maps

PGX provides the following two kinds of maps:

See Map Data Types for examples on creation and usage of maps.