Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-21-2021 07:19 AM
Hi there,
I'm looking for a way to get the similarity between nodes considering node properties and weights. I've seen the Alicia's response that recommends to use Cosine algorithm but I haven't found a way to make my schema to fit on this model.
My current schema looks like this:
I want to take the similarity order to get the candidates that are most compatible with a specific Job. The properties that I'm considering as match are:
[:RECOMMENDED]
to the Job(Candidate)-[r]-(Focus)--(j:Job) where r.experience = job.experience
[:TO_WORK_WITH {required: true}]
(every other technology that is not the required should increase the similarity)If the candidate has all the properties from the Job and also some more nodes, it must return the maximum similarity, once all the requirements have been met.
The cypher query that I'm running now is this:
MATCH (j:Job {id: 1})
MATCH (c:Candidate)-[r1]-(f:Focus)--(j)
WHERE NOT EXISTS {(c)-[:RECOMMENDED]-(j)} AND
r1.experience = j.experience AND (c.clt_salary = j.clt_salary OR c.pj_salary = j.pj_salary)
MATCH (c)--(ci:City)--(j)
MATCH (c)--(t:Tech)-[{required: true}]-(j)
MATCH (j)--(n)--(c)
RETURN c.id AS candidate_id, COUNT(DISTINCT(n)) AS similarity
ORDER BY similarity DESC
This approach is very slow and I feel like it's just wrong, I would like to use GDS to take the similarity for me.
I know its a very specific use case but I haven't found any solution that works for me, I'd be glad if someone can help me with this.
All the sessions of the conference are now available online