nodes edge.from
and edge.to
will be created if not in base
# Create an edge
# nodes `edge.from` and `edge.to` will be created if not in base
fun save_edge(edge: NeoEdge) do
if edge.id != null or edge.batch_id != null then return
# create nodes
save_node(edge.from)
save_node(edge.to)
# create edge
var job = new_job(edge)
edge.batch_id = job.id
job.action = create_edge_action
job.method = "POST"
if edge.from.id != null then
job.to = "/node/{edge.from.id.to_s}/relationships"
else
job.to = "\{{edge.from.batch_id.to_s}\}/relationships"
end
job.body = edge.to_rest
end
lib/neo4j/neo4j.nit:878,2--896,4