Extend list of known genders to parse from Wikidata

This commit is contained in:
Joshua Ramon Enslin 2021-08-12 13:59:20 +02:00
parent aa9f307c55
commit 8eb576f43d
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -143,7 +143,7 @@ final class NodaWikidataFetcher {
return ''; return '';
} }
$wikipedia_cont = MD_STD::runCurl($linkUrl); if (empty($wikipedia_cont = MD_STD::runCurl($linkUrl))) return '';
$doc = new DOMDocument(); $doc = new DOMDocument();
if (!($doc->loadHTML($wikipedia_cont))) { if (!($doc->loadHTML($wikipedia_cont))) {
@ -575,11 +575,13 @@ final class NodaWikidataFetcher {
$wikidata_gender_id = $data['claims']['P21']['0']['mainsnak']['datavalue']['value']['id']; $wikidata_gender_id = $data['claims']['P21']['0']['mainsnak']['datavalue']['value']['id'];
switch ($wikidata_gender_id) { switch ($wikidata_gender_id) {
case "Q6581097": case "Q6581097": // male
case "Q44148": //male organism
$wikidata_gender = "male"; $wikidata_gender = "male";
break; break;
case "Q6581072": case "Q6581072":
case "Q1052281": case "Q1052281": // transgender female
case "Q43445": // female organism
$wikidata_gender = "female"; $wikidata_gender = "female";
break; break;
case "Q48270": case "Q48270":