Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-24-2022 04:24 AM
Hi,
This is my first question on here, so I hope I'm in the right place!
I want to ask whether it is possible to "auto-generate" relationships between nodes based on some.
For instance, lets say I have a "Person" node that has a firstName property Bob a lastName property Johnson and an address property Penny Lane 1. Now what I want is to setup is that if a different Person Alice gets created with the same lastName og address values I want to have a relation created between Alice and Bob automatically. Is this possible, perhaps via. some apoc scripts or something or do I have to implement this in my own application logic?
Kind regards
\Peter
Solved! Go to Solution.
09-24-2022 11:03 AM - edited 09-24-2022 11:03 AM
You can look into the apoc trigger methods.
09-24-2022 11:03 AM - edited 09-24-2022 11:03 AM
09-24-2022 10:06 PM - edited 09-24-2022 10:07 PM
Try using apoc.text similarity functions (https://neo4j.com/labs/apoc/4.1/misc/text-functions/) like apoc.text.jaroWinklerDistance(text1, text2). Here text1 = Person A's address and text2 = Person B's address and depending on the similarity strength you can decide. You need to check this every time a Person node created or updated.
09-26-2022 04:55 AM
Thanks for the suggestions guys!
@glilienfield I think your suggestion is right up the alley of what I'm looking for! especially since you can trigger on both nodes add/remove and even properties add/update/remove which is perfect!
\Peter
All the sessions of the conference are now available online