From 98d84054d6b27b497b67ee1ef1c3f6e9507ff517 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Tue, 30 Jun 2020 13:21:32 +0100 Subject: [PATCH] Handle 'unknown value' in depicts statement Closes: #30 --- app.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app.py b/app.py index 61b4354..8d04282 100755 --- a/app.py +++ b/app.py @@ -361,6 +361,9 @@ def existing_depicts_from_entity(entity): existing = [] new_depicts = False for claim in entity['claims']['P180']: + if 'datavalue' not in claim['mainsnak']: + continue + item_id = claim['mainsnak']['datavalue']['value']['numeric-id'] item = DepictsItem.query.get(item_id)