Add function getUrlPrefix() to MDNodaRepository

This commit is contained in:
Joshua Ramon Enslin 2023-07-17 02:16:32 +02:00
parent 06cc1d4c10
commit 8684933c9c
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -134,6 +134,49 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
} }
/**
* Returns the URL prefix for the current repository.
*
* @return string
*/
public function getUrlPrefix():string {
return match($this) {
self::allgemein => '',
self::aat => 'https://vocab.getty.edu/page/aat/',
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::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/',
self::grobsystematik => 'https://term.museum-digital.de/grobsystematik/tag/',
self::iconclass => 'http://iconclass.org/rkd/',
self::lcsh => 'http://id.loc.gov/authorities/names/',
self::loc => 'http://id.loc.gov/authorities/names/',
self::mbl => 'http://www.uni-magdeburg.de/mbl/PHP_Skripte/mbl_verwaltung/mbl_verw_anzeige_biog.php?auswahl=3&liste_biog_name=',
self::mindatorg => 'https://www.mindat.org/min-', // Has suffix
self::moebeltypologie => 'https://term.museum-digital.de/moebel/tag/',
self::ndb_adb => 'https://www.deutsche-biographie.de/pnd',
self::ndl => 'https://id.ndl.go.jp/auth/ndlna/',
self::ndp_ikmk => 'https://ikmk.smb.museum/ndp/land/',
self::ndp_ikmk_persons => 'https://ikmk.smb.museum/ndp/person/',
self::nomisma => 'http://nomisma.org/id/',
self::npg => 'https://www.npg.org.uk/collections/search/person/',
self::oberbegriffsdatei => 'https://term.museum-digital.de/oberbegriffsdatei/tag/',
self::orcid => 'https://orcid.org/',
self::osm => 'https://www.openstreetmap.org/relation/',
self::pim => 'https://opac-nevter.pim.hu/en/record/-/record/',
self::pleiades => 'https://pleiades.stoa.org/places/',
self::rkd => 'https://rkd.nl/explore/artists/',
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/',
};
}
/** /**
* Returns the base of the repository's entity page URLs. * Returns the base of the repository's entity page URLs.
* *
@ -144,37 +187,9 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
public function getEntityLink(string $id):string { public function getEntityLink(string $id):string {
return match ($this) { return match ($this) {
self::allgemein => $id,
self::aat => 'https://vocab.getty.edu/page/aat/' . $id,
self::ackerbau => 'https://term.museum-digital.de/ackerbau/tag/' . $id,
self::bne => 'http://datos.bne.es/persona/' . $id,
self::bnf => "https://catalogue.bnf.fr/ark:/12148/cb" . $id,
self::cona => 'https://vocab.getty.edu/page/cona/' . $id,
self::editionhumboldtdigital => 'https://edition-humboldt.de/register/personen/detail.xql?normid=http://d-nb.info/gnd/' . $id,
self::gnd => 'https://d-nb.info/gnd/' . $id,
self::grobsystematik => 'https://term.museum-digital.de/grobsystematik/tag/' . $id,
self::iconclass => 'http://iconclass.org/rkd/' . $id,
self::lcsh => 'http://id.loc.gov/authorities/names/' . $id,
self::loc => 'http://id.loc.gov/authorities/names/' . $id,
self::mbl => 'http://www.uni-magdeburg.de/mbl/PHP_Skripte/mbl_verwaltung/mbl_verw_anzeige_biog.php?auswahl=3&liste_biog_name=' . $id,
self::mindatorg => 'https://www.mindat.org/min-' . $id . '.html',
self::moebeltypologie => 'https://term.museum-digital.de/moebel/tag/' . $id,
self::ndb_adb => 'https://www.deutsche-biographie.de/pnd' . $id . '.html', self::ndb_adb => 'https://www.deutsche-biographie.de/pnd' . $id . '.html',
self::ndl => 'https://id.ndl.go.jp/auth/ndlna/' . $id, self::mindatorg => 'https://www.mindat.org/min-' . $id . '.html',
self::ndp_ikmk => 'https://ikmk.smb.museum/ndp/land/' . $id, default => $this->getUrlPrefix() . $id,
self::ndp_ikmk_persons => 'https://ikmk.smb.museum/ndp/person/' . $id,
self::nomisma => 'http://nomisma.org/id/' . $id,
self::npg => 'https://www.npg.org.uk/collections/search/person/' . $id,
self::oberbegriffsdatei => 'https://term.museum-digital.de/oberbegriffsdatei/tag/' . $id,
self::orcid => 'https://orcid.org/' . $id,
self::osm => 'https://www.openstreetmap.org/relation/' . $id,
self::pim => 'https://opac-nevter.pim.hu/en/record/-/record/' . $id,
self::pleiades => 'https://pleiades.stoa.org/places/' . $id,
self::rkd => 'https://rkd.nl/explore/artists/' . $id,
self::ulan => 'https://vocab.getty.edu/page/ulan/' . $id,
self::viaf => 'https://viaf.org/viaf/' . $id,
self::wikidata => 'https://www.wikidata.org/wiki/' . $id,
self::wikipedia => 'https://de.wikipedia.org/wiki/' . $id,
}; };
} }