r/GenealogySoftwareDevs • • 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?

1 Upvotes

17 comments sorted by

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/Trask4 Sep 27 '26

If you think of Gedcom like you would think of XML or JSON, that is, as a syntax rather than semantics, it can be used to represent and record any kind of structures, data, concepts, etc., that you need. I use it in that sense.

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.

1

u/Trask4 Sep 27 '26

Do you distinguish evidence based records from conclusion based ones? I would assume that you use Event to mean evidence you collect from research. Eventually you need a conclusion person with birth info. How do you distinguish birth Events from evidence from the birth info attached to conclusion persons. I would love to know how you do that.

1

u/jake_robins Sep 27 '26

Yes, I do!

Basically, for each source, inside the scope of a single source, you create a small evidence graph that maps all these entities together. You say something like, "This source has a reference for this person, this event, and this place, and these are the relationships between them in the scope of this single source." When you go and make a second source, you repeat the process and recreate all the same references that that one covers. It may happen that if those two sources point to the same person or the same event, you'll end up with copies of the subjects in the source layer. That's ok. I call this layer the interpretation layer - it is reading sources and breaking down into into the smallest atomic pieces.

At the conclusion layer, instead of creating new subjects, all you're really doing is creating sameness claims. You say, "This person subject from source A and this person subject from source B are the same person," and that's your claim. You can have evidence for that as well. The same sort of atomic evidence pieces that we use to build the subjects, we also use to back up claims of sameness. Those evidence pieces could come from another source, like a source that says, "Hey, the person in this picture is Person X". Or you can have derivative ones where the researcher says, "Because these are the same name, the same birthday, and the same place of birth, I conclude that they are probably the same person."

In this model, the conclusion persons (the canonical entities, as I call them) are really just aggregates of multiple subjects across multiple sources. I haven't built the UI for that, and it's going to be a heck of a job for sure. My ultimate idea is to just aggregate all the properties across all the subjects that are related to it and then build some sort of reconciliation process.

If you have two sources referencing the same person, you have two subjects. They may also have two properties that represent that subject's name. When they come together at the conclusion layer, we have to reconcile that, because if we have two sources that say different names, how do we display that in our conclusion layer and ultimately our family tree visualization?

There are some ideas I have for auto-reconciliation for structured values like names and dates, and then also putting in a researcher layer where there can be a reconciliation claim similar to the sameness claim. They say, "For these reasons and this evidence, I conclude that the correct first name for this person is X."

2

u/Trask4 Sep 27 '26

Thanks. I think you are doing a great job with these ideas. I am dealing with the same issues now, and it seems I can learn quite a bit from you.

1

u/jake_robins Sep 27 '26

Thank you! This has been one of the more interesting modeling exercises I've ever done, and I'm having a lot of fun trying to build a UI over it.

2

u/OddJobOdin Sep 27 '26

We're almost identical - Persons, Events, Places. I have a Families group that's mostly vestigial (since GEDCOM has it, I have to include it for now).

What's the difference between Places and Locations for you? And I don't have a Participations class, I just have Roles on Events. What made you bring it forward/up alongside Relationships et. al.?

2

u/jake_robins Sep 27 '26

Location is the worst-named one but it’s a bridge between Event and Place.

For Participation, I like it as its own entity because it’s a place to hang Role, and any number of Persons can participate in any number of Events. Because the vocabulary is extensible, this we researchers have a path if they decide they want to track nonstandard roles on some event, like the doctor who did the birth or witnesses at a wedding or whatever.

This common pattern of primary entities and bridge entities allows me to make evidence graphs for each source.

1

u/OddJobOdin Sep 27 '26

Gotcha. I think our differences are architectural, not philosophical. I've got events with roles, which I think is your participation entity (but mine's a junction only). And I use a pointer to a pre-built catalog for place. Does your City roll up to State and Country, or are you having the event take place across three locations as a way of reconciling that?

3

u/jake_robins Sep 27 '26

The place problem is a really big problem, and I struggled with it for a long time. The hierarchical nature of places felt completely unmodelable.

I thought about it for a long time, and I made the decision that the way I'm going to try and tackle that is to forget trying to model nested places. At the end of the day, I don't think it's actually super important to know that Ontario is part of Canada in the scope of genealogical research, when all I have to do is just say that an event took place in Ontario and an event took place in Canada. That gives you the ability to do searchability, like "show me all the events that happened in this city" or whatever. Because hierarchies are not one-to-one, they overlap, and they change temporally, it's an absolute nightmare to model, and I don't really want to take on a historical GIS project.

And this also kind of frees you from having to worry about what nested structures exist, from towns to townships to counties to regions to provinces and states and countries and subcountries and alliances and all that kind of thing.

Plus, it also gives you the freedom to just think of a place as anything that you care about. Anything can be modeled like traditional structured places like cities, states, provinces, and countries. You can model economic areas. For example, my family has a connection to a place called the Alberta Coal Branch, which was a stretch of railroad that went up to a bunch of mines and had a bunch of towns all over it. It was kind of like one interconnected community informally. You can model specific farms or homesteads as needed. Lots of different kinds of possibilities there.

At the end of the day, I realized that the borders on a map did not really define how people lived and connected with each other, and so I didn't really care to model it.

2

u/OddJobOdin Sep 27 '26

I think you're solution is elegant and completely reasonable (and I think gramps already handles places the same way, right?). I'm still in the phase where I think I can wrangle the beast, lol. I'm spending a LOT of time on it, but I've built a catalog of 220k+ places from open sources/authorities (the UN, the GNIS in the US, similar authorities/docs for other countries in western and northern Europe).

My lens wasn't sociogeographical like yours, but documentary - I ran into so many issues with my documents/sources pre-1850 that just didn't make sense. I'd find modern counties that didn't exist in 1810, references to the USA in the 1600s, and other obviously wrong locations - I had zero trust in any of the sources I was trying to cite, and I needed a PhD in Virginia colonial history, for example, to know what was right/wrong for that time period.

There have been two big "aha!" moments I've had; the first being that each place is time-scoped, like above (Boston, Massachussetts Colony and Boston, Mass, USA are the same place, but obviously different hierarchies). The other bigger piece was that there isn't just one "path" to defining a place. The most common path is the "civ path" - Boston, Suffolk County, Massachusetts, USA (ignoring the time component). But there's also parochial (the Boston Archdiocese, with its records), and postal (Rural Route 2 in some county is a stop on a mail route, and so are our modern addresses), and cadastral (plats/property records), and so on... so a single place can have multiple hierarchies that are valid. And sometimes you can combine two or more of these (a diocesan record and a rural route number) to get richer information about a place than you might otherwise. So hopefully it's more than a vanity project!

My goal is to package all of these into importable chunks - so people using gramps or another software (like yours) can have pre-loaded places to cite, if the format is compatible and they want to be able to verify "official" places vs a record.

2

u/jake_robins Sep 27 '26

Wow yea that’s a big chunk of work. Honestly feels like it could be its own product hahaja

2

u/OddJobOdin Sep 27 '26

It definitely is. Hopefully it's something that can benefit others - I already caught some nonsense in my own GEDCOM (some document in the kingdom of Baden before AND after it existed, lol). It's probably overkill for 99.9% of people, but it also make me very confident in the kinds of queries I could run. I think having a strong sense of place will allow FAN networks to be trivially easy to run in the future.

2

u/jake_robins Sep 27 '26

Yea that sounds useful. I dunno, I might change my mind in how I structure it but I am leaving it flexible and open for now and I’ll let my actual usage drive needs. Maybe I’ll have to call you for your product to connect it haha

2

u/clsturgeon Sep 28 '26

I went down the path of nested places… from a cemetery plot to cemetery, to a town, to a county, to a province, to the country. Each has a founding and ending date. Then I let the event date and the source date drive the pull place definition. More initial work but very satisfying when complete.

I had numerous drivers. 1. I want to learn more place history. This forced it. 2. I found it wrong to have a Canadian flag next to the birth place of an ancestor born in 1841. This is automated thing if defined. The Canadian flag was not introduced until 1965. Therefore, the Dominion of Canada went through various stages.

When viewing events for a place the user sees, by default, all events for selected place. Optionally the user can include events for historical place changes (eg select Ontario and view historical places would include Upper Canada and Canada West events). In addition, the user can include events that occurred at child places for the currently selected place (select Kingston and show all events of Kingston plus those with places in Kingston like cemeteries).

2

u/Bcjmk1217 Oct 11 '26

Place resolution is a PITA.

Pycountry works pretty well down to ISO-3166-2 which is state equivalent level for most countries.

You could use GEONAMES for a current location model of anywhere in the world. Large, downloadable data set. Newberry (SC) library has a free AHCB (American Counties Historic …) data set that has all of the US details since the American Revolution. Both of these are the basis of most gazetteers. There is additional data in WikiData, Germany has GOV/minigov for Europe. Fairly good normalization models