如何实现Neo4j cypher查询对应的Gremlin查询?
我有以下 Cypher 查询(neo4j)并希望将其转换为 Gremlin 查询。
MATCH d=(a:Actor {id:" + entityId +'})-[r:ACTING_IN*0..2]-(m) WITH d,
RELATIONSHIPS(d) AS rels WHERE NONE (rel in r WHERE rel.Type = "Hollywood") RETURN *
UNION
MATCH d=(aa:Actor{id: " + entityId + "})-[rel:PRODUCER_OF*0..2]->(mm:Movie) WITH d,
RELATIONSHIPS(d) AS rels return *
请帮忙,谢谢:)
I have the following Cypher query(neo4j) and want to convert it to a Gremlin query.
MATCH d=(a:Actor {id:" + entityId +'})-[r:ACTING_IN*0..2]-(m) WITH d,
RELATIONSHIPS(d) AS rels WHERE NONE (rel in r WHERE rel.Type = "Hollywood") RETURN *
UNION
MATCH d=(aa:Actor{id: " + entityId + "})-[rel:PRODUCER_OF*0..2]->(mm:Movie) WITH d,
RELATIONSHIPS(d) AS rels return *
Please help, Thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我理解正确,那么您正在尝试运行 2 个可变长度模式来获取这些路径中遍历的路径和关系。
我认为下面的查询应该可以解决问题:
If I understand correctly, then you are trying to run 2 variable length patterns to get path and relationship traversed in those paths.
I think below query should do the trick: