@@ -57,6 +57,7 @@ final class MDNodaRepositoriesSet extends MDValueSet {
|
||||
'aat',
|
||||
'ackerbau',
|
||||
'allgemein',
|
||||
'col',
|
||||
'bne',
|
||||
'bnf',
|
||||
'gnd',
|
||||
|
||||
@@ -16,6 +16,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
|
||||
case ackerbau;
|
||||
case bne;
|
||||
case bnf;
|
||||
case col;
|
||||
case cona;
|
||||
case editionhumboldtdigital;
|
||||
case gnd;
|
||||
@@ -52,13 +53,15 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
|
||||
public static function fromString(string $input):MDNodaRepository {
|
||||
|
||||
return match($input) {
|
||||
'allgemein' => self::allgemein, // General link to a good source
|
||||
'allgemein' => self::allgemein, // General link to a good source
|
||||
'AAT-ID',
|
||||
'aat' => self::aat,
|
||||
'ackerbau' => self::ackerbau,
|
||||
'bne' => self::bne,
|
||||
'bnf' => self::bnf,
|
||||
'cona' => self::cona,
|
||||
'aat' => self::aat,
|
||||
'ackerbau' => self::ackerbau,
|
||||
'bne' => self::bne,
|
||||
'bnf' => self::bnf,
|
||||
'col',
|
||||
'catalogue of life' => self::col,
|
||||
'cona' => self::cona,
|
||||
'edition humboldt digital' => self::editionhumboldtdigital,
|
||||
'gnd',
|
||||
'GND',
|
||||
@@ -72,6 +75,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
|
||||
'http://d-nb.info/gnd/',
|
||||
'd-nb.info',
|
||||
'd-nb',
|
||||
'Gemeinsame Normdatei',
|
||||
'https://portal.dnb.de',
|
||||
'https://explore.gnd.network/gnd/' => self::gnd,
|
||||
'grobsystematik' => self::grobsystematik,
|
||||
@@ -148,6 +152,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
|
||||
self::ackerbau => 'ackerbau',
|
||||
self::bne => 'bne',
|
||||
self::bnf => 'bnf',
|
||||
self::col => 'col',
|
||||
self::cona => 'cona',
|
||||
self::editionhumboldtdigital => 'edition humboldt digital',
|
||||
self::gnd => 'gnd',
|
||||
@@ -190,6 +195,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
|
||||
self::ackerbau => 'Ackerbau-Thesaurus',
|
||||
self::bne => 'Biblioteca Nacional de España (BNE)',
|
||||
self::bnf => 'Bibliothèque nationale de France (BNF)',
|
||||
self::col => 'Catalogue of Life',
|
||||
self::cona => 'Cultural Objects Name Authority (CONA)',
|
||||
self::editionhumboldtdigital => 'Edition Humboldt Digital',
|
||||
self::gnd => 'GND (Gemeinsame Normdatei)',
|
||||
@@ -232,6 +238,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
|
||||
self::ackerbau => 'https://term.museum-digital.de/ackerbau/tag/',
|
||||
self::bne => 'http://datos.bne.es/persona/',
|
||||
self::bnf => "https://catalogue.bnf.fr/ark:/12148/cb",
|
||||
self::col => 'https://www.catalogueoflife.org/data/taxon/',
|
||||
self::cona => 'https://vocab.getty.edu/page/cona/',
|
||||
self::editionhumboldtdigital => 'https://edition-humboldt.de/register/personen/detail.xql?normid=http://d-nb.info/gnd/',
|
||||
self::gnd => 'https://d-nb.info/gnd/',
|
||||
@@ -293,6 +300,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
|
||||
self::ackerbau => 'https://term.museum-digital.de/redir.php?search=' . urlencode($searchTerm) . '&kind=tag|ackerbau',
|
||||
self::bne => 'http://datos.bne.es/persona/' . urlencode($searchTerm),
|
||||
self::bnf => 'https://catalogue.bnf.fr/resultats-auteur.do?nomAuteur=' . urlencode($searchTerm) . '+&filtre=1&pageRech=rau',
|
||||
self::col => 'https://www.catalogueoflife.org/data/search?q=' . urlencode($searchTerm),
|
||||
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://explore.gnd.network/search?term=' . urlencode($searchTerm),
|
||||
@@ -539,6 +547,24 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates catalogue of life IDs.
|
||||
*
|
||||
* @param string $id ID to validate.
|
||||
*
|
||||
* @return string|false
|
||||
*/
|
||||
private static function validateColId(string $id):string|false {
|
||||
|
||||
$id = strtr(trim($id, '/'), [
|
||||
"http://www.catalogueoflife.org/data/taxon/" => "",
|
||||
"https://www.catalogueoflife.org/data/taxon/" => "",
|
||||
]);
|
||||
|
||||
return preg_match('/^([A-Z0-9]{2}|[A-Z0-9]{3}|[A-Z0-9]{4}|[A-Z0-9]{5})$/', $id) ? $id : false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates OrCID IDs.
|
||||
*
|
||||
@@ -692,6 +718,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
|
||||
self::ackerbau => self::validateNumericId($id, ['https://term.museum-digital.de/ackerbau/tag/']),
|
||||
self::bne => self::validateBneId($id, ['http://datos.bne.es/persona/', 'https://datos.bne.es/persona/']),
|
||||
self::bnf => self::validateBnfId($id),
|
||||
self::col => self::validateColId($id),
|
||||
self::cona => self::validateNumericId($id, ['http://vocab.getty.edu/page/cona/', 'https://vocab.getty.edu/page/cona/']),
|
||||
self::editionhumboldtdigital => self::validateGndId($id, ['https://edition-humboldt.de/register/personen/detail.xql?normid=http://d-nb.info/gnd/']),
|
||||
self::gnd => self::validateGndId($id, ['http://d-nb.info/gnd/', 'https://d-nb.info/gnd/', 'https://explore.gnd.network/gnd/']),
|
||||
|
||||
Reference in New Issue
Block a user