Add AVefi as norm data repository for tags

More information: https://www.av-efi.net/
This commit is contained in:
2026-06-16 11:49:56 +02:00
parent 834d06b70a
commit 79f13ee9c5
3 changed files with 69 additions and 11 deletions
+29
View File
@@ -14,6 +14,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
case allgemein; // General link to a good source
case aat;
case ackerbau;
case avefi;
case bne;
case bnf;
case col;
@@ -57,6 +58,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
'AAT-ID',
'aat' => self::aat,
'ackerbau' => self::ackerbau,
'avefi' => self::avefi,
'bne' => self::bne,
'bnf' => self::bnf,
'col',
@@ -156,6 +158,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
self::allgemein => 'allgemein', // General link to a good source
self::aat => 'aat',
self::ackerbau => 'ackerbau',
self::avefi => 'avefi',
self::bne => 'bne',
self::bnf => 'bnf',
self::col => 'col',
@@ -199,6 +202,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
self::allgemein => 'General', // General link to a good source
self::aat => 'Art & Architecture Thesaurus (AAT)',
self::ackerbau => 'Ackerbau-Thesaurus',
self::avefi => 'AVefi',
self::bne => 'Biblioteca Nacional de España (BNE)',
self::bnf => 'Bibliothèque nationale de France (BNF)',
self::col => 'Catalogue of Life',
@@ -242,6 +246,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
self::allgemein => '',
self::aat => 'https://vocab.getty.edu/page/aat/',
self::ackerbau => 'https://term.museum-digital.de/ackerbau/tag/',
self::avefi => 'https://hdl.handle.net/',
self::bne => 'http://datos.bne.es/persona/',
self::bnf => "https://catalogue.bnf.fr/ark:/12148/cb",
self::col => 'https://www.catalogueoflife.org/data/taxon/',
@@ -304,6 +309,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
self::allgemein => 'https://www.google.de/search?q=' . urlencode($searchTerm),
self::aat => 'https://www.getty.edu/vow/AATServlet?english=N&find=' . urlencode($searchTerm) . '&page=1&note=',
self::ackerbau => 'https://term.museum-digital.de/redir.php?search=' . urlencode($searchTerm) . '&kind=tag|ackerbau',
self::avefi => 'https://www.av-efi.net/search?query=' . 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::col => 'https://www.catalogueoflife.org/data/search?q=' . urlencode($searchTerm),
@@ -422,6 +428,28 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
}
/**
* Validates an AVefi ID. AVefi IDs are not numeric.
*
* @param string $id ID to validate.
*
* @return string|false
*/
private static function validateAvefiId(string $id):string|false {
if (str_contains($id, 'https://www.av-efi.net/')) {
$id = str_replace('https://www.av-efi.net/res/', '', $id);
}
if (str_contains($id, 'https://hdl.handle.net/')) {
$id = str_replace('https://hdl.handle.net/', '', $id);
}
if (substr_count($id, '/') !== 1) return false;
return $id;
}
/**
* Validates a BNE ID, returning a string or false. The BNE is basically equalivalent to the
* GND, just that the X character can be prepended to the number.
@@ -778,6 +806,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
'https://vocab.getty.edu/page/aat/',
]),
self::ackerbau => self::validateNumericId($id, ['https://term.museum-digital.de/ackerbau/tag/']),
self::avefi => self::validateAvefiId($id),
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),