Hi. I have a database containing U.S. Census data from the early 1900's. The relationships in the database are the ones given in the Census directly - each record is related to it's "Head of Household". I would like to infer additional relationships from this data.
For example, say you have a Head of Household named John. And John has 2 sons named Bill and Paul, and a daughter named Mary. I would like to infer the relationships between Bill, Paul and Mary and create that in the database (they are all siblings to each other). Assuming I use directional relations - this would create 6 connections in the database.
Every node in my database right now is a Person. Each person node has a GUID assigned to it.
This query :
match (f:Person)-[:IsParentOf]->(s:Person) return f.GUID, collect(s.GUID) as kids
will return all the Head of Household GUIDs along with a collection of their kids GUIDs.
My question is - how can I now pipe this output into a create clause that will create all 6 of my relations. I've tried playing around with Merge, Unwind, etc....frankly it's all quite confusing!
This is my first post here - I hope I've provided enough detail.
Thanks!