【问题标题】:Neo4J: checking if list elements are featured in matched nodesNeo4J:检查匹配节点中是否包含列表元素
【发布时间】:2018-07-16 13:22:59
【问题描述】:

我的 Neo4j 查询不工作 - 我不知道为什么。

match (entry:Entry)
with split("\some space delimited string", " ") as i, 
split("\some space delimited string", " ") as j

where (any (x in entry.X.list where x in i) and any(y in entry.Y.list 
where y in j) and entry.parent="test_1.csv")
return entry

“Entry”节点的属性由 X、Y 和 Z 参数组成。

我正在尝试使用 py2neo 将列表的 2 个字符串表示形式传递到密码查询中,过滤包含某些坐标框架中 2 个列表的任何元素的交集的节点(即条目的 X节点有一个来自列表'i'的元素并且入口节点的Y有一个来自列表'j'的元素) - 然后返回条目。

但是,当我在 Neo4J 浏览器中运行查询时,它告诉我没有定义变量“entry”。

【问题讨论】:

    标签: python neo4j cypher py2neo


    【解决方案1】:

    WITH 子句用于(除其他外)重新定义范围内的变量。由于您没有在 WITH 子句中包含 entry,因此它超出了范围,因此您无法在该点之后使用它,因此出现错误。

    要解决此问题,只需在 WITH 子句中添加 entry 以及 ij

    ...
    with entry, split("\some space delimited string", " ") as i, 
    split("\some space delimited string", " ") as j
    ...
    

    【讨论】:

      猜你喜欢
      • 2020-05-18
      • 2014-07-31
      • 1970-01-01
      • 2022-09-23
      • 2015-10-03
      • 2017-11-20
      • 2014-04-30
      • 2016-05-12
      • 1970-01-01
      相关资源
      最近更新 更多