Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to store persons name in a record table

Intro

Damn, this is harder then I thought.

Some people have camel-case names like McDonald or O'Ferncher, and some do not have double-barrelled name, but hyphenated name like Bowes-Lyon or just given name, like Honovi Hohnihhohkaiyohos ( Strong High Backed Wolf ). In some culture spaces like:

  • Portuguese you have more then 1 family name and more then 1 first name (by default).
  • Russia you have middle name (patronymic), that is obligatory.

In some places you have gender inequality and to formally address a person you need to use prefix, like: Sir (where gender can be male, female and in-between). And yes, prefix changes depending on the persons age.

Like this is not enough - people can and will get married (this occurs pretty often)(thy might do this multiple times), and it is a default custom for at least one partner to change their family name. In most places people can change their name or at least given name. alt text

More details

This is not important if you want to answer the question, just giving a hint what I'm trying to do.

Tables where I want to store the names are in xml and appengine datastore with twig object store interface (I use twig among other things, for it enables me to compile schema). Data itself can come form various places and probably there exists a case where old name is used (so - storing multiple names).

My best guess is:

@XmlAttribute @Key protected Long id;
@XmlElement(required = true) final protected List<String> lastName;
@XmlElement(required = false) protected String middleName;
@XmlElement(required = true) final protected List<String> firstName;
@XmlElement(required = true) protected Boolean isMale;
@XmlElement(required = true) protected Date birthday;
//+locale for naming?

Writing function or preconditions for compareTo method just makes My day ... I'm seriously considering 0 fault tolerance. Yes, meaning existence or lack of apostrophes, whitespace and other symbols or case difference can yield to different results. (And for cynical bastards - this is not homework.)

The question was: How to store persons name in a record table?

like image 384
Margus Avatar asked Oct 14 '22 20:10

Margus


1 Answers

If you are looking for a simple, universal solution, I think you will find that there is none. Read this blog posting, and weep.

And when you've finished crying, take a look at this document, which attempts to model names for a US American audience. Obviously it makes a lot of simplifying assumptions, which are probably invalid.

like image 78
Stephen C Avatar answered Jan 01 '23 11:01

Stephen C