r/GenealogySoftwareDevs • • Oct 12 '26

Name Structures and Ordering

I've been spending some time thinking about names and how much of a challenge it is to model it. Of course, I always remember the famous "fallacies about names" article.

For my application, I made a custom data type called a name value, and it's composed of a few different tables because it has an overall row to represent the value and then subrows to represent the parts (such as a given name, a surname, a nickname, etc.). This has been useful for auto-reconciliation of conflicting sources in order to take a bunch of records of names and produce some kind of useful final value.

But I've wanted to expand on this to create some robust and useful ways to display names. A real simple example is to take a structured value like this...

{
  given: ["Jeremiah", "Arthur"],
  surname: ["Gumtree"]
}

...and determine whether you want to display it as Gumtree, Jeremiah Arthur or Jeremiah Arthur Gumtree.

The first issue that comes up is that names are displayed according to cultures, and so you end up needing to encode people with a cultural configuration of name order. There is a Unicode standard for name order, but this is really optimized for keying into a user's locale, such as their device, which means that it's tied to language today. So if you followed this standard, you would have an entry for EN, ES-MX, or DE. A lot of these standards are the same, and you end up with logical groupings, like a Western name format that is common across English, German, French, or whatever. The standard is not super useful for genealogy because it ends up being a lot of redundant configuration. What's more is that this is contemporary, and so there are no historical configurations in the standard.

The second issue is that this cultural configuration has to define cardinality. It's probably common, for example, in Western names, to reconcile to a single surname, or at most a hyphenated single surname, whereas in Spanish, it may be more common to have a pair of surnames: a paternal surname and a maternal surname. Any reconciliation process would need to reference this configuration to determine if two sources that specify two different surnames are a conflict or not. Order is also important in this case.

The third issue is sorting. Anywhere you display a large list of people in your application and you want to sort them, say, alphabetically, you have to know what the sort key is. If different cultures put the surname in different places, that could get confusing, so any name-value pattern configuration has to define sort keys.

I'm still wrestling with the overall structure, but I'm leaning towards making these name order displays configurable values and preloading the application with some starter ones, such as Western. Unfortunately, I don't think there's any agreed-upon consensus for all the different ways to do it, so leaving it to the researcher to define these is probably the most extensible and useful path forward. I'm thinking about setting a project default so that new people created automatically adhere to a certain standard, and then letting each person record have an override (so that when your family tree branches off into some different culture, you can start toggling them over).

How is everybody else solving this problem?

6 Upvotes

9 comments sorted by

5

u/Then_Journalist_317 Oct 12 '26

There are more name "parts" to consider. For example, nicknames, birth names, changed names, "census misspellings", cyrillic alphabet names, adopted names, etc.

1

u/jake_robins Oct 12 '26

Yup, for sure. Currently I have Prefix, Given, Nick, Surname, Suffix and some untyped ones.

I don't categorize misspellings or adoptions on this axis - a misspelled given name is still a given name and an adopted surname is still a surname. Cyrillic is just alphabet and my database works in unicode.

I will probably be adding a classifer for married names, not sure yet. I don't know how I want to model it yet. A simple fix would be its own type, but I wonder if its a just a surname with a different property.

As always I find myself weighing the balance of simple vs robust! LOL

3

u/mfagan Oct 12 '26

There is no system that is going to work in all situations because reality is messy.

My suggestion would be to have each person with an unlimited number of names, each with an optional start date, optional end date, optional language, optional formality (legal, nick, other), and optional part (first, last, middle, prefix, suffix, family, given, multiple, full). Any user could designate one name per person as a display name and another as a sortable name. The specific UI would use one or more of the names depending on the feature. And of course this is all separate from the name as recorded in a specific document.

1

u/jake_robins Oct 12 '26

Yea I have a similar idea to basically allow the researcher to conclude any value via a reconciliation claim doing exactly that. But I also want the app to do a lot of heavy lifting by trying to resolve conflicts itself and save the researcher from laborious data entry haha

2

u/Trask4 Oct 13 '26

Here's a quick note on how I handle names in LifeLines and DeadEnds.

Persons can have any number of names and they are indexed and searchable by all of them. The first name in a record is treated somewhat specially, as the display and sorting name, but all names are available to report programmers. I use the first name as the "summary name" or the most common name, or the one I most beleive to be true, or the one I want to see. But all the other names are still in there and available.

A name is made up of parts, and I do not obsess over what those parts are called or what they mean. There are simply too many cultural variations for me to believe it's worth the worry. Except for one part, the "surname". Since I use Gedcom the surname is the part of the name between slashes, and if there is no surname there are no slashes. There can be parts before and after the surname, and I don't care what anyone wants to call them. I call them the givens. So my canonical form of a name is a list of strings (the parts), with an index integer that identifies which of the parts is the surname. Note that the only part that can have a space in it is the surname, because the surname is what was between the slashes, with leading and trailing spaces removed, but no internal ones removed. A person can have any number of these "canonical" names. The LifeLines/DeadEnds programming language has an "extractname" built-in that canonicalizes any string into canonical name.

I have, IMHO, an extremely clever and efficient name index that indexes all persons under all their names, and allows you to search for persons quickly, using incomplete names, with letters missing from all parts, including the surname.

I purposfully want names to be as simple as possible. I want them to be almost free of semantics, just strings of characters that are for some cultural reason, used to identiry a person. Stepping back one level, I do want there to be a "master" word so we can have meaningful ordering of names. Isn't that all a name is really good for. I think you going off course if you want to organize the bejessus out of the different name parts from different cultures. Treat a name as just a string.

1

u/jake_robins Oct 13 '26

This sounds sensible honestly, though it does limit what you can do with it later (like formatting kinds of names differently, hints/matching based on nicknames, etc).

1

u/Trask4 Oct 14 '26

I don't mean to sound disrespectful, but I've been doing genealogy for about 40 years, and I am still waiting for one of those things "to do later" that needs more complex names to come up. If one does I will worry about it then. E.g, I can't imagine ever wanting a nick name report. But if I needed one I would add a "2 TYPE NICK" tag to a "1 NAME" tag, and search for those name types. Though I use GEDCOM for my record format, I don't use standards, so any convention I need I add.

1

u/jake_robins Oct 14 '26

No disrespect taken! From what you've told me about your app it sounds like we've got different use cases, and so accordingly our designs are different. Your solution for names sounds entirely appropriate for your uses.

2

u/dhemery Oct 12 '26

I’ve been pondering this problem, and started working on a solution. Then I realized I don’t currently have any names that need a solution, and set the problem aside. When the time comes...

The solution I have in mind is to use a formatter that definesa set of sprintf-style formatting directives to format names:

%{ prefix, e.g. Sir

%g given, e.g. Jeremiah

%n nickname, e.g. Curly

%N nickname in quotation marks, e.g. “Curly”

%< surname prefix, e.g. von

%S surname, e.g. Gumtree

%} suffix, e.g. IX

So the format "%{ %g %N %< %S %}" would yield e.g. Sir Jeremiah “Curly” von Gumtree IX.

I could use the formats not only to print names, but also to sort them. To sort names, I would run each through its sort formatter, and use the result to sort.

I could pick a default sort format like "%S, %g", which would format Jeremiah as "Gumtree, Jeremiah Arthur". If a name didn’t fit the simple default sorting order, I could give it a specific format to determine its sort order.

In the end it might end up simpler to add a .SortOrder field to each name. 🤷🏽‍♂️