Facts & their Relationships
"All we want are the facts ma'am." -Sgt. Joe Friday
A fact is the fundamental unit of information used by the Family module. It represents a single line in a GEDCOM file which contains
- Depth indicator (DI) of a fact in a fact hierarchy (0 - n)
- A fact code (think of it as a class name)
- fact value (the actual data).
The one exception to this format is a "root" fact (explained below) which stores an xref value between the depth indicator and the fact code and has no fact value. The family module maintains the general idea but with a significant change. Instead of the 0 - n DI the module uses a relationship table to track which facts relate to each other. The module also add a field to link facts with their node (if one exists) and another to store an xref1.
GEDCOM Example:
0 @1@ INDI
1 NAME John C. /Doe/
1 BIRT
2 DATE Jan 1870
2 PLAC Durham, Durham, North Carolina
2 SOUR @S2@
3 NOTE month and year listed on census form
1 DEAT
2 DATE 31 Dec 1907
2 PLAC Hillsborough, Orange, North Carolina
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 | - | - | BIRT | - |
| 4 | - | - | DATE | 1 Jan 1870 |
| 5 | - | - | PLAC | Durham, Durham, North Carolina |
| 6 | - | - | SOUR | @S2@ |
| 7 | - | - | NOTE | month and year listed on census form |
| 8 | - | - | DEAT | - |
| 9 | - | - | DATE | 31 Dec 1907 |
| 10 | - | - | PLAC | Hillsborough, Orange, North Carolina |
family_relations
| rid (relation id) | fid1 (child fact id) | fid2 (parent fact id) | type (fact type) |
|---|---|---|---|
| 1 | 2 | 1 | FACT |
| 2 | 3 | 2 | FACT |
| 3 | 4 | 3 | FACT |
| 4 | 5 | 3 | FACT |
| 5 | 6 | 3 | FACT |
| 6 | 7 | 6 | FACT |
| 7 | 8 | 1 | FACT |
| 8 | 9 | 8 | FACT |
| 9 | 10 | 8 | FACT |
It may be best to think of this as a tree structure. 2 The individual node (fid 1) is a "root" fact or "root node" because it had a GEDCOM level of 0 meaning that it has no parent. This root node has 3 child nodes: fid 2 (NAME), fid 3 (BIRT), & fid 6 (DEAT). The name node (fid 2) simply stores a value. The birth (fid 3) and death (fid 6) nodes have additional children instead of values. 3 Each root node also has an xref value so that other trees can point to this node (fact 1 has the xref "1" in the example above). No child nodes can have an xref value although a child node may store an xref pointer to a root node in its value field (fact 6 points to the fact with an S2 xref in the example above).
- a pointer GEDCOM places in the value field
- For this paragraph the term "node" is used in the tree structure sense.
- A fact may have both child facts and values. An example is the NOTE fact and its child CONT and CONC facts.
