DEV Community

Muhammad Muneeb Ur Rehman
Muhammad Muneeb Ur Rehman

Posted on

Load Vertices (Nodes) data from CSV file to Apache AGE

In Apache AGE, we can load the data of nodes/ vertices from CSV file as well.
A CSV file containing nodes' data should be formatted as following:
id:
It should be the first column of the file and all values should be a positive integer.

Properties:
All other columns should contain the properties for the nodes. Header row should contain the name of properties and rows below Header row should contain data. One row as a whole should be treated as one vertex.

First step is to create a label for the vertex.

Create Vertex Lable:
Syntax:
SELECT create_vlabel('GraphName','LabelName');

Second step is to get data from CSV file and create vertices.

Load Data from CSV:
Syntax:
SELECT load_labels_from_file('GraphName',
'LabelName',
'Path/to/file.csv');

For more details visit: https://age.apache.org/overview/

AGE Github Link: https://github.com/apache/age

AGE Viewer Github Link: https://github.com/apache/age-viewer

Top comments (0)