You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MATCH (h1:Hero)-[:KNOWS]->(h2:Hero)
WHERE h1.louvain <> h2.louvain
WITH h1.louvain as first,h2.louvain as second,count(*) as weight
call apoc.cypher.run("match (:`Hero`{louvain:"+first+"}) return count(*) as count", null) yield value
CALL apoc.merge.vNode(['Cluster'], {community:first,size: value.count}) YIELD node as nodeFrom
CALL apoc.merge.vNode(['Cluster'], {community:second}) YIELD node as nodeTo
CALL apoc.create.vRelationship(nodeFrom,'COMMON',{weight:weight}, nodeTo) YIELD rel
RETURN nodeFrom,nodeTo,rel
Not sure if we want one parameter for merging only and one for ON CREATE SET,ON MATCH SET. In my example I don't need it
The text was updated successfully, but these errors were encountered:
The above example with apoc.create.vNode instead of apoc.merge.vNode generates a correct virtual relationship.
Moveover, we can currently use the apoc.create.clonePathToVirtual and apoc.create.clonePathsToVirtual procedures to create virtual paths: https://neo4j.com/labs/apoc/4.3/overview/apoc.create/apoc.create.clonePathsToVirtual/ .
And to date, it looks more like a function regarding GDS.
I'm closing it, please reopen it if needed
for now we can only create virtual nodes and it would be very helpyful if we could merge virtual nodes so that one can easily create a virtual graph.
Example use:
Not sure if we want one parameter for merging only and one for
ON CREATE SET
,ON MATCH SET
. In my example I don't need itThe text was updated successfully, but these errors were encountered: