From dfad1f336741c814d57213d8904c7a0314144537 Mon Sep 17 00:00:00 2001 From: Hassani King Senior Date: Thu, 16 Jan 2025 11:33:28 -0500 Subject: [PATCH] Ignore sameAs field in the eu file --- scripts/compile.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/scripts/compile.py b/scripts/compile.py index 88d0c837..baf48808 100755 --- a/scripts/compile.py +++ b/scripts/compile.py @@ -147,21 +147,22 @@ def main(): sources[id_].append(filename) # process sameAs - for dup_id, orig_id in same_as.items(): - if orig_id not in ids: - abort('{0} is sameAs {1} which does not exist'.format(dup_id, orig_id)) - - dup = ids[dup_id] - orig = ids[orig_id] - if orig.get('sameAs'): - msg = 'sameAs chain: {0} -> {1} -> {2}'.format( - dup_id, orig_id, orig['sameAs']) - abort(msg) - - # copy name if it doesn't exist - if not dup.get('name'): - dup['name'] = orig['name'] - records_with['name'] += 1 + if not country == 'eu': + for dup_id, orig_id in same_as.items(): + if orig_id not in ids: + abort('{0} is sameAs {1} which does not exist'.format(dup_id, orig_id)) + + dup = ids[dup_id] + orig = ids[orig_id] + if orig.get('sameAs'): + msg = 'sameAs chain: {0} -> {1} -> {2}'.format( + dup_id, orig_id, orig['sameAs']) + abort(msg) + + # copy name if it doesn't exist + if not dup.get('name'): + dup['name'] = orig['name'] + records_with['name'] += 1 # data quality: parents missing_parents -= set(ids.keys())