Modulo:Kontrol ti autoridad

Dokumentasion ti modulo

Daytoy a modulo ket us-usaren ti plantilia {{Kontrol ti autoridad}}. Kitaen ti {{Kontrol ti autoridad/dok}} para kadagiti panangipalpalawag ti panagusar.


Dagiti parametro, tatagikua ti Wikidata, ken pagsurotan a katkategoria

ParametroSeksionAgparang a kasTagikua ti WikidataPagsurotan a katkategoria ken bilang ti panid
Ar-artikuloDagiti naperdi nga ID
AAGDagiti galeria ken museo ti arteAucklandP3372140
ACM-DLDagiti sientipiko a databaseGunglo para iti Komputado ti MakinaP86430
ADBDagiti bibliograpiko a diksionarioAustraliaP190790
admiraltyDagiti panangilasin ti silaw-taawAdmiraltyP356200
AGSADagiti galeria ken museo ti arteAbagatan nga AustraliaP680490
ARLHSDagiti panangilasin ti silaw-taawARLHSP298000
autores.uyDagiti bibliograpiko a diksionarioUruguayP2558: ID ti autores.uy00
AWRDagiti bibliograpiko a diksionarioRehistro ti Babbai ti AustraliaP418610
BIBSYSDagiti nailian a bibliotekaNorwegaP1015: panangilasin ti BIBSYS8520
BildindexDagiti patakder ti panagsukisok ti arteBildindex (Alemania)P209200
BNCDagiti nailian a bibliotekaChileP1890: ID ti CCAB4070
BNEDagiti nailian a bibliotekaEspaniaP950: panangilasin ti BNE1,2360
BNFDagiti nailian a bibliotekaPransia (datos)P268: panangilasin ti BNF1,5410
BotanikoDagiti sientipiko a databaseInternational Plant Names IndexP428530
BPNDagiti bibliograpiko a diksionarioOlandaP651: BPN340
CANTICDagiti nailian a bibliotekaKataloniaP1273: CANTIC40
CANTICNDagiti nailian a bibliotekaKataloniaP99848220
CCGDagiti panangilasin ti silaw-taawCCGP392000
CINIIDagiti sientipiko a databaseCiNii (Hapon)P2717610
CWGCDaddumaKomision dagiti Tanem ti Gubat ti MankomunidadP190800
DAAODagiti patakder ti panagsukisok ti arteDagiti Artista ti AustraliaP170720
DBLPDagiti sientipiko a databaseDBLP (siensia ti kompiuter)P245690
DIBDagiti bibliograpiko a diksionarioIrlandaP6829011
DSIDagiti patakder ti panagsukisok ti arteDagiti sientipiko nga ilustradorP2349160
DTBIODagiti bibliograpiko a diksionarioAlemaniaP79029800
EMUDagiti nailian a bibliotekaUkraniaP46131250
FASTDaddumaFaceted Application of Subject TerminologyP21631,4320
FNZADagiti patakder ti panagsukisok ti arteDagiti Artista ti Baro a SelandaP679200
GNDDagiti nailian a bibliotekaAlemaniaP227: panangilasin ti GND1,9920
Google ScholarDagiti sientipiko a databaseGoogle ScholarP1960140
HDSDaddumaNaipakasaritaan a Diksionario ti SuisaP902: ID ti HDS2400
IAAFDaddumaWorld AthleticsP114610
ICCUDagiti nailian a bibliotekaItaliaP396: panangilasin ti SBN5870
ICIADagiti patakder ti panagsukisok ti arteICIA (Israel)P173600
IEUDaddumaEnsiklopedia ti Intenet ti UkraniaP9070140
ISNISapasapISNIP213: ISNI1,4540
J9UDagiti nailian a bibliotekaIsraelP81891,8730
JocondeDagiti patakder ti panagsukisok ti arteJoconde (Pransia)P34700
KULTURNAVDagiti patakder ti panagsukisok ti arteKulturNav (Norwega)P1248930
LCCNDagiti nailian a bibliotekaEstados UnidosP244: Panagtengngel a Numero ti Biblioteka ti Kongreso (LCCN)1,9710
LIRDaddumaLexicon Istoric Retic (Suisa)P88660
LNBDagiti nailian a bibliotekaLetoniaP1368: ID ti LNB6140
MATHSNDagiti sientipiko a databaseMathSciNetP4955540
MBADaddumaMusicBrainz (artista)P434: ID ti artista ti MusicBrainz6160
MBAREADaddumaMusicBrainz (ayan)P982: ID ti ayan ti MusicBrainz4810
MBIDaddumaMusicBrainz (instrumento)P1330: ID ti instrumento ti MusicBrainz10
MBLDaddumaMusicBrainz (etiketa)P966: ID ti etiketa ti MusicBrainz20
MBPDaddumaMusicBrainz (lugar)P1004: ID ti lugar ti MusicBrainz20
MBRGDaddumaMusicBrainz (grupo ti panagipablaak)P436: ID ti grupo ti panagipablaak ti MusicBrainz10
MBSDaddumaMusicBrainz (serye)P1407: ID ti serye ti MusicBrainz00
MBWDaddumaMusicBrainz (obra)P43530
MGPDagiti sientipiko a databaseProyekto ti Henelohia ti MatematikaP549630
NARADaddumaNailian nga Ar-arkibo (EU)P12256500
NCLDagiti nailian a bibliotekaTaiwanP1048480
NDLDagiti nailian a bibliotekaHaponP349: panangilasin ti NDL1,0760
NGADagiti panangilasin ti silaw-taawNGAP356300
NGVDagiti galeria ken museo ti arteVictoriaP2041210
NKCDagiti nailian a bibliotekaRepublika a TsekaP691: panangilasin ti NKC1,6320
NLADagiti nailian a bibliotekaAustraliaP409: panangilasin ti NLA8320
NLGDagiti nailian a bibliotekaGresiaP3348: ID ti Nailian a Biblioteka ti Gresia4870
NLKDagiti nailian a bibliotekaKoreaP503465014
NLPDagiti nailian a bibliotekaPoloniaP169500
NLRDagiti nailian a bibliotekaRomaniaP1003: ID ti Nailian a Biblioteka ti Romania650
NSKDagiti nailian a bibliotekaKroasiaP13755090
NTADagiti nailian a bibliotekaOlandaP1006: panangilasin ti NTA (Olanda)1,0050
ORCIDSapasapORCIDP496: ORCID160
PICDagiti patakder ti panagsukisok ti arteIdentidad dagiti PotograpoP2750310
PLWABNDagiti nailian a bibliotekaPoloniaP72939060
PublonsDagiti sientipiko a databasePublons (dagiti agsuksukisok)P382900
RIDDagiti sientipiko a databaseResearcherIDP105310
RISMDaddumaRISM (Pransia)P55040195
RERODaddumaRERO (Suisa)P30657900
RKDartistsDagiti patakder ti panagsukisok ti arteRKD Artists (Olanda)P650: RKDartists1210
RKDIDDagiti patakder ti panagsukisok ti arteRKD ID (Olanda)P35000
RSLDagiti nailian a bibliotekaRusiaP947: panangilasin ti RSL (tao)1060
ScopusDagiti sientipiko a databasemannurat ti ScopusP1153310
SELIBRDagiti nailian a bibliotekaSuesiaP906: SELIBR6620
SIKARTDagiti patakder ti panagsukisok ti arteSIKART (Suisa)P78130
SNAC-IDDaddumaSocial Networks and Archival ContextP34308080
SUDOCDaddumaSUDOC (Pransia)P269: dagiti turay ti idRef1,4130
TA98Dagiti sientipiko a databaseTerminologia AnatomicaP132300
TDVİADaddumaİslâm AnsiklopedisiP73141360
TePapaDagiti galeria ken museo ti arteTe Papa (Baro a Selanda)P35441230
TLSDaddumaTheaterlexikon (Suisa)P136250
TroveDaddumaTrove (Australia)P13157750
UKPARLDaddumaParlamento ti NPP62131440
ULANDagiti patakder ti panagsukisok ti arteNagnagan ti artista (Getty)P245: panangilasin ti ULAN3500
USCGDagiti panangilasin ti silaw-taawUSCGP372300
USCongressDaddumaKongreso ti EUP1157700
VcBADagiti nailian a bibliotekaBatikanoP80346210
VIAFSapasapVIAFP214: panangilasin ti VIAF1,9960
WORLDCATIDSapasapWorldCatP78592510
ZBMATHDagiti sientipiko a databasezbMATHP15561030
SapasapWorldCat (babaen ti Biblioteka ti Kongreso)3
SapasapWorldCat (babaen ti VIAF)1,745
Dagiti dagup9336,577220

Dagiti maipatinayon a pagsurotan a katkategoria

Isayangkat pay daytoy a modulo dagiti sumaganad a pagsurotan a kategoria:

Bilang dagiti panagilasin

Parametro ti state

  • Kategoria:Kontrol ti autoridad nga agus-usar iti parametro ti state: collapsed (0)
  • Kategoria:Kontrol ti autoridad nga agus-usar iti parametro ti state: expanded (0)
  • Kategoria:Kontrol ti autoridad nga agus-usar iti parametro ti state: autocollapse (0)
  • Kategoria:Kontrol ti autoridad nga agus-usar iti parametro ti state: other (0)

require('strict')local p = {}local title = mw.title.getCurrentTitle()local namespace = title.namespacelocal testcases = (string.sub(title.subpageText,1,9) == 'pangsubok')--[[==========================================================================]]--[[                            Category functions                            ]]--[[==========================================================================]]local function addCat( cat )if cat and cat ~= '' then return '[[Kategoria:'..cat..']]'..p.redCatLink(cat) endreturn ''endfunction p.getCatForId( id )local cat = ''if namespace == 0 thencat = 'Dagiti artikulo nga agraman kadagiti panangilasin ti '.. id ..' 'endreturn addCat(cat)endfunction p.redCatLink( cat ) --cat == 'Blah' (not 'Category:Blah', not '[[Category:Blah]]')if cat and cat ~= '' and   testcases == false and   mw.title.new(cat, 14).exists == falsethenreturn '[[Kategoria:Pampanid nga agraman kadagiti nasilpuan iti nalabbasit a kategoria ti kontrol ti autoridad]]'endreturn ''endfunction p.createRow( id, rawValues, link, links, withUid, specialCat, prefix)local faultyCat = 'Dagiti artikulo nga agraman kadagiti naperdi a panangilasin ti '..(specialCat or id)..' 'if links then -- all links[] use withUid = false; no check neededlocal row = ''if prefix thenrow = row..'*'..prefixendfor i, l in ipairs( links ) doif i == 1 and not prefix then row = row..'*'else           row = row..'\n**' endif l thenrow = row..'<span class="uid">'..l..'</span>'elserow = row..'<span class="error">Saan nga umiso ti id ti '..id..' '..rawValues[i]..'.</span>'..addCat(faultyCat)endendreturn row..'\n'elseif link then -- All IDs that have a prefix support multiple identifiers, so prefix is not neededif withUid thenreturn '*<span class="nowrap"><span class="uid">'..link..'</span></span>\n'endreturn '*<span class="nowrap">'..link..'</span>\n'endreturn '* <span class="error">Saan nga umiso ti id ti '..id..' '..rawValues..'.</span>'..addCat(faultyCat)..'\n'end--[[==========================================================================]]--[[                      Property formatting functions                       ]]--[[==========================================================================]]-- If a link has a suitable entry in the global inter-wiki prefix table at [[:m:Interwiki_map]],-- please consider routing through this prefix rather than as external link URL.-- This will ease future maintenance as necessary updates to the link can be centrally carried out there rather than by updating this module.-- The "external link" icon would disappear for such entries.function p.aagLink( id, label)--P3372's format regex: \d+ (e.g. 1)if not id:match( '^%d+$' ) thenreturn falseendreturn '[https://www.aucklandartgallery.com/explore-art-and-ideas/artist/'..id..'/ '..(label or 'Auckland')..']'..p.getCatForId( 'AAG' )endfunction p.acmLink( id, label )--P864's format regex: \d{11} (e.g. 12345678901)if not id:match( '^%d%d%d%d%d%d%d%d%d%d%d$' ) thenreturn falseendreturn '[https://dl.acm.org/profile/'..id..' '..(label or 'Gunglo para iti Komputado ti Makina')..']'..p.getCatForId( 'ACM-DL' )endfunction p.adbLink( id, label )--P1907's format regex: [a-z][-a-z]+-([1-3]\d|[1-9])\d{0,3} (e.g. barton-sir-edmund-toby-71)if not id:match( '^[a-z][-a-z]+-[1-3]%d%d?%d?%d?$' ) and   not id:match( '^[a-z][-a-z]+-[1-9]%d?%d?%d?$' ) thenreturn falseendreturn '[http://adb.anu.edu.au/biography/'..id..' '..(label or 'Australia')..']'..p.getCatForId( 'ADB' )endfunction p.admiraltyLink(id,label)--P3562's format regex: [A-Q]\d{4}(\.\d+)? (e.g. D1204.1)if not id:match('^[A-Q]%d%d%d%d$') and   not id:match('^[A-Q]%d%d%d%d%.%d+$') thenreturn falseendreturn id..p.getCatForId( 'admiralty' )endfunction p.agsaLink( id, label )--P6804's format regex: [1-9]\d* (e.g. 3625)if not id:match( '^[1-9]%d*$' ) thenreturn falseendreturn '[https://www.agsa.sa.gov.au/collection-publications/collection/creators/_/'..id..'/ '..(label or 'Abagatan nga Australia')..']'..p.getCatForId( 'AGSA' )endfunction p.ARLHSLink(id,label)--P2980's format regex: [A-Z]{3}\d{3,4}[A-Z]?| e.g. LAT023if not id:match('^[A-Z][A-Z][A-Z]%d%d%d%d?[A-Z]?$') thenreturn falseendreturn '[http://wlol.arlhs.com/lighthouse/'..id..'.html '..(label or 'ARLHS')..']'..p.getCatForId( 'ARLHS' )endfunction p.autoresuyLink( id, label )--P2558's format regex: [1-9]\d{0,4} (e.g. 12345)if not id:match( '^[1-9]%d?%d?%d?%d?$' ) thenreturn falseendreturn '[https://autores.uy/autor/'..id..' '..(label or 'Uruguay')..']'..p.getCatForId( 'autores.uy' )endfunction p.awrLink( id, label )--P4186's format regex: (([A-Z]{3}\d{4})|([A-Z]{2}\d{5}))[a-z] (e.g. PR00768b)if not id:match( '^[A-Z][A-Z][A-Z]%d%d%d%d[a-z]$' ) and   not id:match( '^[A-Z][A-Z]%d%d%d%d%d[a-z]$' ) thenreturn falseendreturn '[http://www.womenaustralia.info/biogs/'..id..'.htm '..(label or 'Rehistro ti Babbai ti Australia')..']'..p.getCatForId( 'AWR' )endfunction p.bibsysLink( id, label )--P1015's format regex: [1-9]\d* or [1-9](\d{0,8}|\d{12}) (e.g. 1234567890123)--TODO: follow up @ [[d:Property talk:P1015#Discrepancy between the 2 regex constraints]] or escalate/investigateif not id:match( '^[1-9]%d?%d?%d?%d?%d?%d?%d?%d?$' ) and   not id:match( '^[1-9]%d%d%d%d%d%d%d%d%d%d%d%d$' ) thenreturn falseendreturn '[https://authority.bibsys.no/authority/rest/authorities/html/'..id..' '..(label or 'Norwega')..']'..p.getCatForId( 'BIBSYS' )endfunction p.bildLink( id, label )--P2092's format regex: \d+ (e.g. 1)if not id:match( '^%d+$' ) thenreturn falseendreturn '[https://www.bildindex.de/document/obj'..id..' '..(label or 'Bildindex (Alemania)')..']'..p.getCatForId( 'Bildindex' )endfunction p.bncLink( id, label )--P1890's format regex: \d{9} (e.g. 123456789)if not id:match( '^%d%d%d%d%d%d%d%d%d$' ) thenreturn falseendreturn '[http://www.bncatalogo.cl/F?func=direct&local_base=red10&doc_number='..id..' '..(label or 'Chile')..']'..p.getCatForId( 'BNC' )endfunction p.bneLink( id, label )--P950's format regex: (XX|FF|a)\d{4,7}|(bima|bimo|bica|bis[eo]|bivi|Mise|Mimo|Mima)\d{10} (e.g. XX1234567)if not id:match( '^[XF][XF]%d%d%d%d%d?%d?%d?$' ) and   not id:match( '^a%d%d%d%d%d?%d?%d?$' ) and   not id:match( '^bi[mcsv][aoei]%d%d%d%d%d%d%d%d%d%d$' ) and   not id:match( '^Mi[sm][eoa]%d%d%d%d%d%d%d%d%d%d$' ) thenreturn falseendreturn '[http://catalogo.bne.es/uhtbin/authoritybrowse.cgi?action=display&authority_id='..id..' '..(label or 'Espania')..']'..p.getCatForId( 'BNE' ) --no https as of 9/2019endfunction p.bnfLink( id, label )--P268's format regex: \d{8}[0-9bcdfghjkmnpqrstvwxz] (e.g. 123456789)if not id:match( '^c?b?%d%d%d%d%d%d%d%d[0-9bcdfghjkmnpqrstvwxz]$' ) thenreturn falseend--Add cb prefix if it has been removedif not id:match( '^cb.+$' ) thenid = 'cb'..idendreturn '[https://catalogue.bnf.fr/ark:/12148/'..id..' '..(label or 'Pransia')..'] [https://data.bnf.fr/ark:/12148/'..id..' (datos)]'..p.getCatForId( 'BNF' )endfunction p.botanistLink( id, label )--P428's format regex: ('t )?(d')?(de )?(la )?(van (der )?)?(Ma?c)?(De)?(Di)?\p{Lu}?C?['\p{Ll}]*([-'. ]*(van )?(y )?(d[ae][nr]?[- ])?(Ma?c)?[\p{Lu}bht]?C?['\p{Ll}]*)*\.? ?f?\.? (e.g. L.)--not easily/meaningfully implementable in Lua's regex since "(this)?" is not allowed...if not mw.ustring.match( id, "^[%u%l%d%. '-]+$" ) then --better than nothingreturn falseendid = id:gsub(' +', '%%20')return '[https://www.ipni.org/ipni/advAuthorSearch.do?find_abbreviation='..id..' '..(label or 'International Plant Names Index')..']'..p.getCatForId( 'Botaniko' )endfunction p.bpnLink( id, label )--P651's format regex: \d{6,8} (e.g. 00123456)if not id:match( '^%d%d%d%d%d%d%d%d$' ) and --original format regex, changed 8/2019 to   not id:match( '^0?%d%d%d%d%d%d%d$' ) and --allow 1-2 leading 0s, allowed by the website   not id:match( '^0?0?%d%d%d%d%d%d$' ) thenreturn falseendreturn '[http://www.biografischportaal.nl/en/persoon/'..id..' '..(label or 'Olanda')..']'..p.getCatForId( 'BPN' ) --no https as of 9/2019endfunction p.canticLink( id, label )--P1273's format regex: a\d{7}[0-9x] (e.g. a10640745)if not id:match( '^a%d%d%d%d%d%d%d[%dx]$' ) thenreturn falseendreturn '[http://cantic.bnc.cat/registres/CUCId/'..id..' '..(label or 'Katalonia')..']'..p.getCatForId( 'CANTIC' ) --no https as of 10/2019endfunction p.canticnLink( id, label )--P9984's format regex: 981(0|1)\d{9}06706 (e.g. 981058515460906706)if not id:match( '^981[0-1]%d%d%d%d%d%d%d%d%d06706$' ) thenreturn falseendreturn '[https://cantic.bnc.cat/registre/'..id..' '..(label or 'Katalonia')..']'..p.getCatForId( 'CANTICN' )endfunction p.ccgLink( id, label )--P3920's format regex: ([NAIP])?[1-9]\d*(\.\d+)? (e.g. A1761)if not id:match( '^[NAIP]?[1-9]%d*$' ) and   not id:match( '^[NAIP]?[1-9]%d*%.%d+$' ) thenreturn falseendreturn id..p.getCatForId( 'CCG' )endfunction p.ciniiLink( id, label )--P271's format regex: DA\d{7}[\dX] (e.g. DA12345678)if not id:match( '^DA%d%d%d%d%d%d%d[%dX]$' ) thenreturn falseendreturn '[https://ci.nii.ac.jp/author/'..id..'?l=en '..(label or 'CiNii (Hapon)')..']'..p.getCatForId( 'CINII' )endfunction p.cwgcLink( id, label )--P1908's format regex: [1-9]\d* (e.g. 75228351)if not id:match( '^[1-9]%d*$' ) thenreturn falseendreturn '[https://www.cwgc.org/find-war-dead/casualty/'..id..'/ '..(label or 'Komision dagiti Tanem ti Gubat ti Mankomunidad')..']'..p.getCatForId( 'CWGC' )endfunction p.emuLink( id, label )--P4613's format regex: \d{1,6} (e.g. 15409 (or 015409))if not id:match( '^%d%d?%d?%d?%d?%d?$' ) thenreturn falseendreturn '[http://esu.com.ua/search_articles.php?id='..id..' '..(label or 'Ukrania')..']'..p.getCatForId( 'EMU' )endfunction p.daaoLink( id, label )--P1707's format regex: [a-z\-]+\d* (e.g. rolf-harris)if not id:match( '^[a-z%-]+%d*$' ) thenreturn falseendreturn '[https://www.daao.org.au/bio/'..id..' '..(label or 'Dagiti Artista ti Australia')..']'..p.getCatForId( 'DAAO' )endfunction p.dblpLink( id, label )--P2456's format regex: \d{2,3} /\d+(-\d+)?|[a-z] /[a-zA-Z][0-9A-Za-z]*(-\d+)? (e.g. 123/123)if not id:match( '^%d%d%d?/%d+$' ) and   not id:match( '^%d%d%d?/%d+%-%d+$' ) and   not id:match( '^[a-z]/[a-zA-Z][0-9A-Za-z]*$' ) and   not id:match( '^[a-z]/[a-zA-Z][0-9A-Za-z]*%-%d+$' ) thenreturn falseendreturn '[https://dblp.org/pid/'..id..' '..(label or 'DBLP (siensia ti kompiuter)')..']'..p.getCatForId( 'DBLP' )endfunction p.dibLink( id, label )--P6829's format regex: a\d{4}\d?(-[A-D])? (e.g. a1953)if not id:match( '^a%d%d%d%d%d?%-?[A-D]?$' ) thenreturn falseendreturn '[https://dib.cambridge.org/viewReadPage.do?articleId='..id..' '..(label or 'Irlanda')..']'..p.getCatForId( 'DIB' )endfunction p.dsiLink( id, label )--P2349's format regex: [1-9]\d* (e.g. 1538)if not id:match( '^[1-9]%d*$' ) thenreturn falseendreturn '[http://www.uni-stuttgart.de/hi/gnt/dsi2/index.php?table_name=dsi&function=details&where_field=id&where_value='..id..' '..(label or 'Dagiti sientipiko nga ilustrador')..']'..p.getCatForId( 'DSI' )endfunction p.dtbioLink( id, label )--P7902's format regex: 1[0-9]{7,8}[0-9X] (e.g. 118554700)if not id:match( '^1[0-9]%d%d%d%d%d%d%d?[0-9X]$' ) thenreturn falseendreturn '[https://www.deutsche-biographie.de/pnd'..id..'.html?language=en '..(label or 'Alemania')..']'..p.getCatForId( 'DTBIO' )endfunction p.fastLink( id, label )--P2163's format regex: [1-9]\d{0,7} (e.g. 1916996)if not id:match( '^[1-9]%d?%d?%d?%d?%d?%d?%d?$' ) thenreturn falseendreturn '[http://id.worldcat.org/fast/'..id..'/ '..(label or 'Faceted Application of Subject Terminology')..']'..p.getCatForId( 'FAST' )endfunction p.fnzaLink( id, label )--P6792's format regex: [1-9]\d* (e.g. 9785)if not id:match( '^[1-9]%d*$' ) thenreturn falseendreturn '[https://findnzartists.org.nz/artist/'..id..'/ '..(label or 'Dagiti Artista ti Baro a Selanda')..']'..p.getCatForId( 'FNZA' )endfunction p.gndLink( id, label )--P227's format regex: 1[012]?\d{7}[0-9X]|[47]\d{6}-\d|[1-9]\d{0,7}-[0-9X]|3\d{7}[0-9X] (e.g. 4079154-3)if not id:match( '^1[012]?%d%d%d%d%d%d%d[0-9X]$' ) and   not id:match( '^[47]%d%d%d%d%d%d%-%d$' ) and   not id:match( '^[1-9]%d?%d?%d?%d?%d?%d?%d?%-[0-9X]$' ) and   not id:match( '^3%d%d%d%d%d%d%d[0-9X]$' ) thenreturn falseendreturn '[https://d-nb.info/gnd/'..id..' '..(label or 'Alemania')..']'..p.getCatForId( 'GND' )endfunction p.googleLink( id, label )--P1960's format regex: [-_0-9A-Za-z]{12} (e.g. CUO0vDcAAAAJ)if not id:match( '^[%-_%d%l%u][%-_%d%l%u][%-_%d%l%u][%-_%d%l%u][%-_%d%l%u][%-_%d%l%u][%-_%d%l%u][%-_%d%l%u][%-_%d%l%u][%-_%d%l%u][%-_%d%l%u][%-_%d%l%u]$' ) thenreturn falseendreturn '[https://scholar.google.com/citations?user='..id..' '..(label or 'Google Scholar')..']'..p.getCatForId( 'Google Scholar' )endfunction p.hdsLink( id, label )--P902's format regex: \d{6} (e.g. 050123)if not id:match( '^%d%d%d%d%d%d$' ) thenreturn falseendreturn '[https://hls-dhs-dss.ch/fr/articles/'..id..' '..(label or 'Naipakasaritaan a Diksionario ti Suisa')..']'..p.getCatForId( 'HDS' )endfunction p.iaafLink( id, label )--P1146's format regex: [0-9][0-9]* (e.g. 012)if not id:match( '^%d+$' ) thenreturn falseendreturn '[https://www.iaaf.org/athletes/_/'..id..' '..(label or 'World Athletics')..']'..p.getCatForId( 'IAAF' )endfunction p.iccuLink( id, label )--P396's format regex: \D{2}[A-Z0-3]V\d{6} (e.g. CFIV000163)if not id:match( '^%u%u[%u0-3]V%d%d%d%d%d%d$' ) then --legacy: %u used here instead of %D (but the faulty ID cat is empty, out of ~12k uses)return falseendreturn '[https://opac.sbn.it/nome/'..id..' '..(label or 'Italia')..']'..p.getCatForId( 'ICCU' )endfunction p.iciaLink( id, label )--P1736's format regex: \d+ (e.g. 1)if not id:match( '^%d+$' ) thenreturn falseendreturn '[https://www.imj.org.il/artcenter/newsite/en/?artist='..id..' '..(label or 'ICIA (Israel)')..']'..p.getCatForId( 'ICIA' )endfunction p.ieuLink( id, label )--P9070's format regex: [A-Z]\\[A-Z]\\[A-Za-z0-9]+ (e.g. K\Y\Kyiv)if not id:match( '^[A-Z]\\[A-Z]\\%w+$' ) thenreturn falseendreturn '[http://www.encyclopediaofukraine.com/display.asp?linkpath=pages\\'..id..' '..(label or 'Ensiklopedia ti Intenet ti Ukrania')..']'..p.getCatForId( 'IEU' )endfunction p.isniLink( id, label )id = p.validateIsni( id ) --e.g. 0000-0000-6653-4145if not id thenreturn falseendreturn '[https://isni.org/isni/'..id..' '..(label or 'ISNI')..']'..p.getCatForId( 'ISNI' )endfunction p.j9uLink( id, label )--P8189's format regex: 9870(0|1)\d{8}05171 (e.g. 987007305652505171)if not id:match( '^9870[0-1]%d%d%d%d%d%d%d%d05171$' ) thenreturn falseendreturn '[http://uli.nli.org.il/F/?func=find-b&local_base=NLX10&find_code=UID&request='..id..' '..(label or 'Israel')..']'..p.getCatForId( 'J9U' )endfunction p.jocondeLink( id, label )--P347's format regex: [\-0-9A-Za-z]{11} (e.g. 12345678901)local regex = '^'..string.rep('[%-0-9A-Za-z]', 11)..'$'if not id:match( regex ) thenreturn falseendreturn '[https://www.pop.culture.gouv.fr/notice/joconde/'..id..' '..(label or 'Joconde (Pransia)')..']'..p.getCatForId( 'Joconde' )endfunction p.kulturnavLink( id, label )--P1248's format regex: [0-9a-f]{8}\-[0-9a-f]{4}\-[0-9a-f]{4}\-[0-9a-f]{4}\-[0-9a-f]{12} (e.g. 12345678-1234-1234-1234-1234567890AB)if not id:match( '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$' ) thenreturn falseendreturn '[http://kulturnav.org/'..id..' '..(label or 'KulturNav (Norwega)')..']'..p.getCatForId( 'KULTURNAV' ) --no https as of 9/2019endfunction p.lccnLink( id, label )local parts = p.splitLccn( id ) --e.g. n78039510if not parts thenreturn falseendlocal lccnType = parts[1] ~= 'sh' and 'names' or 'subjects'id = parts[1] .. parts[2] .. p.append( parts[3], '0', 6 )return '[https://id.loc.gov/authorities/'..lccnType..'/'..id..' '..(label or 'Estados Unidos')..']'..p.getCatForId( 'LCCN' )endfunction p.lirLink( id, label )--P886's format regex: \d+ (e.g. 1)if not id:match( '^%d+$' ) thenreturn falseendreturn '[http://www.e-lir.ch/e-LIR___Lexicon.'..id..'.450.0.html '..(label or 'Lexicon Istoric Retic (Suisa)')..']'..p.getCatForId( 'LIR' ) --no https as of 9/2019endfunction p.lnbLink( id, label )--P1368's format regex: \d{9} (e.g. 123456789)if not id:match( '^%d%d%d%d%d%d%d%d%d$' ) thenreturn falseendreturn '[https://kopkatalogs.lv/F?func=direct&local_base=lnc10&doc_number='..id..'&P_CON_LNG=ENG '..(label or 'Letonia')..']'..p.getCatForId( 'LNB' )endfunction p.mathsnLink( id, label )--P4955's format regex: [1-9]\d{4,6} (e.g. 175270)if not id:match( '^[1-9]%d%d%d%d%d?%d?$' ) thenreturn falseendreturn '[https://mathscinet.ams.org/mathscinet/MRAuthorID/'..id..' '..(label or 'MathSciNet')..']'..p.getCatForId( 'MATHSN' )endfunction p.mbaLink( id, label )--P434's format regex: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (e.g. 12345678-1234-1234-1234-1234567890AB)if not id:match( '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$' ) thenreturn falseendlocal url = 'https://musicbrainz.org/artist/'..idlocal cat = p.getCatForId( 'MusicBrainz' )--special cat nameif label thenreturn '['..url..' '..label..']'..catelsereturn '[[MBA (panangilasin)|MusicBrainz]] ['..url..' (artista)]'..catendendfunction p.mbareaLink( id, label )--P982's format regex: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (e.g. 12345678-1234-1234-1234-1234567890AB)if not id:match( '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$' ) thenreturn falseendlocal url = 'https://musicbrainz.org/area/'..idlocal cat = p.getCatForId( 'ayan ti MusicBrainz' )--special cat nameif label thenreturn '['..url..' '..label..']'..catelsereturn '[[MBAREA (panangilasin)|MusicBrainz]] ['..url..' (ayan)]'..catendendfunction p.mbiLink( id, label )--P1330's format regex: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (e.g. 12345678-1234-1234-1234-1234567890AB)if not id:match( '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$' ) thenreturn falseendlocal url = 'https://musicbrainz.org/instrument/'..idlocal cat = p.getCatForId( 'instrumento ti MusicBrainz' )--special cat nameif label thenreturn '['..url..' '..label..']'..catelsereturn '[[MBI (panangilasin)|MusicBrainz]] ['..url..' (instrumento)]'..catendendfunction p.mblLink( id, label )--P966's format regex: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (e.g. 12345678-1234-1234-1234-1234567890AB)if not id:match( '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$' ) thenreturn falseendlocal url = 'https://musicbrainz.org/label/'..idlocal cat = p.getCatForId( 'etiketa ti MusicBrainz' )--special cat nameif label thenreturn '['..url..' '..label..']'..catelsereturn '[[MBL (panangilasin)|MusicBrainz]] ['..url..' (etiketa)]'..catendendfunction p.mbpLink( id, label )--P1004's format regex: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (e.g. 12345678-1234-1234-1234-1234567890AB)if not id:match( '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$' ) thenreturn falseendlocal url = 'https://musicbrainz.org/place/'..idlocal cat = p.getCatForId( 'lugar ti MusicBrainz' )--special cat nameif label thenreturn '['..url..' '..label..']'..catelsereturn '[[MBP (panangilasin)|MusicBrainz]] ['..url..' (lugar)]'..catendendfunction p.mbrgLink( id, label )--P436's format regex: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (e.g. 12345678-1234-1234-1234-1234567890AB)if not id:match( '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$' ) thenreturn falseendlocal url = 'https://musicbrainz.org/release-group/'..idlocal cat = p.getCatForId( 'grupo ti panagipablaak ti MusicBrainz' )--special cat nameif label thenreturn '['..url..' '..label..']'..catelsereturn '[[MBRG (panangilasin)|MusicBrainz]] ['..url..' (grupo ti panagipablaak)]'..catendendfunction p.mbsLink( id, label )--P1407's format regex: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (e.g. 12345678-1234-1234-1234-1234567890AB)if not id:match( '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$' ) thenreturn falseendlocal url = 'https://musicbrainz.org/series/'..idlocal cat = p.getCatForId( 'serye ti MusicBrainz' )--special cat nameif label thenreturn '['..url..' '..label..']'..catelsereturn '[[MBS (panangilasin)|MusicBrainz]] ['..url..' (serye)]'..catendendfunction p.mbwLink( id, label )--P435's format regex: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (e.g. 12345678-1234-1234-1234-1234567890AB)if not id:match( '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$' ) thenreturn falseendlocal url = 'https://musicbrainz.org/work/'..idlocal cat = p.getCatForId( 'obra ti MusicBrainz' )--special cat nameif label thenreturn '['..url..' '..label..']'..catelsereturn '[[MBW (panangilasin)|MusicBrainz]] ['..url..' (obra)]'..catendendfunction p.mgpLink( id, label )--P549's format regex: \d{1,6} (e.g. 123456)if not id:match( '^%d%d?%d?%d?%d?%d?$' ) thenreturn falseendreturn '[https://genealogy.math.ndsu.nodak.edu/id.php?id='..id..' '..(label or 'Proyekto ti Henelohia ti Matematika')..']'..p.getCatForId( 'MGP' )endfunction p.naraLink( id, label )--P1225's format regex: ^([1-9]\d{0,8})$ (e.g. 123456789)if not id:match( '^[1-9]%d?%d?%d?%d?%d?%d?%d?%d?$' ) thenreturn falseendreturn '[https://catalog.archives.gov/id/'..id..' '..(label or 'Nailian nga Ar-arkibo (EU)')..']'..p.getCatForId( 'NARA' )endfunction p.nclLink( id, label )--P1048's format regex: \d+ (e.g. 1081436)if not id:match( '^%d+$' ) thenreturn falseendreturn '[http://aleweb.ncl.edu.tw/F/?func=accref&acc_sequence='..id..'&CON_LNG=ENG '..(label or 'Taiwan')..']'..p.getCatForId( 'NCL' ) --no https as of 9/2019endfunction p.ndlLink( id, label )--P349's format regex: 0?\d{8} (e.g. 012345678)if not id:match( '^0?%d%d%d%d%d%d%d%d$' ) thenreturn falseendreturn '[https://id.ndl.go.jp/auth/ndlna/'..id..' '..(label or 'Hapon')..']'..p.getCatForId( 'NDL' )endfunction p.ngaLink(id,label)--P3563's format rgex: 11[0-6]-\d+(\.\d+)? (e.g. 114-7721.2)if not id:match('^11[0-6]%-%d+%.?%d*$') thenreturn falseendreturn '[https://wikidata-externalid-url.toolforge.org/?url=https%3A%2F%2Fmsi.nga.mil%2FqueryResults%3Fpublications%2Fngalol%2Flights-buoys%3Fvolume%3D%251%26featureNumber%3D%252%26includeRemovals%3Dfalse%26output%3Dhtml&exp=(%5Cd%7B3%7D)-(.*)&id='..id..' '..(label or 'NGA')..']'..p.getCatForId( 'NGA' )endfunction p.ngvLink( id, label )--P2041's format regex: \d+ (e.g. 12354)if not id:match( '^%d+$' ) thenreturn falseendreturn '[https://www.ngv.vic.gov.au/explore/collection/artist/'..id..'/ '..(label or 'Victoria')..']'..p.getCatForId( 'NGV' )endfunction p.nkcLink( id, label )--P691's format regex: [a-z]{2,4}[0-9]{2,14} (e.g. abcd12345678901234)if not id:match( '^[a-z][a-z][a-z]?[a-z]?%d%d%d?%d?%d?%d?%d?%d?%d?%d?%d?%d?%d?%d?$' ) thenreturn falseendreturn '[https://aleph.nkp.cz/F/?func=find-c&local_base=aut&ccl_term=ica='..id..'&CON_LNG=ENG '..(label or 'Republika a Tseka')..']'..p.getCatForId( 'NKC' )endfunction p.nlaLink( id, label )--P409's format regex: [1-9][0-9]{0,11} (e.g. 123456789012)if not id:match( '^[1-9]%d?%d?%d?%d?%d?%d?%d?%d?%d?%d?%d?$' ) thenreturn falseendreturn '[https://nla.gov.au/anbd.aut-an'..id..' '..(label or 'Australia')..']'..p.getCatForId( 'NLA' )endfunction p.nlgLink( id, label )--P3348's format regex: [1-9]\d* (e.g. 1)if not id:match( '^[1-9]%d*$' ) thenreturn falseendreturn '[https://data.nlg.gr/resource/authority/record'..id..' '..(label or 'Gresia')..']'..p.getCatForId( 'NLG' )endfunction p.nlkLink( id, label )--P5034's format regex: KA.(19|20).{7} (e.g. KAC201501465)if not id:match( '^KA.19.......$' ) and   not id:match( '^KA.20.......$' ) thenreturn falseendreturn '[https://librarian.nl.go.kr/LI/contents/L20101000000.do?id='..id..' '..(label or 'Korea')..']'..p.getCatForId( 'NLK' )endfunction p.nlpLink( id, label )--P1695's format regex: 9810[0-9]\d* or A[0-9]{7}[0-9X] (e.g. 9810123456789012345 or A10414836)if not id:match( '^9810%d+$' ) and   not id:match( '^A%d%d%d%d%d%d%d[%dX]$' ) thenreturn falseendreturn '[https://tools.wmflabs.org/wikidata-externalid-url?p=1695&id='..id..' '..(label or 'Polonia')..']'..p.getCatForId( 'NLP' )endfunction p.nlrLink( id, label )--P1003's format regex: \d{9} (e.g. 123456789)if not id:match( '^%d%d%d%d%d%d%d%d%d$' ) thenreturn falseendreturn '[http://aleph.bibnat.ro:8991/F/?func=direct&local_base=NLR10&doc_number='..id..' '..(label or 'Romania')..']'..p.getCatForId( 'NLR' )endfunction p.nskLink( id, label )--P1375's format regex: \d{9} (e.g. 123456789)if not id:match( '^%d%d%d%d%d%d%d%d%d$' ) thenreturn falseendreturn '[http://katalog.nsk.hr/F/?func=direct&doc_number='..id..'&local_base=nsk10 '..(label or 'Kroasia')..']'..p.getCatForId( 'NSK' ) --no https as of 9/2019endfunction p.ntaLink( id, label )--P1006's format regex: \d{8}[\dX] (e.g. 12345678X)if not id:match( '^%d%d%d%d%d%d%d%d[%dX]$' ) thenreturn falseendreturn '[http://data.bibliotheken.nl/id/thes/p'..id..' '..(label or 'Olanda')..']'..p.getCatForId( 'NTA' )endfunction p.orcidLink( id, label )id = p.validateIsni( id ) --e.g. 0000-0002-7398-5483if not id thenreturn falseendid = id:sub( 1, 4 )..'-'..id:sub( 5, 8 )..'-'..id:sub( 9, 12 )..'-'..id:sub( 13, 16 )return '[https://orcid.org/'..id..' '..(label or 'ORCID')..']'..p.getCatForId( 'ORCID' )endfunction p.picLink( id, label )--P2750's format regex: [1-9]\d* (e.g. 1)if not id:match( '^[1-9]%d*$' ) thenreturn falseendreturn '[https://pic.nypl.org/constituents/'..id..' '..(label or 'Identidad dagiti Potograpo')..']'..p.getCatForId( 'PIC' )endfunction p.plwabnLink( id, label )--P7293's format regex: 981[0-9]{8}05606 (e.g. 9810696457305606)if not id:match( '^981%d%d%d%d%d%d%d%d05606*$' ) thenreturn falseendreturn '[http://mak.bn.org.pl/cgi-bin/KHW/makwww.exe?BM=1&NU=1&IM=4&WI='..id..' '..(label or 'Polonia')..']'..p.getCatForId( 'PLWABN' )endfunction p.publonsLink( id, label )--P3829's format regex: \d+ (e.g. 654601)if not id:match( '^%d+$' ) thenreturn falseendreturn '[https://publons.com/author/'..id..'/ '..(label or 'Publons (dagiti agsuksukisok)')..']'..p.getCatForId( 'Publons' )endfunction p.ridLink( id, label )--P1053's format regex: [A-Z]{1,3}-\d{4}-(19|20)\d\d (e.g. AAS-5150-2020)if not id:match( '^[A-Z][A-Z]?[A-Z]?%-%d%d%d%d%-19%d%d$' ) and   not id:match( '^[A-Z][A-Z]?[A-Z]?%-%d%d%d%d%-20%d%d$' ) thenreturn falseendreturn '[https://www.researcherid.com/rid/'..id..' '..(label or 'ResearcherID')..']'..p.getCatForId( 'RID' )endfunction p.rismLink( id, label )--P5504's format regex: (pe|ks)?\[1-9]d* (e.g. pe30006410)if not id:match( '^pe[1-9]%d*$' ) and --99% start with 'pe'   not id:match( '^ks[1-9]%d*$' ) and   not id:match( '^[1-9]%d*$' ) thenreturn falseendreturn '[https://opac.rism.info/search?id='..id..' '..(label or 'RISM (Pransia)')..']'..p.getCatForId( 'RISM' )endfunction p.reroLink( id, label )--P3065's format regex: 0[1-2]-[A-Z0-9]{1,10} (e.g. 02-A012345678)if not id:match( '^0[1-2]%-[A-Z%d][A-Z%d]?[A-Z%d]?[A-Z%d]?[A-Z%d]?[A-Z%d]?[A-Z%d]?[A-Z%d]?[A-Z%d]?[A-Z%d]?$' ) thenreturn falseendreturn '[http://data.rero.ch/'..id..' '..(label or 'RERO (Suisa)')..']'..p.getCatForId( 'RERO' )endfunction p.rkdartistsLink( id, label )--P650's format regex: [1-9]\d{0,5} (e.g. 123456)if not id:match( '^[1-9]%d?%d?%d?%d?%d?$' ) thenreturn falseendreturn '[https://rkd.nl/en/explore/artists/'..id..' '..(label or 'RKD Artists (Olanda)')..']'..p.getCatForId( 'RKDartists' )endfunction p.rkdidLink( id, label )--P350's format regex: [1-9]\d{0,5} (e.g. 123456)if not id:match( '^[1-9]%d?%d?%d?%d?%d?$' ) thenreturn falseendreturn '[https://rkd.nl/nl/explore/images/'..id..' '..(label or 'RKD ID (Olanda)')..']'..p.getCatForId( 'RKDID' )endfunction p.rslLink( id, label )--P947's format regex: \d{1,9} (e.g. 123456789)if not id:match( '^%d%d?%d?%d?%d?%d?%d?%d?%d?$' ) thenreturn falseendreturn '[http://aleph.rsl.ru/F?func=find-b&find_code=SYS&adjacent=Y&local_base=RSL11&request='..id..'&CON_LNG=ENG '..(label or 'Rusia')..']'..p.getCatForId( 'RSL' ) --no https as of 9/2019endfunction p.scopusLink( id, label )--P1153's format regex: [1-9]\d{9,10} (e.g. 35247902700)if not id:match( '^[1-9]%d%d%d%d%d%d%d%d%d%d?$' ) thenreturn falseendreturn '[https://www.scopus.com/authid/detail.uri?authorId='..id..' '..(label or 'mannurat ti Scopus')..']'..p.getCatForId( 'Scopus' )endfunction p.selibrLink( id, label )--P906's format regex: [1-9]\d{4,5} (e.g. 123456)if not id:match( '^[1-9]%d%d%d%d%d?$' ) thenreturn falseendreturn '[https://libris.kb.se/auth/'..id..' '..(label or 'Suesia')..']'..p.getCatForId( 'SELIBR' )endfunction p.sikartLink( id, label )--P781's format regex: \d{7,9} (e.g. 123456789)if not id:match( '^%d%d%d%d%d%d%d%d?%d?$' ) thenreturn falseendreturn '[http://www.sikart.ch/KuenstlerInnen.aspx?id='..id..'&lng=en '..(label or 'SIKART (Suisa)')..']'..p.getCatForId( 'SIKART' ) --no https as of 9/2019endfunction p.snacLink( id, label )--P3430's format regex: \d*[A-Za-z][0-9A-Za-z]* (e.g. A)if not id:match( '^%d*[A-Za-z][0-9A-Za-z]*$' ) thenreturn falseendreturn '[https://snaccooperative.org/ark:/99166/'..id..' '..(label or 'Social Networks and Archival Context')..']'..p.getCatForId( 'SNAC-ID' )endfunction p.sudocLink( id, label )--P269's format regex: (\d{8}[\dX]|) (e.g. 026927608)if not id:match( '^%d%d%d%d%d%d%d%d[%dxX]$' ) then --legacy: allow lowercase 'x'return falseendreturn '[https://www.idref.fr/'..id..' '..(label or 'SUDOC (Pransia)')..']'..p.getCatForId( 'SUDOC' )endfunction p.ta98Link( id, label )--P1323's format regex: A\d{2}\.\d\.\d{2}\.\d{3}[FM]? (e.g. A12.3.45.678)if not id:match( '^A%d%d%.%d%.%d%d%.%d%d%d[FM]?$' ) thenreturn falseendlocal longurl = '[http://tools.wmflabs.org/wikidata-externalid-url/?p=1323&url_prefix=https:%2F%2Fwww.unifr.ch%2Fifaa%2FPublic%2FEntryPage%2FTA98%20Tree%2FEntity%20TA98%20EN%2F&url_suffix=%20Entity%20TA98%20EN.htm&id='return longurl..id..' '..(label or 'Terminologia Anatomica')..']'..p.getCatForId( 'TA98' )endfunction p.tdviaLink( id, label )--P7314's format regex: [a-z/-]+] (e.g. barkan-omer-lutfi)if not id:match( '^[a-z/-]+$' ) thenreturn falseendreturn '[https://islamansiklopedisi.org.tr/'..id..' '..(label or 'İslâm Ansiklopedisi')..']'..p.getCatForId( 'TDVİA' )endfunction p.tepapaLink( id, label )--P3544's format regex: \d+ (e.g. 1)if not id:match( '^%d+$' ) thenreturn falseendreturn '[https://collections.tepapa.govt.nz/agent/'..id..' '..(label or 'Te Papa (Baro a Selanda)')..']'..p.getCatForId( 'TePapa' )endfunction p.tlsLink( id, label )id = id:gsub(' +', '_')--P1362's format regex: \p{Lu}[\p{L}\d_',\.\-\(\)\*/–]{3,69} (e.g. Abcd)local class = "[%a%d_',%.%-%(%)%*/–]"local idlen = mw.ustring.len (id)if idlen < 4 or idlen > 70 thenreturn falseendlocal regex = '^%u'..string.rep(class, idlen - 1)..'$'if not mw.ustring.match( id, regex ) thenreturn falseendreturn '[http://tls.theaterwissenschaft.ch/wiki/'..id..' '..(label or 'Theaterlexikon (Suisa)')..']'..p.getCatForId( 'TLS' ) --no https as of 9/2019endfunction p.troveLink( id, label )--P1315's format regex: [1-9]\d{5,7} (e.g. 12345678)if not id:match( '^[1-9]%d%d%d%d%d%d?%d?$' ) thenreturn falseendreturn '[https://trove.nla.gov.au/people/'..id..' '..(label or 'Trove (Australia)')..']'..p.getCatForId( 'Trove' )endfunction p.ukparlLink( id, label )--P6213's format regex: [a-zA-Z\d]{8} (e.g. AQUupyiR)if not id:match( '^[a-zA-Z%d][a-zA-Z%d][a-zA-Z%d][a-zA-Z%d][a-zA-Z%d][a-zA-Z%d][a-zA-Z%d][a-zA-Z%d]$' ) thenreturn falseendreturn '[https://id.parliament.uk/'..id..' '..(label or 'Parlamento ti NP')..']'..p.getCatForId( 'UKPARL' )endfunction p.ulanLink( id, label )--P245's format regex: 500\d{6} (e.g. 500123456)if not id:match( '^500%d%d%d%d%d%d$' ) thenreturn falseendreturn '[https://www.getty.edu/vow/ULANFullDisplay?find=&role=&nation=&subjectid='..id..' '..(label or 'Nagnagan ti artista (Getty)')..']'..p.getCatForId( 'ULAN' )endfunction p.uscgLink( id, label )--P3723's format regex: [1-7]-\d{1,5}(.[1-9])? (e.g. 6-0695)if not id:match( '^[1-7]%-%d%d?%d?%d?%d?$' ) and   not id:match( '^[1-7]%-%d%d?%d?%d?%d?%.%d*[1-9]$' ) thenreturn falseendreturn id..p.getCatForId( 'USCG' )endfunction p.uscongressLink( id, label )--P1157's format regex: [A-Z]00[01]\d{3} (e.g. A000123)if not id:match( '^[A-Z]00[01]%d%d%d$' ) thenreturn falseendreturn '[http://bioguide.congress.gov/scripts/biodisplay.pl?index='..id..' '..(label or 'Kongreso ti EU')..']'..p.getCatForId( 'USCongress' ) --no https as of 9/2019endfunction p.vcbaLink( id, label )--P8034's format regex: \d{3}\/[1-9]\d{0,5} (e.g. 494/9793)if not id:match( '^%d%d%d\/[1-9]%d?%d?%d?%d?%d?$' ) thenreturn falseendid = id:gsub('\/', '_')return '[https://opac.vatlib.it/auth/detail/'..id..' '..(label or 'Batikano')..']'..p.getCatForId( 'VcBA' )endfunction p.viafLink( id, label )--P214's format regex: [1-9]\d(\d{0,7}|\d{17,20}) (e.g. 123456789, 1234567890123456789012)if not id:match( '^[1-9]%d%d?%d?%d?%d?%d?%d?%d?$' ) and   not id:match( '^[1-9]%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d?%d?%d?$' ) thenreturn falseend-- If the "VIAF" entry at [[:m:Interwiki map]] would resolve to "https://viaf.org/viaf/$1" (rather than "http://viaf.org/viaf/$1", as it currently still does),-- then the code below could change from '[https://viaf.org/viaf/'..id..' '..id..']' to '[[:VIAF:'..id..'|'..id..']]'.return '[https://viaf.org/viaf/'..id..' '..(label or 'VIAF')..']'..p.getCatForId( 'VIAF' )endfunction p.worldcatidLink( id, label )--P7859's format regex: viaf-\d+|lccn-n[a-z]?[0-9\-]+|n[cps]-.+ (e.g. viaf-100181709, lccn-n78-95332, np-verbeck,%20william$1861)if not id:match( '^viaf%-%d+$' ) and   not id:match( '^lccn%-n[a-z]?[0-9%-]+$' ) and   not id:match( '^n[cps]%-.+$' ) thenreturn falseendreturn '[https://www.worldcat.org/identities/'..mw.uri.encode(id, 'PATH')..'/ '..(label or 'WorldCat')..']'..p.getCatForId( 'WORLDCATID' )endfunction p.zbmathLink( id, label )--P1556's format regex: [a-z][a-z\-]*\.[a-z\-]*(\.[1-5])? (e.g. turing.alan-m)if not id:match( '^[a-z][a-z%-]*%.[a-z%-]*$' ) and   not id:match( '^[a-z][a-z%-]*%.[a-z%-]*%.[0-5]$' ) thenreturn falseendreturn '[https://zbmath.org/authors/?q=ai:'..id..' '..(label or 'zbMATH')..']'..p.getCatForId( 'ZBMATH' )end--[[=========================== Helper functions =============================]]function p.append(str, c, length)while str:len() < length dostr = c..strendreturn strend--Returns the ISNI check digit isni must be a string where the 15 first elements are digits, e.g. 0000000066534145function p.getIsniCheckDigit( isni )local total = 0for i = 1, 15 dolocal digit = isni:byte( i ) - 48 --Get integer valuetotal = (total + digit) * 2endlocal remainder = total % 11local result = (12 - remainder) % 11if result == 10 thenreturn 'X'endreturn tostring( result )end--Validate ISNI (and ORCID) and retuns it as a 16 characters string or returns false if it's invalid--See http://support.orcid.org/knowledgebase/articles/116780-structure-of-the-orcid-identifierfunction p.validateIsni( id )--P213 (ISNI) format regex: [0-9]{4} [0-9]{4} [0-9]{4} [0-9]{3}[0-9X] (e.g. 0000-0000-6653-4145)--P496 (ORCID) format regex: 0000-000(1-[5-9]|2-[0-9]|3-[0-4])\d{3}-\d{3}[\dX] (e.g. 0000-0002-7398-5483)id = id:gsub( '[ %-]', '' ):upper()if not id:match( '^%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d[%dX]$' ) thenreturn falseendif p.getIsniCheckDigit( id ) ~= string.char( id:byte( 16 ) ) thenreturn falseendreturn idendfunction p.splitLccn( id )--P244's format regex: (n|nb|nr|no|ns|sh)([4-9][0-9]|00|20[0-1][0-9])[0-9]{6} (e.g. n78039510)if id:match( '^%l%l?%l?%d%d%d%d%d%d%d%d%d?%d?$' ) thenid = id:gsub( '^(%l+)(%d+)(%d%d%d%d%d%d)$', '%1/%2/%3' )endif id:match( '^%l%l?%l?/%d%d%d?%d?/%d+$' ) thenreturn mw.text.split( id, '/' )endreturn falseend--[[==========================================================================]]--[[                    Wikidata & documentation functions                    ]]--[[==========================================================================]]function p.getIdsFromWikidata( itemId, property )local ids = {}if not mw.wikibase thenreturn idsendlocal statements = mw.wikibase.getBestStatements( itemId, property )if statements thenfor _, statement in ipairs( statements ) doif statement.mainsnak.datavalue thentable.insert( ids, statement.mainsnak.datavalue.value )endendendreturn idsend-- Creates a human-readable standalone wikitable version of p.conf, and tracking categories with page counts, for use in the documentationfunction p.docConfTable( frame )local wikiTable = '{| class="wikitable sortable"\n'..  '! rowspan=2 | Parametro\n'..  '! rowspan=2 | Seksion\n'..  '! rowspan=2 | Agparang a kas\n'..  '! rowspan=2; data-sort-type=number | Tagikua ti Wikidata\n'..  '! colspan=2 | Pagsurotan a katkategoria ken bilang ti panid\n'..  '|-\n'..  '! [[:Kategoria:Dagiti artikulo nga agraman kadagiti pakaammo ti kontrol ti autoridad|'..              'Ar-artikulo]]\n'..  '! [[:Kategoria:Dagiti artikulo nga agraman kadagiti naperdi a panangilasin ti kontrol ti autoridad|'..'Dagiti naperdi nga ID]]\n'..  '|-\n'local lang = mw.getContentLanguage()local a, u, m, f, P = 0, 0, 0, 0, 0 --cumulative sumsfor _, conf in pairs( p.conf ) dolocal param, pid, section = conf[1], conf[2], conf[4]local appearsAsif conf.prefix thenappearsAs = conf.prefixelseappearsAs = conf[3](conf[5])endlocal link = conf.link or param..' (panangilasin)'local category = conf.category or paramlocal args = { id = 'f', pid }local wpl = frame:expandTemplate{ title = 'Silpo ti tagikua ti Wikidata', args = args }--catslocal articleCat = 'Dagiti artikulo nga agraman kadagiti panangilasin ti '..category..' 'local userCat =    'Pampanid ti agar-aramat nga agraman kadagiti panangilasin ti '..category..' 'local miscCat =    'Nadumaduma a pampanid nga agraman kadagiti panangilasin ti '..category..' 'local faultyCat =  'Dagiti artikulo nga agraman kadagiti naperdi a panangilasin ti '..category..' '--countslocal articleCount = lang:formatNum( mw.site.stats.pagesInCategory(articleCat, 'pages') )local userCount =    lang:formatNum( mw.site.stats.pagesInCategory(userCat, 'pages') )local miscCount =    lang:formatNum( mw.site.stats.pagesInCategory(miscCat, 'pages') )local faultyCount =  lang:formatNum( mw.site.stats.pagesInCategory(faultyCat, 'pages') )--calcsP = P + 1 --property counta = a + lang:parseFormattedNumber(articleCount)u = u + lang:parseFormattedNumber(userCount)m = m + lang:parseFormattedNumber(miscCount)f = f + lang:parseFormattedNumber(faultyCount)--concatwikiTable = wikiTable..'\n'..'|-\n'..'||[['..link..'|'..param..']]'..'||'..section..'||'..appearsAs..'||data-sort-value='..pid..'|'..wpl..'||style="text-align: right;"|[[:Kategoria:'..articleCat..'|'..articleCount..']]'..'||style="text-align: right;"|[[:Kategoria:'.. faultyCat..'|'.. faultyCount..']]'end--append derivative WorldCat catslocal wcd = { 'WorldCat-LCCN', 'WorldCat-VIAF' }for _, w in pairs(wcd) dolocal articleCat = 'Dagiti artikulo nga agraman kadagiti panangilasin ti '..w..' 'local articleCount = lang:formatNum( mw.site.stats.pagesInCategory(articleCat, 'pages') )local appearsAsif w == 'WorldCat-LCCN' thenappearsAs = '[https://www.worldcat.org/identities/lccn-n79-113947 WorldCat (babaen ti Biblioteka ti Kongreso)]'elseappearsAs = '[https://www.worldcat.org/identities/containsVIAFID/12345789 WorldCat (babaen ti VIAF)]'enda = a + lang:parseFormattedNumber(articleCount)wikiTable = wikiTable..'\n'..'|-\n'..'||'..'—'..'||Sapasap'..'||'..appearsAs..'||data-sort-value='..w..'|'..'—'..'||style="text-align: right;"|[[:Kategoria:'..articleCat..'|'..articleCount..']]'..'||style="text-align: right;"|—'end--append sumswikiTable = wikiTable..'\n'..'|-\n'..'! style="text-align: right;" colspan=3|Dagiti dagup'..'||style="text-align: right;"|'..lang:formatNum(P)..'||style="text-align: right;"|'..lang:formatNum(a)..'||style="text-align: right;"|'..lang:formatNum(f)return require('Modulo:Lapdan ti katkategoria').main(wikiTable)..'\n|}'end--[[==========================================================================]]--[[                              Configuration                               ]]--[[==========================================================================]]-- Please use "<parameter> (identifier)" redirects rather than linking directly to the target page.-- This reduces clutter in "What links here" on both the redirect and the target,-- and improves reverse lookup of articles where a manifestation of each identifier is used.-- p.conf table basic format: { 'parameter name', propertyId # in Wikidata, formatting/validation function, section, example ID for documentation }-- p.conf table optional named parameters:--  link: to override the link in the documentation (defaults to "<parameter> (identifer)")--  category: to override the ID in category names (defaults to "... with <parameter> identifiers")--  prefix: to include a prefix (usually a wikilink explaining what the identifier is) before the external link itselfp.conf = {{ 'AAG', 3372, p.aagLink, 'Dagiti galeria ken museo ti arte', '1' },{ 'ACM-DL', 864, p.acmLink, 'Dagiti sientipiko a database', '12345678901', link = 'ACM DL (panangilasin)' },{ 'ADB', 1907, p.adbLink,'Dagiti bibliograpiko a diksionario', 'barton-sir-edmund-toby-71' },{ 'admiralty', 3562, p.admiraltyLink, 'Dagiti panangilasin ti silaw-taaw', 'D1204.1', prefix='[[Admiralty number|Admiralty]]'},{ 'AGSA', 6804, p.agsaLink, 'Dagiti galeria ken museo ti arte', '3625' },{ 'ARLHS', 2980, p.ARLHSLink, 'Dagiti panangilasin ti silaw-taaw', 'LAT023'},{ 'autores.uy', 2558, p.autoresuyLink, 'Dagiti bibliograpiko a diksionario', '12345' },{ 'AWR', 4186, p.awrLink, 'Dagiti bibliograpiko a diksionario', 'PR00768b' },{ 'BIBSYS', 1015, p.bibsysLink, 'Dagiti nailian a biblioteka', '1234567890123' },{ 'Bildindex', 2092, p.bildLink, 'Dagiti patakder ti panagsukisok ti arte', '1' },{ 'BNC', 1890, p.bncLink, 'Dagiti nailian a biblioteka', '123456789' },{ 'BNE', 950, p.bneLink, 'Dagiti nailian a biblioteka', 'XX1234567' },{ 'BNF', 268, p.bnfLink, 'Dagiti nailian a biblioteka', '123456789' },{ 'Botaniko', 428, p.botanistLink , 'Dagiti sientipiko a database', 'L.' },{ 'BPN', 651, p.bpnLink , 'Dagiti bibliograpiko a diksionario', '12345678' },{ 'CANTIC', 1273, p.canticLink, 'Dagiti nailian a biblioteka', 'a12345678' },{ 'CANTICN', 9984, p.canticnLink, 'Dagiti nailian a biblioteka', '981058515460906706' },{ 'CCG', 3920, p.ccgLink, 'Dagiti panangilasin ti silaw-taaw', 'A1761', prefix='[[CCG (panangilasin)|CCG]]' },{ 'CINII', 271, p.ciniiLink, 'Dagiti sientipiko a database', 'DA12345678', link = 'CiNii (panangilasin)' },{ 'CWGC', 1908, p.cwgcLink, 'Dadduma', '1234567' },{ 'DAAO', 1707, p.daaoLink, 'Dagiti patakder ti panagsukisok ti arte', 'rolf-harris' },{ 'DBLP', 2456, p.dblpLink, 'Dagiti sientipiko a database', '123/123' },{ 'DIB',  6829, p.dibLink, 'Dagiti bibliograpiko a diksionario', 'a1234' },{ 'DSI', 2349, p.dsiLink, 'Dagiti patakder ti panagsukisok ti arte', '1538' },{ 'DTBIO', 7902, p.dtbioLink, 'Dagiti bibliograpiko a diksionario', '118554700' },{ 'EMU', 4613, p.emuLink, 'Dagiti nailian a biblioteka', '15409' },{ 'FAST', 2163, p.fastLink, 'Dadduma', '1' },{ 'FNZA', 6792, p.fnzaLink, 'Dagiti patakder ti panagsukisok ti arte', '12' },{ 'GND', 227, p.gndLink, 'Dagiti nailian a biblioteka', '4079154-3' },{ 'Google Scholar', 1960, p.googleLink, 'Dagiti sientipiko a database', 'QPdLuj8AAAAJ' },{ 'HDS', 902, p.hdsLink, 'Dadduma', '050123' },{ 'IAAF', 1146, p.iaafLink, 'Dadduma', '123' },{ 'ICCU', 396, p.iccuLink, 'Dagiti nailian a biblioteka', 'CFIV000163' }, --formerly SBN{ 'ICIA', 1736, p.iciaLink, 'Dagiti patakder ti panagsukisok ti arte', '1' },{ 'IEU', 9070, p.ieuLink, 'Dadduma', 'N\\A\\NationalAcademyofArtandArchitecture' },{ 'ISNI', 213, p.isniLink, 'Sapasap', '0000-0000-6653-4145', prefix = '[[ISNI (panangilasin)|ISNI]]' },{ 'J9U', 8189, p.j9uLink, 'Dagiti nailian a biblioteka', '987007305652505171' },{ 'Joconde', 347, p.jocondeLink, 'Dagiti patakder ti panagsukisok ti arte', '12345678901' },{ 'KULTURNAV', 1248, p.kulturnavLink, 'Dagiti patakder ti panagsukisok ti arte', '12345678-1234-1234-1234-1234567890AB', link = 'KulturNav (panangilasin)' },{ 'LCCN', 244, p.lccnLink, 'Dagiti nailian a biblioteka', 'n78039510' },{ 'LIR', 886, p.lirLink, 'Dadduma', '1' },{ 'LNB', 1368, p.lnbLink, 'Dagiti nailian a biblioteka', '123456789' },{ 'MATHSN', 4955, p.mathsnLink, 'Dagiti sientipiko a database', '175270' },{ 'MBA', 434, p.mbaLink, 'Dadduma', '12345678-1234-1234-1234-1234567890AB', category = 'MusicBrainz' }, --special cat name{ 'MBAREA', 982, p.mbareaLink, 'Dadduma', '12345678-1234-1234-1234-1234567890AB', category = 'ayan ti MusicBrainz' }, --special cat name{ 'MBI', 1330, p.mbiLink, 'Dadduma', '12345678-1234-1234-1234-1234567890AB', category = 'instrumento ti MusicBrainz' }, --special cat name{ 'MBL', 966, p.mblLink, 'Dadduma', '12345678-1234-1234-1234-1234567890AB', category = 'etiketa ti MusicBrainz' }, --special cat name{ 'MBP', 1004, p.mbpLink, 'Dadduma', '12345678-1234-1234-1234-1234567890AB', category = 'lugar ti MusicBrainz' }, --special cat name{ 'MBRG', 436, p.mbrgLink, 'Dadduma', '12345678-1234-1234-1234-1234567890AB', category = 'grupo ti panagipablaak ti MusicBrainz' }, --special cat name{ 'MBS', 1407, p.mbsLink, 'Dadduma', '12345678-1234-1234-1234-1234567890AB', category = 'serye ti MusicBrainz' }, --special cat name{ 'MBW',  435, p.mbwLink, 'Dadduma', '12345678-1234-1234-1234-1234567890AB', category = 'obra ti MusicBrainz' }, --special cat name{ 'MGP', 549, p.mgpLink, 'Dagiti sientipiko a database', '123456' },{ 'NARA', 1225, p.naraLink, 'Dadduma', '12345678' },{ 'NCL', 1048, p.nclLink, 'Dagiti nailian a biblioteka', '1081436' },{ 'NDL', 349, p.ndlLink, 'Dagiti nailian a biblioteka', '012345678' },{ 'NGA', 3563, p.ngaLink, 'Dagiti panangilasin ti silaw-taaw', '114-5592'},{ 'NGV', 2041, p.ngvLink, 'Dagiti galeria ken museo ti arte', '12354' },{ 'NKC', 691, p.nkcLink, 'Dagiti nailian a biblioteka', 'abcd12345678901234' },{ 'NLA', 409, p.nlaLink, 'Dagiti nailian a biblioteka', '123456789012' },{ 'NLG', 3348, p.nlgLink, 'Dagiti nailian a biblioteka', '12345678' },{ 'NLK', 5034, p.nlkLink, 'Dagiti nailian a biblioteka', 'KAB197000000' },{ 'NLP', 1695, p.nlpLink, 'Dagiti nailian a biblioteka', '9810123456789012345' },{ 'NLR', 1003, p.nlrLink, 'Dagiti nailian a biblioteka', '123456789' },{ 'NSK', 1375, p.nskLink, 'Dagiti nailian a biblioteka', '123456789' },{ 'NTA', 1006, p.ntaLink, 'Dagiti nailian a biblioteka', '12345678X' },{ 'ORCID', 496, p.orcidLink, 'Sapasap', '0000-0002-7398-5483', prefix = '[[ORCID (panangilasin)|ORCID]]' },{ 'PIC', 2750, p.picLink, 'Dagiti patakder ti panagsukisok ti arte', '1' },{ 'PLWABN',  7293, p.plwabnLink, 'Dagiti nailian a biblioteka', '9812345678905606' },{ 'Publons', 3829, p.publonsLink, 'Dagiti sientipiko a database', '2776255' },{ 'RID', 1053, p.ridLink, 'Dagiti sientipiko a database', 'A-1234-1934' },{ 'RISM', 5504, p.rismLink, 'Dadduma', 'pe1',  prefix = '[[RISM (panangilasin)|RISM (Pransia)]]' },{ 'RERO', 3065, p.reroLink, 'Dadduma', '02-A012345678', prefix = '[[RERO (panangilasin)|RERO (Suisa)]]' },{ 'RKDartists', 650, p.rkdartistsLink, 'Dagiti patakder ti panagsukisok ti arte', '123456' },{ 'RKDID', 350, p.rkdidLink, 'Dagiti patakder ti panagsukisok ti arte', '123456' },{ 'RSL', 947, p.rslLink, 'Dagiti nailian a biblioteka', '123456789' },{ 'Scopus', 1153, p.scopusLink, 'Dagiti sientipiko a database', '7005487412' },{ 'SELIBR', 906, p.selibrLink, 'Dagiti nailian a biblioteka', '123456' },{ 'SIKART', 781, p.sikartLink, 'Dagiti patakder ti panagsukisok ti arte', '123456789' },{ 'SNAC-ID', 3430, p.snacLink, 'Dadduma', 'A' },{ 'SUDOC', 269, p.sudocLink, 'Dadduma', '026927608', prefix = '[[SUDOC (panangilasin)|SUDOC (Pransia)]]' },{ 'TA98', 1323, p.ta98Link, 'Dagiti sientipiko a database', 'A12.3.45.678' },{ 'TDVİA', 7314, p.tdviaLink, 'Dadduma', 'asim-b-behdele' },{ 'TePapa', 3544, p.tepapaLink, 'Dagiti galeria ken museo ti arte', '1' },{ 'TLS',  1362, p.tlsLink, 'Dadduma', 'Abcd' },{ 'Trove', 1315, p.troveLink, 'Dadduma', '12345678', prefix = '[[Trove (panangilasin)|Trove (Australia)]]' }, --formerly NLA-person{ 'UKPARL', 6213, p.ukparlLink, 'Dadduma', 'AQUupyiR' },{ 'ULAN', 245, p.ulanLink, 'Dagiti patakder ti panagsukisok ti arte', '500123456' },{ 'USCG', 3723, p.uscgLink, 'Dagiti panangilasin ti silaw-taaw', '6-0695', prefix='[[USCG (panangilasin)|USCG]]'},{ 'USCongress', 1157, p.uscongressLink, 'Dadduma', 'A000123', link = 'US Congress (panangilasin)' },{ 'VcBA', 8034, p.vcbaLink, 'Dagiti nailian a biblioteka', '494/9793' },{ 'VIAF', 214, p.viafLink, 'Sapasap', '123456789', prefix = '[[VIAF (panangilasin)|VIAF]]' },{ 'WORLDCATID', 7859, p.worldcatidLink, 'Sapasap', 'lccn-n78-95332', link = 'WorldCat Identities (panangilasin)' },{ 'ZBMATH', 1556, p.zbmathLink, 'Dagiti sientipiko a database', 'turing.alan-m' },}-- Legitimate aliases to p.conf, for convenience-- Format: { 'alias', 'parameter name in p.conf' }p.aliases = {{ 'DNB', 'GND' }, --Deutsche Nationalbibliothek -> Gemeinsame Normdatei{ 'MusicBrainz', 'MBA' },{ 'MusicBrainz artist', 'MBA' },{ 'MusicBrainz label', 'MBL' },{ 'MusicBrainz release group', 'MBRG' },{ 'MusicBrainz work', 'MBW' },{ 'SBN', 'ICCU' }, --SBN alias to be deprecated at a later stage{ 'TDVIA', 'TDVİA' }, --alias name without diacritics{ 'tdvia', 'TDVİA' }, --lowercase variant without diacritics}-- Deprecated aliases to p.conf; tracked in [[Category:Articles with deprecated authority control identifiers]]-- Format: { 'deprecated parameter name', 'replacement parameter name in p.conf' }p.deprecated = {{ 'GKD', 'GND' },{ 'PND', 'GND' },{ 'RLS', 'RSL' },{ 'SWD', 'GND' },{ 'NARA-organization', 'NARA' },{ 'NARA-person', 'NARA' },}--[[==========================================================================]]--[[                                   Main                                   ]]--[[==========================================================================]]function p.authorityControl( frame )local resolveEntity = require( 'Modulo:ResolveEntityId' )local parentArgs = frame:getParent().args --WD IDs added here laterlocal iParentArgs = 0 --count original/manual parent args only laterlocal worldcatCat = ''local elementsCat = ''local multipleIdCat = ''local suppressedIdCat = ''local suppressedIdCatArts = ''local deprecatedIdCat = ''local differentOnWDCat = ''local sameOnWDCat = ''local stateCat = ''--redirect aliases to proper parameter namesfor _, a in pairs( p.aliases ) dolocal alias, param = a[1], a[2]if (parentArgs[param] == nil or parentArgs[param] == '') and parentArgs[alias] thenparentArgs[param] = parentArgs[alias]endend--redirect deprecated parameters to proper parameter names, and assign tracking catfor _, d in pairs( p.deprecated ) dolocal dep, param = d[1], d[2]if (parentArgs[param] == nil or parentArgs[param] == '') and parentArgs[dep] thenparentArgs[param] = parentArgs[dep]if namespace == 0 thendeprecatedIdCat = '[[Kategoria:Dagiti artikulo nga agraman kadagiti nasukatanen a panangilasin ti kontrol ti autoridad|'..dep..']]'endendend--use QID= parameter for testing/example purposes onlylocal itemId = nilif namespace ~= 0 thenlocal qid = parentArgs['qid'] or parentArgs['QID']if qid thenitemId = 'Q'..mw.ustring.gsub(qid, '^[Qq]', '')itemId = resolveEntity._id(itemId) --nil if unresolvableendelseif mw.wikibase thenitemId = mw.wikibase.getEntityIdForCurrentPage()end--Wikidata fallback if availableif itemId thenlocal suppressedIdCount = 0local iMatches = 0for _, params in ipairs( p.conf ) doif params[2] > 0 thenlocal val = parentArgs[mw.ustring.lower(params[1])] or parentArgs[params[1]]if val == nil or val == '' thenlocal wikidataIds = p.getIdsFromWikidata( itemId, 'P'..params[2] )if wikidataIds[1] thenif val == '' and (namespace == 0 or testcases) thensuppressedIdCount = suppressedIdCount + 1suppressedIdCat = '[[Kategoria:Dagiti artikulo nga agraman kadagiti napasardeng a panangilasin ti kontrol ti autoridad|'..params[1]..']]'elseparentArgs[params[1]] = wikidataIds[1] --add ID from WDendendelseiParentArgs = iParentArgs + 1local wikidataIds = p.getIdsFromWikidata( itemId, 'P'..params[2] )if wikidataIds[1] and differentOnWDCat == '' thenlocal bMatch = falsefor _, wd in pairs( wikidataIds ) doif val == wd theniMatches = iMatches + 1bMatch = trueendendif bMatch == false thendifferentOnWDCat = '[[Kategoria:Pampanid nga agus-usar iti kontrol ti autoridad nga agraman kadagiti parametro a sabali iti Wikidata|'..params[1]..']]'endendendendendif iMatches > 0 and iMatches == iParentArgs thensameOnWDCat = '[[Kategoria:Pampanid nga agus-usar iti kontrol ti autoridad nga agraman kadagiti parametro a maipada amin iti Wikidata]]'endif parentArgs['arts'] == 'arts' and suppressedIdCount > 0 thenif namespace == 0 or testcases thenlocal s = 'kadag'if suppressedIdCount == 1 then s = '' endlocal sCat = 'ACArt nga agraman' ..s'iti '..suppressedIdCount..' a napasardeng nga elemento'suppressedIdCatArts = addCat(sCat)endendend--configure rowslocal rct = 0local sectionOrder = {'Sapasap','Dagiti nailian a biblioteka','Dagiti galeria ken museo ti arte','Dagiti patakder ti panagsukisok ti arte','Dagiti bibliograpiko a diksionario','Dagiti sientipiko a database','Dagiti panangilasin ti silaw-taaw','Dadduma'}local sections = {['Sapasap'] = {},['Dagiti nailian a biblioteka'] = {},['Dagiti galeria ken museo ti arte'] = {},['Dagiti patakder ti panagsukisok ti arte'] = {},['Dagiti bibliograpiko a diksionario'] = {},['Dagiti sientipiko a database'] = {},['Dagiti panangilasin ti silaw-taaw'] = {},['Dadduma'] = {}}--don't show CANTIC if CANTICN is present, since they both go to the Library of Catalonia--and the library has deprecated CANTIC IDs in favor of CANTICN IDsif parentArgs.CANTICN or parentArgs.canticn thenparentArgs.CANTIC = ''parentArgs.cantic = ''end--don't show NLP if PLWABN is present, since they both go to the National Library of Poland--and the library has deprecated NLP IDs in favor of PLWABN IDsif parentArgs.PLWABN or parentArgs.plwabn thenparentArgs.NLP = ''parentArgs.nlp = ''endfor _, params in ipairs( p.conf ) dolocal val = parentArgs[mw.ustring.lower(params[1])] or parentArgs[params[1]]local tval, tlinks = {}, {} --init tablesif val and val ~= '' and type(params[3]) == 'function' thentable.insert( tval, val )if params.prefix thentable.insert( tlinks, params[3]( val, '1' ) )elsetable.insert( tlinks, params[3]( val ) )endend--collect other unique vals (IDs) from WD, if presentif itemId and tval[1] thenlocal nextIdVal = 2local wikidataIds = p.getIdsFromWikidata( itemId, 'P'..params[2] )for _, v in pairs( wikidataIds ) dolocal bnew = truefor _, w in pairs( tval ) doif v == w then bnew = false endendif bnew thentable.insert( tval, v )table.insert( tlinks, params[3]( v, tostring(nextIdVal) ) )nextIdVal = nextIdVal + 1endendend--assembleif tval[1] thentable.insert( sections[params[4]], p.createRow( params[1], tval, nil, tlinks, true, params.category, params.prefix) )rct = rct + 1if tval[2] thenmultipleIdCat = p.getCatForId( 'agduduma' )endendend--WorldCat-VIAF & WorldCat-LCCNlocal worldcatId = parentArgs['worldcatid'] or parentArgs['WORLDCATID']if worldcatId == nil then --if WORLDCATID absent but unsuppressedlocal viafId = parentArgs['viaf'] or parentArgs['VIAF']local lccnId = parentArgs['lccn'] or parentArgs['LCCN']if viafId and viafId ~= '' and p.viafLink( viafId ) then --VIAF must be present, unsuppressed, & validatedtable.insert( sections['Sapasap'], p.createRow( 'VIAF', viafId, '[https://www.worldcat.org/identities/containsVIAFID/'..viafId..' WorldCat (babaen ti VIAF)]', nil, false ) )if namespace == 0 thenworldcatCat = '[[Kategoria:Dagiti artikulo nga agraman kadagiti panangilasin ti WorldCat-VIAF]]'endrct = rct + 1elseif lccnId and lccnId ~= '' and p.lccnLink( lccnId ) then --LCCN must be present, unsuppressed, & validatedlocal lccnParts = p.splitLccn( lccnId )if lccnParts and lccnParts[1] ~= 'sh' thenlocal lccnIdFmtd = lccnParts[1]..lccnParts[2]..'-'..lccnParts[3]table.insert( sections['Sapasap'], p.createRow( 'LCCN', lccnId, '[https://www.worldcat.org/identities/lccn-'..lccnIdFmtd..' WorldCat (babaen ti Biblioteka ti Kongreso)]', nil, false ) )if namespace == 0 thenworldcatCat = '[[Kategoria:Dagiti artikulo nga agraman kadagiti panangilasin ti WorldCat-LCCN]]'endendrct = rct + 1endend--configure Navboxlocal outString = ''local extrap = truelocal extra = parentArgs.extralistif extra == nil or extra == '' thenextrap = falseendif rct > 0 or extrap thenlocal Navbox = require('Modulo:Navbox')local sectionID = 1local args = { pid = 'identifiers' } -- #target the list of identifiersif testcases and itemId then args.qid = itemId end --expensivelocal pencil = require('Modulo:EditAtWikidata')._showMessage(args)local navboxArgs = {name  = 'Kontrol ti autoridad',navboxclass = 'authority-control',bodyclass = 'hlist',state = parentArgs.state or 'autocollapse',navbar = 'off'}for _, sectName in ipairs(sectionOrder) doif #sections[sectName] ~= 0 thennavboxArgs['group'..sectionID] = sectNamenavboxArgs['list'..sectionID] = table.concat(sections[sectName])sectionID = sectionID + 1endendif extrap thenif parentArgs.extragroup thennavboxArgs['group'..sectionID] = parentArgs.extragroupelsenavboxArgs['group'..sectionID] = 'Maipatinayon'endnavboxArgs['list'..sectionID] = extrasectionID = sectionID + 1endif navboxArgs.list2 thennavboxArgs.title = '[[Tulong:Kontrol ti autoridad|Kontrol ti autoridad]]'..pencilelselocal sect = navboxArgs.group1if sect == 'Sapasap' or sect == 'Dadduma' or sect == 'Maipatinayon' then-- Just say "Authority control" with no label if only general or only other IDs are present-- since "general" is redundant and "other" is silly when there's nothing to contrast it withnavboxArgs.group1 = '[[Tulong:Kontrol ti autoridad|Kontrol ti autoridad]]'..pencilelsenavboxArgs.group1 = '[[Tulong:Kontrol ti autoridad|Kontrol ti autoridad: '..sect..']] '..pencilendendoutString = Navbox._navbox(navboxArgs)end--auxCatsif rct == 0 or rct >= 25 thenif namespace == 0 or testcases thenlocal eCat = 'Kontrol ti autoridad nga agraman kadagiti ' .. rct .. ' nga elemento'elementsCat = addCat(eCat)endendif parentArgs.state thenif namespace == 0 or testcases thenlocal sCatif parentArgs.state == 'collapsed' then sCat = 'Kontrol ti autoridad nga agus-usar iti parametro ti state: collapsed'elseif parentArgs.state == 'expanded' then sCat = 'Kontrol ti autoridad nga agus-usar iti parametro ti state: expanded'elseif parentArgs.state == 'autocollapse' then sCat = 'Kontrol ti autoridad nga agus-usar iti parametro ti state: autocollapse'else sCat = 'Kontrol ti autoridad nga agus-usar iti parametro ti state: other'endstateCat = addCat(sCat)endendlocal auxCats = worldcatCat..elementsCat..multipleIdCat..suppressedIdCat..suppressedIdCatArts..deprecatedIdCat..differentOnWDCat..sameOnWDCat..stateCatif testcases thenauxCats = mw.ustring.gsub(auxCats, '(%[%[)(Kategoria)', '%1:%2') --for easier checkingend--outoutString = outString..auxCatsif namespace ~= 0 thenoutString = mw.ustring.gsub(outString, '(%[%[)(Kategoria:Dagiti artikulo)', '%1:%2') --by definitionendreturn outStringendreturn p