FamilySearch / GEDCOM.io

Files for the GEDCOM.io website
2 stars 5 forks source link

Listing superstructures of relocated standard structures #97

Closed dthaler closed 7 months ago

dthaler commented 11 months ago

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?

tychonievich commented 11 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’s substructures 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.

tychonievich commented 11 months ago

Put another way:

X may be a substructure of Y if any of the following apply:

dthaler commented 10 months ago

Put 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?

dthaler commented 10 months ago

@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.

tychonievich commented 10 months ago

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.

tychonievich commented 10 months ago

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:

:::

dthaler commented 10 months ago

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?

dthaler commented 9 months ago

Discussion 11/16/2023:

dthaler commented 7 months ago

Discussion January 4, 2024: