Martin Steer wrote: > On Fri, Feb 22, 2013 at 10:33:38AM -0000, Tony Proctor wrote: >> >> A simple off-the-cuff example, with an arbitrary syntax, just to >> illustrate >> the difference Janis. This bit of script wants to look at all the >> events in >> my timeline, then look at all the people sharing those name events, and >> select the ones whose name has the element "Jesson". >> >> >> Person me = New Person("Tony Proctor"); >> for (Event e: me.AllEvents()) { >> for (Person other: e.AllPersons()) { >> if (other.name().contains("Jesson")) { >> ...do something with this other person... >> } >> } >> } > > As for sql, this kind of thing can be done fairly easily inside a > database which allows so-called 'stored procedures'.[1] I use Postgresql > with its native procedural language, but perl, python, etc, procedures > could be used instead. > > I don't see the need here for an object oriented approach. Unfortunately, neither did the designers of GEDCOM. But take a fairly basic element of genealogy, the personal name. For a start have a read through http://www.w3.org/International/questions/qa-personal-names Then take into account the fact that even within one culture naming conventions change over time. In the medieval period, for instance it was common in the Norman empire to have a system similar to the Icelandic where William's son John would be called John FitzWilliam before FitzWilliam became an inherited surname. In addition we have the problem of illegitimate children, e.g. from the parish register of Kirkburton, April 1662 "Joshua sonne of Alice Jessop and Richard Wareing bapt the first day." Is Joshua subsequently going to be known as Jessop or Wareing? We don't know but if we were looking at some query such as Tony suggested we'd want this event to come up irrespective of whether the name contained Jessop, Wareing or even Waring. And going back a few months in the same register we have the following for December 1661: "William sonne of Grace Taylor otherwise Jessop & Regnald or Leonard Wright was bapt the 18th". This introduces the fact that we sometimes had alias surnames (otherwise Jessop) which could also be inherited and disputed paternity. Most pages of a PR will include an illegitimacy; the second, pathological instance is much rarer (although there was another instance of a child with alternate father's surnames in January 1662-3) it's clear that what seems at first sight to be a basic thing like a name does not, in fact, sit well with relational design. It would, in fact, have been much better to have taken an OO approach so that one could have a base class of Name and as many sub-classes as required to hold different implementations. And the mention of January 1662-3 above should be a hint that dates are another can of worms better dealt with by an OO approach > For sql, the > natural thing to do is to build up a collection of useful views on the > data, together with a collection of useful functions. > -- Ian The Hotmail address is my spam-bin. Real mail address is iang at austonley org uk