I have read Bill Karwin's answer on this post and I was amazed on how it solved my basic problem on a Family Tree Genealogy i've been working on (at least on a parent-child relationship or ancestor-descendant level) using MySQL database. The advantages of it compared to Adjacency List and other models makes it a great choice for me given my project. However, as it was discussed, there is no support to connect nodes for sibling or nephew. Furthermore, I wanted to apply such principle to my database project to also support connection for in-laws, nephews, grandnephews, spouse, etc. If possible, I want to extend the Closure Table principle and its queries to support such relationships.
Referring to the image (yellow nodes are spouse): Sample Family Tree Structure
A query with the correct node connections could give answers such as when referring by:
(4) to (5): sibling
(9) to (2): spouse
(3) to (5): nephew/niece
(4) to (3) or (6) to (2): Uncle/Aunt
(1) to (9): child-in-law
(10) to (4): nephew-in-law
and when in such case I referred to a single node, lets say (2), it could give me the list of related nodes and how they relate to each other:
(1) is parent
(5) and (4) are children
(3) is a sibling
(9) is a spouse
(10) is a sibling-in-law
(6) is a nephew/niece
(8) and (7) are grandchildren
There are other scenarios when building family tree genealogies, such as half-siblings (where parent is different, so that you cannot assume that if these two nodes have the same parent); and other relationships like 'my spouse and my sibling's spouse are also sibling-in-law. This also goes that my child is a nephew-in-law of my sibling's spouse).
I'm sure this can be done through the Closure Table, but may not be so simple. Any article or suggestion or queries would be of great help. Thanks! (Maybe someone has already solved this problem a long time ago, I just couldn't find the right resource). :)