So I have a csv with this header:
start_id,strength,start_verse,end_verse
Two line examples are these:
01001001,15,38012001,00000000
01001001,16,20008022,20008030
The first line means that the node with id 01001001
connects with strength 15 with the node id 38012001
.
The second line means that the node id 01001001
connects with strength 16 to all the nodes between 20008022
and 20008030
, sequentially, and here is where lies my problem:
How can I use Apache AGE to connect one vertex to all vertexes in a group?
I was using the load csv feature, but if anyone know any other means to do so, I am all ears.
2
Answers
Unfortunately, Apache AGE currently does not have a function that creates edges in that way. However, you can use a Cypher query to establish relationships between vertices if they have a property like ‘id’ or any other distinguishing property.
In this way, you can create the vertices using the ‘load_labels_from_file()’ function (more about it here), and then use a Cypher query like this:
Since there is currently no shortcut to achieve exactly what you are looking for, it may be easier to simply edit the CSV file to create new rows for each connections with strength 16, for example:
Which then you can just import into AGE. It is relatively easy to do this change rather than manually making the connection inside AGE in my opinion.