Prevent attempts to write link noda repositories for the incorrect

linkable types (e.g. iconclass for places)
This commit is contained in:
Joshua Ramon Enslin 2021-12-11 15:33:31 +01:00
parent 4a26ab60ca
commit 340bfac96c
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -765,6 +765,7 @@ final class NodaWikidataFetcher {
"wikidata" => $wikidata_id, "wikidata" => $wikidata_id,
]; ];
foreach (self::P_IDS_NODA_TAGS as $vocabName => $pId) { foreach (self::P_IDS_NODA_TAGS as $vocabName => $pId) {
if (!isset(MDNodaRepositoriesSet::REPOSITORIES_ACTOR[$vocabName])) continue;
if ($vocabName === 'lcsh') continue; if ($vocabName === 'lcsh') continue;
if (isset($data['claims'][$pId])) $nodaLinks[$vocabName] = $data['claims'][$pId][0]['mainsnak']['datavalue']['value']; if (isset($data['claims'][$pId])) $nodaLinks[$vocabName] = $data['claims'][$pId][0]['mainsnak']['datavalue']['value'];
} }
@ -1108,6 +1109,7 @@ final class NodaWikidataFetcher {
"wikidata" => $wikidata_id, "wikidata" => $wikidata_id,
]; ];
foreach (self::P_IDS_NODA_TAGS as $vocabName => $pId) { foreach (self::P_IDS_NODA_TAGS as $vocabName => $pId) {
if (!isset(MDNodaRepositoriesSet::REPOSITORIES_PLACE[$vocabName])) continue;
if ($vocabName === 'lcsh') continue; if ($vocabName === 'lcsh') continue;
if (isset($data['claims'][$pId])) $nodaLinks[$vocabName] = $data['claims'][$pId][0]['mainsnak']['datavalue']['value']; if (isset($data['claims'][$pId])) $nodaLinks[$vocabName] = $data['claims'][$pId][0]['mainsnak']['datavalue']['value'];
} }
@ -1496,6 +1498,7 @@ final class NodaWikidataFetcher {
"wikidata" => $wikidata_id, "wikidata" => $wikidata_id,
]; ];
foreach (self::P_IDS_NODA_TAGS as $vocabName => $pId) { foreach (self::P_IDS_NODA_TAGS as $vocabName => $pId) {
if (!isset(MDNodaRepositoriesSet::REPOSITORIES_TAG[$vocabName])) continue;
if ($vocabName === 'loc') continue; if ($vocabName === 'loc') continue;
if (isset($data['claims'][$pId])) $nodaLinks[$vocabName] = $data['claims'][$pId][0]['mainsnak']['datavalue']['value']; if (isset($data['claims'][$pId])) $nodaLinks[$vocabName] = $data['claims'][$pId][0]['mainsnak']['datavalue']['value'];
} }