Making relationship of two node in same row in csv

Hello, I'm new to Neo4j and trying to make a simple relationship graph

from | to

a | b

a | c

b | d

b | e

In this csv file, what I'm trying to make is a->b, a->c, b->d, b-> e relationship

i tried

"""

LOAD CSV WITH HEADERS FROM "file:///lg4neo.csv" AS f

MATCH (e1:Event {id: f.frompan}), (e2:Event {id: f.toPan})

return (e1)-[:DF_mat]->(e2)

"""

but didn't worked.

If someone could help me, it would be very appreciated.

Thanks

thank you, this really helped me!

really appreciated:)

Try this:

LOAD CSV WITH HEADERS FROM "file:///lg4neo.csv" AS row
merge (e1:Event {id: row.fromPan})
merge (e2:Event {id: row.toPan})
merge (e1)-[:DF_mat]->(e2)

Screen Shot 2022-07-26 at 9.47.38 AM.png

thank you, this really helped me!!

really appreciated:)