Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-10-2019 04:51 AM
I'm wondering whether someone has already mapped family tree relationships?
E.g.
create
(Joe:Male { name: 'Joe' }),
(Jane:Female { name: 'Jane' }),
(Joe)-[:PARENT]->(Jane),
(Dave:Male { name: 'Dave' }),
(Jane)-[:Parent]->(Dave)
My goal is to have something like dave's grandfather
to be parsed as match (:Male {name: 'Dave' })<-[:PARENT]-(parent)<-[:PARENT]-(grandfather:Male) return grandfather
01-22-2019 07:09 AM
If you want to label the grandfathers of Dave you could simply tag them:
match (:Male {name: 'Dave' })<-[:PARENT]-(parent)<-[:PARENT]-(grandfather:Male)
set grandfather:GrandfatherOfDave
Be careful, however, if you have more than one of this procedural inference rules. If they depend on each other (think of a :SON relationship that implies a reverse :PARENT relationship) you have to take care of their execution order, check of termination, etc.
What you describe might require the RDFS/OWL model and reasoning:
09-15-2021 11:29 PM
Check out the project I'm working on at http://gfg.md/blogpost/7 and https://github.com/waigitdas/Neo4j-Genealogy-PlugIns. Collaborators welcome!
All the sessions of the conference are now available online