Python 获取边的开始节点和结束节点id,而不使用neptune的map step()gremline
我正在研究Neptune AWS,并尝试细化边缘的开始节点id和结束节点id。映射步骤适用于Neo4j,但相同的查询不适用于Neptune 数据示例: 查询:Python 获取边的开始节点和结束节点id,而不使用neptune的map step()gremline,python,python-3.x,gremlin,gremlin-server,amazon-neptune,Python,Python 3.x,Gremlin,Gremlin Server,Amazon Neptune,我正在研究Neptune AWS,并尝试细化边缘的开始节点id和结束节点id。映射步骤适用于Neo4j,但相同的查询不适用于Neptune 数据示例: 查询: query = """g.V().hasLabel('Person').has("name", "marko").as("from", "to") .repeat(bothE().as("e").otherV().as("to").as("to")).times(2).emit(hasLabel("Person"))
query = """g.V().hasLabel('Person').has("name", "marko").as("from", "to")
.repeat(bothE().as("e").otherV().as("to").as("to")).times(2).emit(hasLabel("Person")).hasLabel("Person").has("name", "josh")
.project("name", "Label","start", "end")
.by(select(all, "to").unfold().values("title").fold())
.by(select(all, "to").unfold().label().fold())
.by(select(all, "e").unfold().id().map{g.E(it.get()).next()}.outV().id().fold())
.by(select(all, "e").unfold().id().map{g.E(it.get()).next()}.inV().id().fold())
"""
这是海王星的错误,但它在Neo4j上工作。是否有其他方法获取开始和结束节点id。我不确定是否了解您需要执行此操作的原因:
.by(select(all, "e").unfold().id().map{g.E(it.get()).next()}.outV().id().fold())
这不是简化为:
.by(select(all, "e").unfold().outV().id().fold())
这将消除lambdas,我想这是你与海王星的问题。是的,我知道,在移除地图步骤后,其工作原理相同。非常感谢。