Use /entity/ links for referencing Wikidata over /wiki/; allow linking

from GND explorer

Close #32
This commit is contained in:
Joshua Ramon Enslin 2024-09-12 17:06:30 +02:00
parent bdb9bb16f5
commit dc1c72aeda
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE
2 changed files with 4 additions and 2 deletions

View File

@ -70,6 +70,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
'd-nb.info' => self::gnd,
'd-nb' => self::gnd,
'https://portal.dnb.de' => self::gnd,
'https://explore.gnd.network/gnd/' => self::gnd,
'grobsystematik' => self::grobsystematik,
'iconclass' => self::iconclass,
'klbb' => self::klbb,
@ -210,7 +211,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
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::wikidata => 'https://www.wikidata.org/entity/',
};
}
@ -624,7 +625,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
self::bnf => self::validateBnfId($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/']),
self::gnd => self::validateGndId($id, ['http://d-nb.info/gnd/', 'https://d-nb.info/gnd/', 'https://explore.gnd.network/gnd/']),
self::grobsystematik => self::validateNumericId($id, ['https://term.museum-digital.de/grobsystematik/tag/']),
self::iconclass => self::validateIconclassId($id),
self::klbb => self::validateNumericId($id, ['https://www.kl-bb.de/artist/', 'https://www.kl-bb.de/?page=actor&subPage=']),

View File

@ -31,6 +31,7 @@ final class MDNodaRepositoryTest extends TestCase {
self::assertEquals("102423008", MDNodaRepository::gnd->validateId("http://d-nb.info/gnd/102423008"));
self::assertEquals("102423008", MDNodaRepository::gnd->validateId("http://d-nb.info/gnd/ 102423008"));
self::assertEquals("1037602218", MDNodaRepository::gnd->validateId("http://d-nb.info/gnd/1037602218"));
self::assertEquals("1037602218", MDNodaRepository::gnd->validateId("https://explore.gnd.network/gnd/1037602218"));
self::assertEquals("102423008", MDNodaRepository::gnd->validateId("102423008"));
self::assertEquals(false, MDNodaRepository::gnd->validateId("fkld;s102423008"));