首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >将数据从Neo4j导出到地理信息库并不能显示所有节点

将数据从Neo4j导出到地理信息库并不能显示所有节点
EN

Stack Overflow用户
提问于 2022-05-27 12:11:16
回答 1查看 58关注 0票数 0

在从neo4j到gephi中提取数据(节点和关系)时,我面临着一个实际的问题。我正在使用apoc.gephi.add方法来完成这个任务。这种方法只提取neo4j查询中节点和关系的随机子集!

下面可以找到要从neo4j提取到地理信息的密码查询:

代码语言:javascript
运行
复制
  match (t1:tag)<-[:has]- (vid1:video)-[:recommends]->(vid2:video)-[:has]->(t2:tag)
where (t1.title contains 'ukraine' or t1.title contains 'russia') and not (t2.title contains 'ukraine' or t2.title contains 'russia') 
match (u1:user)-[:author]->(vid1)
match path = (u2:user)-[:author]->(vid2)
where u2.verified = 0 and size(u2.nickname) < 4  and u2.commerceUserInfo_commerceUser =1
CALL apoc.gephi.add(null,'workspace1',path,'weight',['title', 'diggCount','followerCount','followingCount','commentCount','heartCount','playCount','shareCount','videoQuality','uniqueId','verified']) yield nodes, relationships, time
return *

Neo4j显示了300个节点,其中6100个节点之间的关系如下所示:

Neo4j Resluts

然而,伤寒只显示了61个节点和32个关系!

伤寒结果

为什么会发生这种情况,以及如何将所有节点从neo4j导出到gephi?谢谢

EN

回答 1

Stack Overflow用户

发布于 2022-06-01 15:14:07

我很确定这不是一个apoc.gephi.add问题,而是一个错误的查询。

我的意思是,您执行了一个多个match,但是在您的apoc.gephi.add中只传递了path变量,这只是(u2:user)-[:author]->(vid2)部分,而不是在最后返回时执行return *,所以您也从其他matches返回所有变量。

如果您执行的是return path而不是return *,您应该只看到与附带的图像相同的结果。

所以我想你应该改变它,以便在你的伤寒手术中通过你所需要的一切。

我认为类似的事情(但它取决于您的数据集无论如何):

代码语言:javascript
运行
复制
match p1 = (t1:tag)<-[:has]-(vid1:video)-[:recommends]->(vid2:video)-[:has]->(t2:tag)
where (t1.title contains 'ukraine' or t1.title contains 'russia') and not (t2.title contains 'ukraine' or t2.title contains 'russia') 
match p2=(u1)-[:author]->(vid1)
match p3=(u2)-[:author]->(vid2)
where u2.verified = 0 and size(u2.nickname) < 4  and u2.commerceUserInfo_commerceUser =1
with [p1, p2, p3] as dataToAdd
CALL apoc.gephi.add(null,'workspace1', dataToAdd,'weight',['title', 'diggCount','followerCount','followingCount','commentCount','heartCount','playCount','shareCount','videoQuality','uniqueId','verified']) yield nodes, relationships, time
return dataToAdd, nodes, relationships, time
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72405275

复制
相关文章

相似问题

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