Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-10-2021 10:22 PM
See I have name and component id column by using wcc alogorithm. But i would like to diaplay a new third column name like relationship, that column should display the relationship type of the name who are connected in a same cluster.
My code is to create a graph:
CALL gds.graph.create.cypher(
'my-graph55',
'MATCH (n:person) RETURN id(n) AS id',
'MATCH (a:person)--()--(b:person) RETURN id(a) AS source, id(b) AS target'
)
My code is to find the componentid:
CALL gds.wcc.stream('my-graph5')
YIELD nodeId, componentId
RETURN gds.util.asNode(nodeId).name AS name, componentId
ORDER BY componentId, name
YIELD graphName, nodeCount, relationshipCount, createMillis;
06-14-2021 01:16 PM
You'll want to write your WCC results back to your database - using gds.wcc.write
and then use a cypher query to return what you're interested in.
It might look something like this:
MATCH (c:Client) WITH distinct c.LouvainCommunity AS community_id, count(distinct c) AS num_members
MATCH (c:Client{LouvainCommunity:community_id})-[r]-()
RETURN distinct(TYPE(r)) AS relationship_type, count(r) AS num_rels, community_id, num_members
All the sessions of the conference are now available online