|
|
@@ -16,6 +16,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
|
|
|
|
case ackerbau;
|
|
|
|
case ackerbau;
|
|
|
|
case bne;
|
|
|
|
case bne;
|
|
|
|
case bnf;
|
|
|
|
case bnf;
|
|
|
|
|
|
|
|
case col;
|
|
|
|
case cona;
|
|
|
|
case cona;
|
|
|
|
case editionhumboldtdigital;
|
|
|
|
case editionhumboldtdigital;
|
|
|
|
case gnd;
|
|
|
|
case gnd;
|
|
|
@@ -52,13 +53,15 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
|
|
|
|
public static function fromString(string $input):MDNodaRepository {
|
|
|
|
public static function fromString(string $input):MDNodaRepository {
|
|
|
|
|
|
|
|
|
|
|
|
return match($input) {
|
|
|
|
return match($input) {
|
|
|
|
'allgemein' => self::allgemein, // General link to a good source
|
|
|
|
'allgemein' => self::allgemein, // General link to a good source
|
|
|
|
'AAT-ID',
|
|
|
|
'AAT-ID',
|
|
|
|
'aat' => self::aat,
|
|
|
|
'aat' => self::aat,
|
|
|
|
'ackerbau' => self::ackerbau,
|
|
|
|
'ackerbau' => self::ackerbau,
|
|
|
|
'bne' => self::bne,
|
|
|
|
'bne' => self::bne,
|
|
|
|
'bnf' => self::bnf,
|
|
|
|
'bnf' => self::bnf,
|
|
|
|
'cona' => self::cona,
|
|
|
|
'col',
|
|
|
|
|
|
|
|
'catalogue of life' => self::col,
|
|
|
|
|
|
|
|
'cona' => self::cona,
|
|
|
|
'edition humboldt digital' => self::editionhumboldtdigital,
|
|
|
|
'edition humboldt digital' => self::editionhumboldtdigital,
|
|
|
|
'gnd',
|
|
|
|
'gnd',
|
|
|
|
'GND',
|
|
|
|
'GND',
|
|
|
@@ -72,6 +75,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
|
|
|
|
'http://d-nb.info/gnd/',
|
|
|
|
'http://d-nb.info/gnd/',
|
|
|
|
'd-nb.info',
|
|
|
|
'd-nb.info',
|
|
|
|
'd-nb',
|
|
|
|
'd-nb',
|
|
|
|
|
|
|
|
'Gemeinsame Normdatei',
|
|
|
|
'https://portal.dnb.de',
|
|
|
|
'https://portal.dnb.de',
|
|
|
|
'https://explore.gnd.network/gnd/' => self::gnd,
|
|
|
|
'https://explore.gnd.network/gnd/' => self::gnd,
|
|
|
|
'grobsystematik' => self::grobsystematik,
|
|
|
|
'grobsystematik' => self::grobsystematik,
|
|
|
@@ -148,6 +152,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
|
|
|
|
self::ackerbau => 'ackerbau',
|
|
|
|
self::ackerbau => 'ackerbau',
|
|
|
|
self::bne => 'bne',
|
|
|
|
self::bne => 'bne',
|
|
|
|
self::bnf => 'bnf',
|
|
|
|
self::bnf => 'bnf',
|
|
|
|
|
|
|
|
self::col => 'col',
|
|
|
|
self::cona => 'cona',
|
|
|
|
self::cona => 'cona',
|
|
|
|
self::editionhumboldtdigital => 'edition humboldt digital',
|
|
|
|
self::editionhumboldtdigital => 'edition humboldt digital',
|
|
|
|
self::gnd => 'gnd',
|
|
|
|
self::gnd => 'gnd',
|
|
|
@@ -190,6 +195,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
|
|
|
|
self::ackerbau => 'Ackerbau-Thesaurus',
|
|
|
|
self::ackerbau => 'Ackerbau-Thesaurus',
|
|
|
|
self::bne => 'Biblioteca Nacional de España (BNE)',
|
|
|
|
self::bne => 'Biblioteca Nacional de España (BNE)',
|
|
|
|
self::bnf => 'Bibliothèque nationale de France (BNF)',
|
|
|
|
self::bnf => 'Bibliothèque nationale de France (BNF)',
|
|
|
|
|
|
|
|
self::col => 'Catalogue of Life',
|
|
|
|
self::cona => 'Cultural Objects Name Authority (CONA)',
|
|
|
|
self::cona => 'Cultural Objects Name Authority (CONA)',
|
|
|
|
self::editionhumboldtdigital => 'Edition Humboldt Digital',
|
|
|
|
self::editionhumboldtdigital => 'Edition Humboldt Digital',
|
|
|
|
self::gnd => 'GND (Gemeinsame Normdatei)',
|
|
|
|
self::gnd => 'GND (Gemeinsame Normdatei)',
|
|
|
@@ -232,6 +238,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
|
|
|
|
self::ackerbau => 'https://term.museum-digital.de/ackerbau/tag/',
|
|
|
|
self::ackerbau => 'https://term.museum-digital.de/ackerbau/tag/',
|
|
|
|
self::bne => 'http://datos.bne.es/persona/',
|
|
|
|
self::bne => 'http://datos.bne.es/persona/',
|
|
|
|
self::bnf => "https://catalogue.bnf.fr/ark:/12148/cb",
|
|
|
|
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::cona => 'https://vocab.getty.edu/page/cona/',
|
|
|
|
self::editionhumboldtdigital => 'https://edition-humboldt.de/register/personen/detail.xql?normid=http://d-nb.info/gnd/',
|
|
|
|
self::editionhumboldtdigital => 'https://edition-humboldt.de/register/personen/detail.xql?normid=http://d-nb.info/gnd/',
|
|
|
|
self::gnd => 'https://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::ackerbau => 'https://term.museum-digital.de/redir.php?search=' . urlencode($searchTerm) . '&kind=tag|ackerbau',
|
|
|
|
self::bne => 'http://datos.bne.es/persona/' . urlencode($searchTerm),
|
|
|
|
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::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::cona => 'http://vocab.getty.edu/page/cona/' . urlencode($searchTerm),
|
|
|
|
self::editionhumboldtdigital => 'https://edition-humboldt.de/suche/ergebnisRegistersuche.xql?indexType=&q_text=' . 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),
|
|
|
|
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.
|
|
|
|
* 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::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::bne => self::validateBneId($id, ['http://datos.bne.es/persona/', 'https://datos.bne.es/persona/']),
|
|
|
|
self::bnf => self::validateBnfId($id),
|
|
|
|
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::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::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/']),
|
|
|
|
self::gnd => self::validateGndId($id, ['http://d-nb.info/gnd/', 'https://d-nb.info/gnd/', 'https://explore.gnd.network/gnd/']),
|
|
|
|