如何使用gds.version()1.7.2创建neo4J多画像?

发布于 2025-01-24 11:57:33 字数 563 浏览 1 评论 0原文

我想投射一个包含多个节点和关系类型的子图。在GDS 2.0中有一个( https://neo4j.com/ docs/graph-data-science/current/graph-project/):

CALL gds.graph.project(
  'personsAndBooks',    
  ['Person', 'Book'],   
  ['KNOWS', 'READ']     
)
YIELD
  graphName AS graph, nodeProjection, nodeCount AS nodes, relationshipCount AS rels

我想使用类似的事情,使用gds 1.7.2 gds.graph.create.create.cypher,但是节点Edge选择仅列出列表。谁能建议该怎么做?

I want to project a subgraph that contains multiple nodes and relationship types. In gds 2.0 there is this (https://neo4j.com/docs/graph-data-science/current/graph-project/):

CALL gds.graph.project(
  'personsAndBooks',    
  ['Person', 'Book'],   
  ['KNOWS', 'READ']     
)
YIELD
  graphName AS graph, nodeProjection, nodeCount AS nodes, relationshipCount AS rels

I want to do something similar, using gds 1.7.2 gds.graph.create.cypher, but the node and edge selection only take strings not lists. Can anyone suggest how to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

走过海棠暮 2025-01-31 11:57:33

我认为您正在寻找gds.graph.create过程( doc ),这是GDS先前版本中project等效的:

CALL gds.graph.create(
  'personsAndBooks',    
  ['Person', 'Book'],   
  ['KNOWS', 'READ']     
)
YIELD
  graphName AS graph, nodeProjection, nodeCount AS nodes, relationshipCount AS rels

这就是所谓的“本地投影”,与您提到的.cypher过程执行的“ Cypher投影”相反,该过程期望Cypher查询作为参数,因此是字符串。

I think you are looking for the gds.graph.create procedure (doc), which is the equivalent of project in previous versions of GDS:

CALL gds.graph.create(
  'personsAndBooks',    
  ['Person', 'Book'],   
  ['KNOWS', 'READ']     
)
YIELD
  graphName AS graph, nodeProjection, nodeCount AS nodes, relationshipCount AS rels

This is the so called "native projection", as opposed to "Cypher projection" which is performed by the .cypher procedure you mention, which expect a Cypher query as parameter, hence the string.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文