GDS and Virtual Graph

This is the public preview documentation of Neo4j Virtual Graph. To provide feedback, please use the feedback form you were granted access to.

During the public preview, we advise you not to use sensitive or production data with Virtual Graph.

Virtual Graph has limited support for Graph Data Science:

  • Only GDS sessions are supported (excluding plugin and write-backs)

  • Only Cypher® projections work but not native projections

The GDS call must be the last part of a query. Projections can be created via Cypher with a query like this:

MATCH <pattern>
RETURN gds.graph.project(...)

GDS long IDs

GDS uses the long ID of nodes to do projections. Long IDs are 63 bit unsigned integers and they must be stable outside between different transactions. In Virtual Graph the relational model doesn’t have built-in long IDs in the created tables and the users can define any data type they want for the key columns.

Therefore, in order to use GDS with Virtual Graph you must have an ID column defined in your schema for each element (node or relationship) which is:

  • not composite, i.e. a single column/property,

  • a 50 bit [1] unsigned integer, i.e. a value in the range of 0 amd 1.125.899.906.842.623 (one quadrillion),

  • unique within that source table.

Note that this is not a native requirement of Virtual Graph and only applies to using GDS. If you do a graph projection or run an algorithm on an element that doesn’t account for GDS' long IDs this way, Virtual Graph will throw an error.


1. 50 bits for the ID, 2 reserved bits and 12 bits to encode the table. This allows for 4096 node tables and 4096 relationship tables.