我正在与NeoDash合作,以可视化一个因素,这是页面等级分数的结果,所需的输出通常是一个多行图表,这个因素在不同的国家多年来(以X轴)。我第一次测试了2019年一个国家的代码:
call gds.pageRank.stream("Morroco")
YIELD nodeId as names, score as score1
with gds.util.asNode(names).city AS city1, score1
ORDER BY score1 DESC, city1 ASC
call gds.pageRank.stream("other_countries")
YIELD nodeId as names, score AS score3
with gds.util.asNode(names).city AS city3, score3
ORDER BY score3 DESC, city3 ASC
with 2019 as x, score1/score3 as y
return x,y但我得到了下面的错误信息:
Variable `score1` not defined (line 9, column 17 (offset: 319))
"with 2019 as x, score1/score3 as y"ps:‘摩洛哥’图是一个过滤过的图形,它是关于这个格式的:(:n1) -:relation {->:,country:}->(:n2)我是neo4j的新手,如果你能帮我的话,我会很感激的,谢谢你。
发布于 2022-08-31 09:50:15
WITH在Neo4j中充当投影,因此您在WITH中指定的任何变量都将在查询中进一步显示。在查询中:
call gds.pageRank.stream("Morroco")
YIELD nodeId as names, score as score1
with gds.util.asNode(names).city AS city1, score1
ORDER BY score1 DESC, city1 ASC
call gds.pageRank.stream("other_countries")
YIELD nodeId as names, score AS score3
with gds.util.asNode(names).city AS city3, score3 <-- You missed score1 here
ORDER BY score3 DESC, city3 ASC
with 2019 as x, score1/score3 as y
return x,y试试这个:
call gds.pageRank.stream("Morroco")
YIELD nodeId as names, score as score1
with gds.util.asNode(names).city AS city1, score1
ORDER BY score1 DESC, city1 ASC
call gds.pageRank.stream("other_countries")
YIELD nodeId as names, score AS score3
with gds.util.asNode(names).city AS city3, score3, score1
ORDER BY score3 DESC, city3 ASC
with 2019 as x, score1/score3 as y
return x,yhttps://stackoverflow.com/questions/73553877
复制相似问题