My data structure is:
Node node1 = graphDb.createNode();
node1.setProperty("id", "123");
Node node2 = graphDb.createNode();
node1.setProperty("id", "456");
Node node3 = graphDb.createNode();
node1.setProperty("id", "789");
node1.createRelationshipTo(node2, RelTypes.HASFOLLOW);
node1.createRelationshipTo(node3, RelTypes.HASFOLLOW);
node2.createRelationshipTo(node3, RelTypes.HASFOLLOW);
I want to query node1's followers (node2, node3) and query who is followed by node3 (node 1, node2).
final ExecutionEngine engine = new ExecutionEngine(graphDb);
ExecutionResult result = engine.execute("START n=node(*) RETURN n.id");
How to write code like above?