Rule
Table of Contents
Interfaces
- PayloadTypes
- The payload types of one GEDCOM version for ValueRule. A type is one alternative of a
structure's payload: a 7.0 type URI, a 5.x element such as "<SEX_VALUE>", or "Y".
- Rule
Classes
- DateGrammar
- The GEDCOM 7.0 date types DateValue, DatePeriod and DateExact (specification section 2.6 and
appendix A). Months and epochs come from the profile's calendars; month lengths are known here
for the four standard calendars. Calendars and months that HEAD.SCHMA defines as standard ones
are those ({@see Schema}); the months, epochs and days of other extension calendars are not known,
so not checked.
- DateGrammar5
- The GEDCOM 5.x date elements DATE_VALUE, DATE_PERIOD and DATE_EXACT (5.5.1 pages 45-48, 65):
calendar escapes such as "@#DJULIAN@", "B.C." after any year (5.5: "A (B.C.) appended to the
<YEAR>"; 5.5.1 writes it only after a lone year, but "MAR 44 B.C." means the same in both),
dual years ("1699/00") in the Gregorian calendar, date phrases in parentheses. Keywords and months are
case-insensitive. @#DROMAN@ and @#DUNKNOWN@ are "for future definition": any day, word and
year is accepted.
- DateRange
- The days a date value can mean, as Julian Day Numbers, for comparing dates: "1907" is
1 JAN to 31 DEC 1907, "BEF 1907" has no first day, "BET 1900 AND 1910" spans both years.
- FileRule
- 5.5.5 rules for the file as a whole that its grammar does not express: the file starts with
a byte order mark (KV1104, a warning: the BOM carries no data), and the SUBM record directly
follows HEAD (KV2004).
- Grammar5
- Grammars of the GEDCOM 5.x primitive elements that spec/<version>/primitives.yaml names; dates
are in DateGrammar5. Keywords and labels are case-insensitive, as in the gedcom7code tests.
- PayloadGrammar
- Grammars of the GEDCOM 7.0 data types (specification chapter 2), as regular expressions
with linear complexity. Dates are checked by DateGrammar.
- Payloads5
- GEDCOM 5.x payload types: the primitive elements of the profile ("<SEX_VALUE>") as
enumerations or grammars (Grammar5, DateGrammar5); other elements are text. Enumerations
are case-insensitive. An empty payload needs "<NULL>" among the alternatives. A payload
written without angle brackets is a literal ("Y", 5.5.5 "LINEAGE-LINKED").
- Payloads7
- GEDCOM 7.0 payload types: PayloadGrammar and DateGrammar, enumerations from the profile.
- PlausibilityRule
- Level 5, optional: warnings about data that is valid but cannot be true. A birth after the
death (KV5001), a child born before a parent (KV5002), an individual who is their own ancestor
(KV5003). Dates are compared as DateRange: only when the conflict is certain. The first BIRT
and DEAT with such a date count. Parents are HUSB and WIFE of the families an individual is a
child of, by FAM.CHIL or INDI.FAMC.
- ReferenceRule
- Level 4: pointers and xrefs: dangling pointers (KV4001), duplicate xrefs (KV4002), the type of
the record a pointer must point to (KV4003, from the profile). Family links must be mutual (KV4004): INDI.FAMC ↔ FAM.CHIL, INDI.FAMS ↔ FAM.HUSB/WIFE.
- Schema
- The documented extension tags of a 7.0 HEAD.SCHMA that stand for a standard term: a record
type, a calendar or a month. A tag definition makes its tag an abbreviation for the URI
(specification chapter 1, "Extension tags"), so `_USER` defined as
https://gedcom.io/terms/v7/record-SUBM is a SUBM record for the pointers to it, and a date in
`_CAL`, defined as https://gedcom.io/terms/v7/cal-FRENCH_R, is a French Republican date. The
contents of such a record are an extension's and are not checked.
- StructureRule
- Level 2: every standard tag is allowed where it stands, and substructures occur as often as
the profile says (KV2001–KV2003); 7.0 structures the specification deprecates are warnings
(KV2005, values in {@see Payloads7}). 5.x citations and media links are checked by their form
(Structure::form()), 7.0 substructures of which one is allowed by Profile::choices(). Extension tags ("_X") and everything under them are not
checked; HEAD first and TRLR last are syntax checks (KV1004–KV1006).
- ValueRule
- Level 3: payloads of standard structures against the profile's payload types (KV3001–KV3010).