Getting error with algo.unionFind

I am getting below error with an algorithm.

Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedure algo.unionFind: Caused by: org.neo4j.cypher.internal.v3_5.util.SyntaxException: Invalid input '(': expected (line 1, column 1 (offset: 0))

Below is the sample graph to reproduce the error, I am not able to figure out what I am doing wrong, Thanks in advance.

Create (p1:Person {Personid:1}),(p2:Person {Personid:2}),(p3:Person {Personid:3}),(p4:Person {Personid:4}),
(C1:Company {Companyid:1}),(C2:Company {Companyid:2}),(C3:Company {Companyid:3}),(C4:Company {Companyid:4}),(C5:Company {Companyid:5}), (C1)<-[:Professional{weight:15}]-(p1),
(C1)<-[:Professional{weight:15}]-(p2), (C1)<-[:Professional{weight:15}]-(p3), (C1)<-[:Ownership {weight:15}]-(p4)
return * ;

CALL algo.unionFind('MATCH (p) RETURN id(p) as id',
'(p1:Company)-[f:Ownership|:Professional]-(p2:Person) where f.weight> 12 RETURN id(p1) as source, id(p2) as target, f.weight as weight',
{graph:'cypher', write: true})
YIELD nodes, setCount, loadMillis, computeMillis, writeMillis

Your error states the problem, you have no Match in the second argument of UnionFind. It should be:

CALL algo.unionFind('MATCH (p) RETURN id(p) as id',
'MATCH (p1:Company)-[f:Ownership|:Professional]-(p2:Person) where f.weight> 12 RETURN id(p1) as source, id(p2) as target, f.weight as weight',
{graph:'cypher', write: true})
YIELD nodes, setCount, loadMillis, computeMillis, writeMillis
1 Like