PGX 20.2.2
Documentation

Exporting Graphs

Exporting into a File

PGX allows the client to export a currently loaded graph into a file. Using the store() method on any PgxGraph object, the client can specify which file format to store the graph in. The client can also dynamically select the set of properties to be stored with the graph — i.e., not all of the properties need to be exported. The client can specify a CompressionScheme to use when storing:

CompressionScheme Supported Formats
NONE All formats
GZIP ADJ_LIST, EDGE_LIST, FLAT_FILE, TWO_TABLES (text)

The client can export to multiple files as well, for more details see the following tutorial.

When PGX exports the specified graph into a file, PGX also creates a graph config which the client receives as return value. This is to help loading the created graph instance later.

When exporting graph data into multiple files a FileGraphStoringConfig can be used which contains the following JSON fields:

Field Type Description Default
base_pathstringbase path to use for storing a graph; file paths will be constructed using the following format _._, i.e. parent_path/my_graph_1.edgesnull
compression_schemeenum[none, gzip]the scheme to use for compression, or none to disable compressionnone
delimitercharacterdelimiter character used as separator when storing. The characters ", {, } and \n cannot be used as delimitersnull
edge_extensionstringthe extension to use when creating edge file partitionsedges
initial_partition_indexintegerthe value used as initial partition index, i.e. initial_partition_index=1024 -> my_graph_1024.edges, my_graph_1025.edges1
num_partitionsintegerthe number of partitions that should be created, when exporting to multiple files1
row_extensionstringthe extension to use when creating row file partitionsrows
vertex_extensionstringthe extension to use when creating vertex file partitionsnodes

For the partitioned graph, two maps of type Map<String, FileGraphStoringConfig> can be used: One for the vertex providers and one for the edge providers with the providers names as keys.

Exporting into Database

This feature is not available in PGX 20.2.2.