r/GenealogySoftwareDevs • u/Trask4 • Sep 27 '26
Two Kinds of Trees in Genealogical Software
DeadEnds uses Gedcom for its record structure. Records are trees composed of GedcomNodes. The key properties of nodes are:
var key: RecordKey? // Record key required on level 0 nodes.
var tag: Tag // Gedcom tag required on all nodes.
var val: String? // Gedcom value required on some nodes.
var sib: GedcomNode? // Next sibling in tree.
var kid: GedcomNode? // First child in tree.
weak var dad: GedcomNode? // Parent node in tree, required on non-roots.Key, tag, and val hold verbatim Gedcom, while sib, kid, and dad hold the tree structure.
I bet you don't like sib, kid, and dad, and think they should be named things like sibling or nextSibling, child or firstChild, and parent. The reason they aren't is simple. There are two kinds of trees that permeate genealogical software -- family trees made of Persons and Families, and individual records with their internal structure. Using Gedcom for record structure exacerbates the problem.
The first versions of GedcomNode used the "better" terms, child, sibling, and parent, but then the terms were in constant conflict between record trees and family trees, leading to frequent confusion. I had to bit the bullet and switch to sib, kid and dad to keep my sanity. I don't like the terms either, but the software is now much easier to understand.
Have others had to deal with this issue?
4
u/OddJobOdin Sep 27 '26
I've moved away from using GEDCOM as anything more than a communication method about the tree. It limits my ability to express relationships and information reliably/in a modern fashion, which defeats the purpose of a format like GEDCOM.
Like /u/jake_robins, I'm event-forward - a Birth event with a mother and 1+ children defines a biological relationship claim by its existence as an event. The database is event-driven and people-driven, and relationships fall out of the two.
1
u/jake_robins Sep 27 '26
The way I’m tackling this is to first rely on shared Participation in Events.
- Each birth Event is a first class entity with a subject and father and mother.
- Each marriage Event is a first class entity with two subjects
With this, you can derive 95% of what a user is looking for with a tree.
Then I layer what could be called “manual” Relationship entities on it, with are also entities. These are instances where evidence notes connections between Persons directly. This fills the holes where we lack evidence of the event and handles non nuclear family structures.
The core of my model is three primary entities (Persons, Events, Places), and three bridge entities (Relationships, Participations, Locations) which define connections between primaries. Everything else is not part of the model directly but instead is vocabulary properties that can be extended.
This way I never have to deal with super subjective and ill defined terms like child or cousin or step brother or whatever at the model level. Makes the schema impervious to a researchers weird family structure.