B.4 Oracle Flat File Format

The Oracle flat file format exclusively describes property graphs. It is more concise and provides better data type support than the other file formats. The Oracle flat file format uses two files for a graph description, one for the vertices and one for edges. Commas separate the fields of the records.

Example B-4 Oracle Flat File Description of a Simple Property Graph

The following shows the Oracle flat files that describe the simple property graph example shown in What Are Property Graphs?.

Vertex file:

1,name,1,Alice,,
1,age,2,,31,
2,name,1,Bob,,
2,age,2,,27,

Edge file:

1,1,2,knows,type,1,friends,, 

The following shows the flat file description of the same graph for Tinkerpop 3, which has an additional field for storing the vertex label.

Vertex file:

1,name,1,Alice,,,person
1,age,2,,31,,person
2,name,1,Bob,,,person
2,age,2,,27,,person

Edge file:

3,1,2,knows,type,1,friends,, 

Methods are provided tto import and export graphs from and into Flat File format.

The following fragments of code show how to export a graph into Oracle Flat File Format. To import graphs, see Parallel Loading of Graph Data.

// Get graph instance
OraclePropertyGraph opg = OraclePropertyGraph.getInstance(args, szGraphName);

// Export graph into Flat File Format
String vertexFileName = "./mygraph.opv";
String edgeFileName = "./mygraph.ope";
int dop = 2;
Boolean append = false;
OraclePropertyGraphUtils.exportFlatFiles(opg,vertexFileName,edgeFileName,dop,append);