Skip to content

Commit

Permalink
Ignore sameAs field in the eu file
Browse files Browse the repository at this point in the history
  • Loading branch information
HKSenior committed Jan 16, 2025
1 parent fbe0386 commit dfad1f3
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions scripts/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit dfad1f3

Please sign in to comment.