Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion build/extract-yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,13 +563,18 @@ def do_pfx(uri:str) -> str:
assert sub.split('/')[4] <= v, f"Enumeration value {sub} incompatible with enumset {uri}"


# step 12: add subsumes for any URI that also exists in earlier minor version
# step 12: add subsumes for any URI that also exists in earlier minor version or in subsumes.tsv
from subprocess import run
for uri in data:
if '/v7.1/' in uri:
res = run(['git','show','main:'+pathof[uri]], capture_output=True)
if not res.returncode:
data[uri].subsumes.append(uri.replace('/v7.1/', '/v7/'))
with open(Path(args.spec, 'subsumes.tsv'),'r') as subs_csv:
subs_csv_header = next(subs_csv)
for line in subs_csv:
old,new = line.strip('\n\r').split('\t')
if new in data: data[new].subsumes.append(old)

# step 13: write all the YAML files
for uri in data:
Expand Down
3 changes: 3 additions & 0 deletions extracted-files/tags/ABBR
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ substructures: {}
superstructures:
"https://gedcom.io/terms/v7/record-SOUR": "{0:1}"

subsumes:
- "https://gedcom.io/terms/v5.5.1/ABBR"

contact: "https://gedcom.io/community/"
...
2 changes: 2 additions & 0 deletions specification/subsumes.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
may-convert-from may-convert-to
https://gedcom.io/terms/v5.5.1/ABBR https://gedcom.io/terms/v7/ABBR