Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-31-2019 06:44 AM
Hi,
I'm wondering if it's possible pass results from a query in a graph algo apoc with a cypher projection.
Here a toy example
CALL algo.unionFind.stream("
with [1,2,3,4] as nodes unwind nodes as nod
return nod as id",
"with [{source:1, target:2},
{source:1, target:3}] as rels
unwind rels as rel
return rel.source as source,rel.target as target",
{graph:'cypher', iterations:20})
YIELD nodeId,setId
RETURN nodeId, setId
Pseudo code
WITH
[1,2,3,4] as nodes,
[{source:1, target:2},
{source:1, target:3}] as rels
CALL algo.unionFind.stream("
with $nodes as nodes unwind nodes as nod
return nod as id",
"with $rels as rels
unwind rels as rel
return rel.source as source,rel.target as target",
{graph:'cypher', iterations:20})
YIELD nodeId,setId
RETURN nodeId, setId
Thank you,
Nunzio
07-25-2019 01:24 AM
I also meeting this problem, are there any solutions for this ?
11-15-2019 07:17 PM
I was needing to do the same for algo.ShortestPath.astar.stream
and I came across the solution in the Cypher Projection documentation.
For your case, it would look something like this:
{graph: 'cypher', params: {rels: rels, nodes: nodes}, iterations: 20}
Hope this helps!
All the sessions of the conference are now available online