首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用NeoDash实现多线图可视化

用NeoDash实现多线图可视化
EN

Stack Overflow用户
提问于 2022-08-31 09:39:10
回答 1查看 24关注 0票数 0

我正在与NeoDash合作,以可视化一个因素,这是页面等级分数的结果,所需的输出通常是一个多行图表,这个因素在不同的国家多年来(以X轴)。我第一次测试了2019年一个国家的代码:

代码语言:javascript
复制
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

但我得到了下面的错误信息:

代码语言:javascript
复制
Variable `score1` not defined (line 9, column 17 (offset: 319))
"with 2019 as x, score1/score3 as y"

ps:‘摩洛哥’图是一个过滤过的图形,它是关于这个格式的:(:n1) -:relation {->:,country:}->(:n2)我是neo4j的新手,如果你能帮我的话,我会很感激的,谢谢你。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-08-31 09:50:15

WITH在Neo4j中充当投影,因此您在WITH中指定的任何变量都将在查询中进一步显示。在查询中:

代码语言:javascript
复制
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

试试这个:

代码语言:javascript
复制
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,y
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73553877

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档