Family Relationships

The Family relationships are a special form of relationships. Below is an example of individuals and their family structure first in GEDCOM form and then in the family module database form:

GEDCOM Example:
0 @1@ INDI
1 NAME John C. /Doe/
1 SEX M
1 FAMS @F1@
0 @2@ INDI
1 NAME Jane C. /Dawson/
1 SEX F
1 FAMS @F1@
0 @3@ INDI
1 NAME Jonny C. /Doe/
1 SEX M
1 FAMC @F1@
0 @4@ INDI
1 NAME Jammie C. /Doe/
1 SEX F
1 FAMC @F1@
0 @F1@ FAM
1 MARR
2 DATE 14 Feb 1919
2 PLAC Any town, county, state
1 HUSB @1@
1 WIFE @2@
1 CHIL @3@
1 CHIL @4@
Family Module Tables:
family_facts

fid (fact id) nid (node id) xref (gedcom pointer) code value
1 25 1 INDI
2 - - NAME John C. /Doe/
3 - - SEX M
4 26 2 INDI
5 - - NAME Jane C. /Dawson/
6 - - SEX F
7 27 3 INDI
8 - - NAME Jonny C. /Doe/
9 - - SEX M
10 28 4 INDI
11 - - NAME Jammie C. /Doe/
12 - - SEX f
13 - F1 FAM
14 - - MARR
15 - - DATE 14 Feb 1919
16 - - PLAC Any town, county, state

family_relations

rid (relation id) fid1 (child fact id) fid2 (parent fact id) type (fact type)
1 2 1 FACT
2 3 1 FACT
3 5 4 FACT
4 6 4 FACT
5 8 7 FACT
6 9 7 FACT
7 11 10 FACT
8 12 10 FACT
9 14 13 FACT
10 15 14 FACT
11 16 14 FACT
12 1 13 HUSB
13 5 13 WIFE
14 7 13 CHIL
15 10 13 CHIL

In this example we have a family of four. The father is John Doe, the mother is Jane Doe (Dawson is her maiden name), and two children, Jonny and Jammie. John and Jane were married on 14 Feb 1919. The GEDCOM version includes a pointer from each individual to their family. John's family pointer indicates that he is the father/husband in the family; Jane that she is the mother/wife; and the to children as children. Each individual could have multiple pointers, one to each nuclear family they belong to, as a spouse in multiple marriages, a child in multiple families1, and any combination thereof. Within the FAM structure we have the marriage information as well as links to the INDI facts.

The family module system removes the duplicate pointers (from the individual to the family and vis-versa) with a single family relationship entry which preserves the spouse and child designations and the FAM fact structure only retains the marriage fact data.

A special function has been written to gather family members together:

function family_get_fam_by_famid($famid, $type_arr)
Returns the family members (INDI fact) for a family group.
Optionally provide a list of desired famnily member types ('HUSB', 'WIFE', 'CHIL'). E.g., if you only want the couple: array('HUSB','WIFE'). I can't seem to get the optional list to work yet so the array is currently ignored.
Members are returned not ordered (neither fids nor xrefs are suitable for sorting).

  1. a PEDIGREE_LINKAGE_TYPE subfact to the FAMC fact identifies the families as birth, adoption, foster, or sealing. See GEDCOM Specification 5.5.1