Hi,
I have a subgraph based off of four types of nodes: Activity (a), System (s), Input (i), and Participant (x), where System, Input, and Activity are all child nodes of Activity. I'm interested in measuring overlap similarity from Activity to Activity across all Activity nodes in the graph, based on relationships between Activity to System, Activity to Input, and Activity to Participant. I've successfully used the overlap similarity algorithm where I'm comparing nodes on one relationship but want to know how/whether it's possible to do so on multiple relationships.
After my matching statements, my syntax looks like:
MERGE (i)-[iha:INP_HAS_ACT]->(a)
MERGE (s)-[sha:SYS_HAS_ACT]->(a)
MERGE (x)-[pha:PART_HAS_ACT]->(a)
WITH a,i,s,x,iha,sha,pha
WITH {item:id(a), categories:collect(id(????))} as userData
WITH collect(userData) as data
CALL algo.similarity.overlap.stream(data)
YIELD item1, item2, count1, count2, intersection, similarity
RETURN algo.asNode(item1).activity_id AS from, algo.asNode(item2).activity_id AS to, count1, count2, intersection, similarity
ORDER BY similarity DESC
Is there a way to call the id of multiple nodes? Is that the right approach here?
Thanks