diff --git a/build/extract-yaml.py b/build/extract-yaml.py index 1fd7cfad..146499a8 100644 --- a/build/extract-yaml.py +++ b/build/extract-yaml.py @@ -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: diff --git a/extracted-files/tags/ABBR b/extracted-files/tags/ABBR index 96b3f55b..bb904831 100644 --- a/extracted-files/tags/ABBR +++ b/extracted-files/tags/ABBR @@ -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/" ... diff --git a/specification/subsumes.tsv b/specification/subsumes.tsv new file mode 100644 index 00000000..53dd6114 --- /dev/null +++ b/specification/subsumes.tsv @@ -0,0 +1,2 @@ +may-convert-from may-convert-to +https://gedcom.io/terms/v5.5.1/ABBR https://gedcom.io/terms/v7/ABBR