Handle entity without labels.

This commit is contained in:
Edward Betts 2019-11-25 15:53:31 +00:00
parent 2cbc88a947
commit cc62265a0d

View file

@ -5,6 +5,8 @@ def first_datavalue(entity, pid):
return mainsnak['datavalue']['value']
def get_entity_label(entity):
if 'labels' not in entity:
return None
if 'en' in entity['labels']:
return entity['labels']['en']['value']