0

I am using this query to load edges from a CSV file in agload_test_graph, this graph is already being created.

SELECT load_edges_from_file('agload_test_graph', 'has_city',
     '/home/kamleshk/age_installation/age-viewer/sample/DIRECTED[person&movie].csv');

The content of the CSV files is:

enter image description here

But it return error: Label_id must be 1 .. 65535

What mistake Am I doing?

cybersam
  • 63,203
  • 6
  • 53
  • 76
Kamlesh Kumar
  • 351
  • 1
  • 7

3 Answers3

1

You need to provide the IDs of both the start and end nodes, like this:

start_id, start_vertex_type, end_id, end_vertex_type
153     , City             , 3     , Country

Make sure you've created the nodes first. Example files can be viewed here

Wendel
  • 763
  • 1
  • 12
0

This error occurs when the label has not yet been created and you try to use the label inside the function load_edges_from_file. The way this function works is that you need to pass a label that has already been created because internally it uses the label_id associated with a label (a sequence number will be given to a label only when it has been created) and if the label does not exist, then the label_id is set to 0 in the function and that is where this error occurs

ERROR: label_id must be 1 .. 65535

So, a fix would be

SELECT create_elabel('agload_test_graph','has_city');
SELECT load_edges_from_file('agload_test_graph', 'has_city',
'age_load/data/edges.csv');

Reference: agload documentation

Zainab Saad
  • 728
  • 1
  • 2
  • 8
0

Your label has not been created before it is being used so, as mentioned in the responses above, it is important to generate the label before sending it as an argument to the method load_edged_from_file. It will also be beneficial if you provide IDs for the start and finish nodes.