I'm using a neo4. 4.3.3 community server on an Ubuntu 20.04.3 machine
I have the following problem: I have a set of X and a set of Y object.
So I start with
MATCH (x:X) MATCH (y:Y)
Now, I need to create a relationship between each X object and Y object (an n*m cartesian product), with some attributes on the relationships, something like the following:
MERGE (x)-[r:IS_REL]->(y) SET r.a = 0 if ((x.a > 0 AND y.a = 0) OR (x.a = 0 AND y.a > 0)) r.a = (abs(x.a - y.a) * 1.5) else r.b = 0 if ((x.b > 0 AND y.b = 0) OR (x.b = 0 AND y.b > 0)) r.b = (abs(x.b - y.b) * 1.0) else
I spent a lot of time trying a lot of different approaches, with no success.
I also tried to implement it using apoc.case, but failing.
Can someone help?