From: ttw@cbnewsl.cb.att.com (thomas.t.wetmore..iv)
Subject: Introduction to GEDCOM
Organization: AT&T Bell Laboratories
Date: Tue, 15 Sep 1992 22:47:04 GMT

There are often questions about GEDCOM posted to this group.  I have
written a short note to define and describe GEDCOM.  This is not an
official view as you might get from a member of the LDS church, nor is
it the view of someone who has a vested interest in any commercial
product.  It is simply the view of someone who as done a lot of work
with GEDCOM data, has written parsers and code generators based on it,
and who has chosen to keep all of his genealogical data formated using
it.

=======================================================================

GEDCOM is a data communications standard created by the LDS church.  It
provides a structured method for storing and transmitting data.  To
understand GEDCOM you must become acquainted with it at three levels:

  1.  the structural level - the level that defines the underlying
      structure of GEDCOM files; at this level GEDCOM is very simple;

  2.  the lineage-linked level - the level at which meaning is attached
      to many GEDCOM structures in order to support genealogical data;
      meanings for many tags (defined below) are assigned at this level,
      as are format restrictions for such things as name and date
      values; and

  3.  the implementation level - the practical level that describes how
      existing genealogical systems support GEDCOM; most systems today
      can export and import GEDCOM data; however, a system can only
      import the data that fits into its particular database records,
      and can only export the data that it stores in its database.

GEDCOM -- STRUCTURAL LEVEL

At the structural level GEDCOM provides a simple way to structure data.
The GEDCOM format provides a nice compromise between structure and
flexibility, with the benefits deriving from both.

A GEDCOM file is made up of records.  A GEDCOM record is made up of
lines.  Each GEDCOM line is composed of up to four components:

  1.  level - (mandatory) an integer that assigns the line a structure
      or nesting level;

  2.  cross-reference index - (optional; used only on the first line in
      each record) a string of characters, starting and ending with an
      @-sign, that gives GEDCOM records their reference tags; these tags
      allow lines in one record to  refer to other records;

  3.  tag - (mandatory) a short string of characters that defines the
      kind of information found on the rest of this line, or on the
      lines with larger that level values that immediately follow; tags
      are generally made up of three or four uppercase letter; and

  4.  value - (optional) characters and text that provide the value part
      of the line.

Here are some example GEDCOM lines that make up a small record.  The
indentation used here is not part of GEDCOM.

0 @I1@ INDI
  1 NAME Thomas Trask /Wetmore/ IV
  1 SEX M
  1 ADDR 2 Barton Street
    2 CONT Newburyport, MA 01950
  1 PHON 508-465-3220
  1 OCCU Computer Scientist

All GEDCOM records begin with a level 0 line with a cross-reference key
and a tag that defines the type of record; an INDI (for individual)
record is one of the conventional record types used for genealogical
data.  This record contains five items, all defined by the level 1
lines, providing a name, sex, address, phone number and occupation.  The
important point here is that level numbers increase by one to expand on
or provide more information about data found on the previous line with
the lower level number.  For example, the 1 NAME and 1 SEX lines expand
on the 0 INDI lines, just as the 2 CONT line expands on the 1 ADDR line.
In principle, data can be be nested to any level.  The reason why the
surname is placed in forward slashes in this example is described in the
next section.

GEDCOM -- LINEAGE-LINKED LEVEL

At the lineage-linked level of GEDCOM, a few record types are defined,
many tags are specified to have special meanings, and format
restrictions are placed on the values of many lines.

The most important record types are the person record and the family
record.  As their names imply, person records provide information about
separate individuals, and family records link persons together into
family units.  Here is a simple person GEDCOM record as it might be seen
in a genealogical system (as before, indenting is used to provide
clarity):

0 @I32@ INDI
  1 NAME Thomas Trask /Wetmore/ Sr
  1 SEX M
  1 BIRT
    2 DATE 13 MAR 1866
    2 PLAC St. Mary's Bay, Digby County, Nova Scotia
    2 SOUR Application for social security account
  1 OCCU Antiques dealer
  1 DEAT
    2 DATE 17 FEB 1947
    2 PLAC New London, New London County, Connecticut
    2 CAUS Diabetes
    2 SOUR New London death records
  1 FAMC @F8@
  1 FAMS @F16@

This is a "bare bones" genealogical record, typical of the GEDCOM
records that get exported from commerical systems.  The data found in a
person record can be grouped into three categories:

  1.  attributes - simple information about the person; all systems
      support the name and sex attributes, and many the occupation
      attribute;

  2.  events - an occurrence that happened on some date and in a some
      place and that involved the person; events generally begin with a
      level 1 line that defines the event, followed by such lines such
      as DATE and PLAC that provide the details; and

  3.  links - cross-reference indexes used to link this record to other
      records; in this example there are two, found on the FAMC and FAMS
      lines.

Every genealogical system (I think) requires every person to have a
name, so each person record will have a NAME line.  In a NAME line, the
surname is be set off by forward slashes, and many systems have a
built-in length limit on the overall name length.  Some systems allow
given names or name qualifiers to follow the surname; some don't.  Most
systems limit the number of name components and their lengths.

Most person records will contain a SEX line; without it, families cannot
be built with that person as a spouse or parent.

The most common event types have their own preassigned tags (e.g., BIRT
for birth and DEAT for death), and others are encoded by using the
reserved tag EVEN with a value that indicates the event type.  The tags
DATE and PLAC are reserved and used for recording the date and place of
an event.  Unfortunately, GEDCOM and most of systems that support it,
place a number of restrictions on DATE and PLAC lines.  In dates, you
can get across the notions of about, before and after, but not the
notions of between, possibly, probably, and many others.  Some systems
insist that you use capitalized three letter abbreviations for month, as
I have done in the example.  Most do not let you say things like "after
her husband died" or "soon after birth," which are things you really
would like to do quite often.  Most systems allows a maximum number of
events per person that is quite small, and most systems do not allow
more than one event of the same type.  Some systems allow you to define
your own event types, but then everybody in the database will have that
special event type.

The link lines are the means that link GEDCOM records together.  In the
current GEDCOM standard for lineage-linked data, person records may
contain two types of link lines, the FAMC and the FAMS lines.  The value
of a FAMC line is the cross-reference index of the family that the
person belongs to as a child.  Obviously, most systems allow only one
FAMC line per person.  The value of a FAMS line is the cross-reference
index of a family that the person belongs to as a spouse (if there were
a marriage) or parent (if there weren't).  Systems worth their salt must
allow for more than one FAMS lines per record.

Here is an example family record:

0 @F16@ FAM
  1 HUSB @I32@
  1 WIFE @I33@
  1 MARR
    2 DATE 13 JUN 1891
    2 PLAC New London, New London County, Connecticut
    2 SOUR St. James's Church register
  1 CHIL @I33@
  1 CHIL @I34@

As you can see, most lines in a typical family record are link lines.
The HUSB and WIFE lines (note: it is only wishful thinking on the part
of the LDS members who came up with these tag conventions that parents
would always be husband and wife - the HUSB and WIFE lines are used even
for common law families) refer to the person records of the male and
female spouse or parent respectively.  The CHIL lines refer to the
person records of the children.  The family record also holds the
marriage event, if any, and the divorce event, if any.  Note that each
family record begins with a level 0 line that has the FAM tag.

GEDCOM -- IMPLEMENTATION LEVEL

I really can't say too much about this level.  Every system is
different, and you find out by doing.  The systems I have used all have
idiosyncracies and cause different forms of aggravation when you import
or export GEDCOM data using them.  I have found all commerical systems
available today to be inadequate in nearly all particulars, and this
includes their ability to handle GEDCOM data.  I have not tabulated
information about how each system deals with GEDCOM.  Some of these
comparisons can be found in back issues of "Genalogical Computing."

The experimental system I use employs GEDCOM, not only as its import and
export mechanism, but also as its underlying database storage format.
This system allows records to grow as large and become as deeply nested
as needed to store the available data.  New tags can be invented at
will, and there are essentially no format or length restrictions on
lines.  This system represents the current state of the art as far as
GEDCOM is concerned, and demonstrates how powerful the GEDCOM format may
become as more highly advanced genealogical systems become available.
Newsgroups: soc.roots