Consider the following schema for in JanusGraph.
g.addV('node1').next()
g.addV('node2').next()
g.addV('node3').next()
g.V().hasLabel('node1').as('fromV').V().hasLabel('node2').as('toV').addE('rel').from('fromV').to('toV').property('property1',1).iterate()
g.V().hasLabel('node1').as('fromV').V().hasLabel('node3').as('toV').addE('rel1').from('fromV').to('toV').property('property2',2).iterate()
3 nodes: node1,node2 and node3 2 relations: node1->rel->node2 and node1->rel1->node3
I want the property2 for the rel1 relationship to be dependent on the property1 of rel relationship with formula 2*property1. Example: If property1=4 then property2=2 * 4=8
Is it possible to update the property2 automatically when the property1 is updated and how? If not possible automatically, how to update using queries?