bug fix
This commit is contained in:
parent
94398524b1
commit
8a90bf5e3f
|
@ -1,6 +1,8 @@
|
||||||
def first_datavalue(entity, pid):
|
def first_datavalue(entity, pid):
|
||||||
if pid in entity['claims']:
|
if pid in entity['claims']:
|
||||||
return entity['claims'][pid][0]['mainsnak']['datavalue']['value']
|
mainsnak = entity['claims'][pid][0]['mainsnak']
|
||||||
|
if 'datavalue' in mainsnak:
|
||||||
|
return mainsnak['datavalue']['value']
|
||||||
|
|
||||||
def get_entity_label(entity):
|
def get_entity_label(entity):
|
||||||
if 'en' in entity['labels']:
|
if 'en' in entity['labels']:
|
||||||
|
|
Loading…
Reference in a new issue