I am a Neo4J beginner, so, apologies in advance if my question is too trivial.
I am trying to create a Neo4J graph representing a set of consecutive steps in a game, as shown in this diagram.
You will see in the diagram that I start with zero points, and, at certain steps (but not in every step), additional points are accumulated.
I want to assign points to nodes that don't have points yet, according to the following principle: whenever a node does not have points, I want to assign to it a number of points equal to the points possessed by the closest previous node that has points assigned to it. In the sample diagram, step 2 would have 0 points (:Step {id: 2, points_so_far: 0}), and step 4 would have 1 point (:Step {id: 4, points_so_far: 1}). Note that there may be an arbitrary number of scoreless nodes between nodes that do have a score.
Any help in creating a respective Cypher query would be much appreciated!
Many thanks in advance!