cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Count common nodes and properties

Hi there,

I have a Neo4j Database containing Candidates, Jobs, Techs, Cities and Focus.
3X_a_1_a1ebf6cb4f0d3cf82c60f67ad1392f2760621fc0.png

What I want is to count how many relationships and propeties a Candidate have in common with a Job relative to all Job nodes and properties.

Example:

Candidate A

  • (PROPERTY) has salary 3000
  • (RELATIONSHIP) is connected to Tech A, B and C
  • (RELATIONSHIP) is connected to City D
  • (RELATIONSHIP) is connected to Focus F

Job J

  • (PROPERTY) has min salary 2000 and max salary 4000
  • (RELATIONSHIP) is connected to Tech A
  • (RELATIONSHIP) is connected to Focus F

Candidate have matches the salary property from Job, and all its relationships.
So in this case the result would be 100%.

1 REPLY 1

ameyasoft
Graph Maven
Try this:

match (c:Candidate)
where 2000 <= c.salary <= 4000

match(c)-[]-(t:Tech)
where t.name = "A"

match(c)-[]-(f:Focus)
where f.name = "F"

return c, t, f