我的数据结构是:
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);
我想查询node1的关注者(node2,node3)并查询谁跟随node3(node1,node2)。
final ExecutionEngine engine = new ExecutionEngine(graphDb);
ExecutionResult result = engine.execute("START n=node(*) RETURN n.id");
如何编写上面的代码?