Skip importing uncertain birth years in Wikidata fetcher

This commit is contained in:
Joshua Ramon Enslin 2022-07-20 15:50:42 +02:00
parent 027d4b3506
commit ece1e44a9e
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -682,7 +682,11 @@ final class NodaWikidataFetcher {
if ($actor_dates['persinst_geburtsjahr'] === '') { if ($actor_dates['persinst_geburtsjahr'] === '') {
// Try to get birth date // Try to get birth date
if (!empty($data['claims']['P569']) and !empty($data['claims']['P569']['0']['mainsnak']['datavalue']['value']['time'])) { if (!empty($data['claims']['P569'])
and !empty($data['claims']['P569']['0']['mainsnak']['datavalue']['value']['time'])
// Ignore entries with century / very inprecise birth dates
and (empty($data['claims']['P569']['0']['mainsnak']['datavalue']['value']['precision']) || (int)$data['claims']['P569']['0']['mainsnak']['datavalue']['value']['precision'] !== 7)
) {
$birth_date = self::wikidataBirthDeathToYear($data['claims']['P569']['0']['mainsnak']['datavalue']['value']['time']); $birth_date = self::wikidataBirthDeathToYear($data['claims']['P569']['0']['mainsnak']['datavalue']['value']['time']);
} }