Remove noda repository wikipedia, use GND Explorer for lookups/searches

in external norm data repository GND

Close #28, close #29
This commit is contained in:
Joshua Ramon Enslin 2024-07-19 00:59:37 +02:00
parent db46255f87
commit 32a1e8b1be
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE
2 changed files with 1 additions and 59 deletions

View File

@ -33,7 +33,6 @@ final class MDNodaRepositoriesSet extends MDValueSet {
'ulan',
'viaf',
'wikidata',
'Wikipedia',
];
public const REPOSITORIES_PLACE = [
@ -53,7 +52,6 @@ final class MDNodaRepositoriesSet extends MDValueSet {
'rkd',
'viaf',
'wikidata',
'Wikipedia',
];
public const REPOSITORIES_TAG = [
@ -76,7 +74,6 @@ final class MDNodaRepositoriesSet extends MDValueSet {
'rkd',
'viaf',
'wikidata',
'Wikipedia',
];
}

View File

@ -42,7 +42,6 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
case ulan;
case viaf;
case wikidata;
case wikipedia;
/**
* Returns a value of this type based on a string.
@ -103,12 +102,6 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
'Wikidata' => self::wikidata,
'www.wikidata.org' => self::wikidata,
'WIKIDATA' => self::wikidata,
'WIKIPEDIA' => self::wikipedia,
'wikipedia' => self::wikipedia,
'Wikipedia' => self::wikipedia,
'de.wikipedia.org' => self::wikipedia,
'en.wikipedia.org' => self::wikipedia,
'fr.wikipedia.org' => self::wikipedia,
default => throw new MDpageParameterNotFromListException("Unknown norm data repository: '" . $input . "'"),
};
@ -175,7 +168,6 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
self::ulan => 'ulan',
self::viaf => 'viaf',
self::wikidata => 'wikidata',
self::wikipedia => 'Wikipedia',
};
}
@ -219,7 +211,6 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
self::ulan => 'https://vocab.getty.edu/page/ulan/',
self::viaf => 'https://viaf.org/viaf/',
self::wikidata => 'https://www.wikidata.org/wiki/',
self::wikipedia => 'https://de.wikipedia.org/wiki/',
};
}
@ -258,7 +249,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
self::bnf => 'https://catalogue.bnf.fr/resultats-auteur.do?nomAuteur=' . urlencode($searchTerm) . '+&filtre=1&pageRech=rau',
self::cona => 'http://vocab.getty.edu/page/cona/' . urlencode($searchTerm),
self::editionhumboldtdigital => 'https://edition-humboldt.de/suche/ergebnisRegistersuche.xql?indexType=&q_text=' . urlencode($searchTerm),
self::gnd => 'https://portal.dnb.de/opac.htm?method=moveDown&currentResultId=' . urlencode((string)str_replace(' ', ' and ', $searchTerm)) . '%26any&categoryId=subjects',
self::gnd => 'https://explore.gnd.network/search?term=' . urlencode($searchTerm),
self::grobsystematik => 'https://term.museum-digital.de/redir.php?search=' . urlencode($searchTerm) . '&kind=tag|grobsystematik',
self::iconclass => 'http://iconclass.org/rkd/48C51/?q=' . urlencode($searchTerm) . '&q_s=1',
self::lcsh => 'https://id.loc.gov/search/?q=cs:http://id.loc.gov/authorities/subjects&q=' . urlencode($searchTerm),
@ -282,7 +273,6 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
self::ulan => 'http://www.getty.edu/vow/ULANServlet?english=Y&find=' . urlencode($searchTerm) . '&role=&page=1&nation=',
self::viaf => 'https://viaf.org/viaf/search?query=local.names+all+' . urlencode('"' . $searchTerm . '"') . '"&sortKeys=holdingscount&recordSchema=BriefVIAF',
self::wikidata => 'https://www.wikidata.org/w/index.php?search=&search=' . urlencode($searchTerm) . '&ns0=1&ns120=1',
self::wikipedia => 'https://en.wikipedia.org/w/index.php?search=' . urlencode($searchTerm),
};
}
@ -612,50 +602,6 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
}
/**
* Validates a Wikipedia link.
*
* @param string $id ID to validate.
*
* @return string|false
*/
public static function validateWikipediaId(string $id):string|false {
$validation = strtr($id, [
'http://de.wikipedia.org/wiki/' => '',
'https://de.wikipedia.org/wiki/' => '',
'http://da.wikipedia.org/wiki/' => '',
'https://da.wikipedia.org/wiki/' => '',
'http://en.wikipedia.org/wiki/' => '',
'https://en.wikipedia.org/wiki/' => '',
'http://es.wikipedia.org/wiki/' => '',
'https://es.wikipedia.org/wiki/' => '',
'http://fr.wikipedia.org/wiki/' => '',
'https://fr.wikipedia.org/wiki/' => '',
'http://hu.wikipedia.org/wiki/' => '',
'https://hu.wikipedia.org/wiki/' => '',
'http://id.wikipedia.org/wiki/' => '',
'https://id.wikipedia.org/wiki/' => '',
'http://it.wikipedia.org/wiki/' => '',
'https://it.wikipedia.org/wiki/' => '',
'http://nl.wikipedia.org/wiki/' => '',
'https://nl.wikipedia.org/wiki/' => '',
'http://sv.wikipedia.org/wiki/' => '',
'https://sv.wikipedia.org/wiki/' => '',
'http://ru.wikipedia.org/wiki/' => '',
'https://ru.wikipedia.org/wiki/' => '',
'http://uk.wikipedia.org/wiki/' => '',
'https://uk.wikipedia.org/wiki/' => '',
'http://zh.wikipedia.org/wiki/' => '',
'https://zh.wikipedia.org/wiki/' => '',
]);
if (str_contains($validation, "/")) return false;
return $validation;
}
/**
* Validates an ID.
*
@ -714,7 +660,6 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
'http://viaf.org/viaf/',
]),
self::wikidata => self::validateWikidataId($id),
self::wikipedia => self::validateWikipediaId($id),
};
}