From 19c7405553e058969e36b82f56e5575c72abf6d3 Mon Sep 17 00:00:00 2001 From: Enno Hermann Date: Tue, 19 Mar 2024 10:44:58 +0100 Subject: [PATCH] Explicitly annotate non-person etymology Setting gender to '-' instead of null when there is an etymology, but person==False, allows to render it differently from completely missing etymology. --- Command/GeoJSONCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Command/GeoJSONCommand.php b/Command/GeoJSONCommand.php index 306c957..13580a9 100644 --- a/Command/GeoJSONCommand.php +++ b/Command/GeoJSONCommand.php @@ -395,7 +395,7 @@ private function createProperties($object, array &$warnings = []): Properties $_person = array_unique(array_column($detailsEtymology, 'person')); $_gender = array_unique(array_column($detailsEtymology, 'gender')); - $genderEtymology = (count($_person) === 1 && current($_person) === true) ? (count($_gender) === 1 ? current($_gender) : '+') : false; + $genderEtymology = (count($_person) === 1 && current($_person) === true) ? (count($_gender) === 1 ? current($_gender) : '+') : '-'; if (count($detailsEtymology) === 1) { $detailsEtymology = current($detailsEtymology); @@ -433,7 +433,7 @@ private function createProperties($object, array &$warnings = []): Properties $_person = array_unique(array_column($detailsWikidata, 'person')); $_gender = array_unique(array_column($detailsWikidata, 'gender')); - $genderWikidata = (count($_person) === 1 && current($_person) === true) ? (count($_gender) === 1 ? current($_gender) : '+') : false; + $genderWikidata = (count($_person) === 1 && current($_person) === true) ? (count($_gender) === 1 ? current($_gender) : '+') : '-'; if (count($detailsWikidata) === 1) { $detailsWikidata = current($detailsWikidata);