Closed dthaler closed 7 months ago
In https://gedcom.io/terms/format we have:
Because new structures may be added over time in any order, x may be a substructure of y if either x’s
superstructures
includes y or y’ssubstructures
includes x.
We have superstructures
to allow extensions to be substructures of standard structures. We have substructures
to allow extensions to be superstructures of standard structures. For example, an extension individual event would have g7:record-INDI
in its superstructures
and g7:DATE
in its substructures
, but presumably not have either of the matching entries in the standard structure's YAML.
The YAML format has similar facilities for enumerations (an extension set can include standard values with enumeration values
, and extension values can be placed in standard sets with value of
).
I think that relocated standard structures will usually not needed under extensions; there the "extension-defined substructures" should cover most cases, or at least that was the intent: we may have missed some case. But I do think the relocated standard structure idea might need revisiting. By definition they violate normal sub/super rules, but they don't indicate new rules (making validation impossible) and there's currently no way to give similar freedom to extension structures.
Put another way:
X may be a substructure of Y if any of the following apply:
superstructures
entry with key Ysubstructures
entry with key XPut another way:
X may be a substructure of Y if any of the following apply:
- X's YAML file has
superstructures
entry with key Y- Y's YAML file has
substructures
entry with key X- X is a relocated standard structure (extension tag and standard URI)
Or
Correct?
@tychonievich https://[gedcom.io/testfiles/gedcom70/extension-record.ged](https://gedcom.io/testfiles/gedcom70/extension-record.ged) has:
0 @LOC1@ _LOC
1 NAME Town
2 DATE FROM 1800 TO 1900
So I think it's actually more complicated since that example (DATE
under NAME
) is permitted in the spec:
_LOC.NAME
and_LOC.NAME.DATE
are both extension-defined substructures. Their meaning is defined by the specification defining_LOC
.
So I think it's also:
Correct? I think it would be help to explicitly state this set of conditions somewhere.
Hm, I think that example needs to be changed. I can't find a way for it to work with a documented extension. If we had
extension tags: [_LOC]
substructures:
"https://gedcom.io/terms/v7/NAME": "{0:1}"
then it would be a g7:NAME
which does not have a DATE
substructure. On the other hand, if we had instead
extension tags: [_LOC]
substructures:
"https://example.com/LocationName": "{0:1}"
then the name should use an extension tag because it's not a standard structure type.
Here's an effort to list all the cases covered by the current spec:
:::note
This specification allows structures to appear in the following contexts:
Standard
stdTag
Relocated
extTag
Aliased
extTag
Undocumented Extension
extTag
Unrecognized Extension
extTag
Unrecognized Extension-Defined
stdTag
placement: As a substructure of an undocumented extension, an unrecognized extension, or another unrecognized extension-defined structure.
(maybe add?) an unrecognized extension-defined structure's set of unrecognized extension-defined substructures (and their unrecognized extension-defined substructures transitively) must be consistent with at least one standard structure with this tag. For example, there are five standard structures with tag DATE
; three have a PHRASE
substructure so an unrecognized extension-defined DATE
structure may have a PHRASE
substructure, but none have a NOTE
substructure so an unrecognized extension-defined DATE
structure may not have a NOTE
substructure (but may have a g7:NOTE
as a relocated substructure).
Documented Extension
extTag
superstructures
entry is {}
;
it is permitted as a substructure of structure type X if either X appears in its substructures
entry
or it appears in X's superstructure's entry.Documented Extension-Defined
stdTag
substructures
entry.
A documented extension-defined superstructure permits as documented extension-defined substructures any structure that structure type may have as defined in this specification.:::
Hm, I think that example needs to be changed. I can't find a way for it to work with a documented extension.
I agree, I would prefer that that example not be valid. However, changing it at this point would seem to be a breaking change where an existing valid GEDCOM 7.0 file would become invalid, so wouldn't that change have to wait for next-major?
Discussion 11/16/2023:
_LOC
todayDiscussion January 4, 2024:
NAME
) where it cannot be a g7:NAME
or any other standard URI but must be an extension URI due to the DATE
substructure.stdTag
as an extension, we need a way to allow that in order to support the current example in the spec.
https://gedcom.io/terms/format has a "superstructures" section per structure. However a relocated standard structure is supposed to have the same URI as the standard structure, so an extension that has a relocated standard structure can't have a different YAML file.
Should the standard YAML file be updated for each extension that relocates it? Or is there no way to specify the "superstructures" section, and only rely on the "substructures" section of the extension structure it's relocated under?