Dear all,
I have a script that intends to score the similarity between nodes and then, using apoc.peridoc.iterate, create a relationship between each pair of nodes where the relationship has a property of the Jacquard similarity score.
I am getting a syntax error message for an unexpected apostophe but, because I can't fix it, can't help but think that there is something fundamentally wrong with the script and my newbie grasp of Cypher and interpreting supporting documentation.
Here is the script I am using...
<CALL apoc.periodic.iterate("
Match (p1:Logical_Business_Process)-[:read|:write|:read_write]-(e1:Entity_Type)
WITH p1, collect(id(e1)) AS p1entity_type
MATCH (p2:Logical_Business_Process)-[:read|:write|:read_write]-(e2:Entity_Type) WHERE p1 <> p2
WITH p1, p1entity_type, p2, collect(id(e2)) AS p2entity_type
RETURN p1.Name AS from,
p2.Name AS to,
algo.similarity.jaccard(p1entity_type, p2entity_type) AS similarity
","
CREATE (p1:Logical_Business_Process)-[r:has_similarity_with {Name: p1 + ‘->’ + p2.Name, Jacquard_similarity_score: similarity}]->(p2:Logical_Business_Process) RETURN r.Name, r.Jacquard_similarity_score
",
{batchSize:10000, parallel:true}
)>
The ultimate goal is that I am wanting to be able to create a visual of clusters of nodes (the nodes represent business processes) that have a high Jaccard Similarity score in order that I can scope a suite of projects according to similarity of business processes. Would this be a suitable topic for the "Projects & Collaboration" board? I didn't spot anything similar there.
Kind regards, Douglas