Open main menu

Changes

Module:Authority control

206 bytes added, 13:39, 16 October 2018
Update VIAF & LCCN validation for WORLDCATID; add to [[Category:Wikipedia articles with suppressed authority control identifiers{{!}}WORLDCATID]] if suppressed; WikiLink WorldCat; from sandbox
--Worldcat
if parentArgs['WORLDCATID'] and parentArgs['WORLDCATID'] ~= '' then
table.insert( elements, p.createRow( 'WORLDCATID', '', parentArgs['WORLDCATID'], '[[WorldCat]] [https://www.worldcat.org/identities/' .. parentArgs['WORLDCATID'] .. ' WorldCat Identities]', false ) ) --Validation?
elseif parentArgs['WORLDCATID'] == nil then --must be unsuppressed
if parentArgs['VIAF'] and stringparentArgs['VIAF'] ~= '' and p.matchviafLink( parentArgs['VIAF'], '^%d+$' ) then -- Hackishly copy the validation code; this should go away when we move to using P1793 and P1630VIAF must be unsuppressed & validated table.insert( elements, p.createRow( 'VIAF', '', parentArgs['VIAF'], '[[WorldCat]] [https://www.worldcat.org/identities/containsVIAFID/' .. parentArgs['VIAF'] .. ' WorldCat Identities]', false ) ) elseif parentArgs['LCCN'] and parentArgs['LCCN'] ~= '' and p.lccnLink( parentArgs['LCCN'] ) then--LCCN must be unsuppressed & validated
local lccnParts = p.splitLccn( parentArgs['LCCN'] )
if lccnParts and lccnParts[1] ~= 'sh' then
table.insert( elements, p.createRow( 'LCCN', '', parentArgs['LCCN'], '[[WorldCat]] [https://www.worldcat.org/identities/lccn-' .. lccnParts[1] .. lccnParts[2] .. '-' .. lccnParts[3] .. ' WorldCat Identities]', false ) )
end
end
elseif parentArgs['WORLDCATID'] == '' then
suppressedIdCat = '[[Category:Wikipedia articles with suppressed authority control identifiers|WORLDCATID]]'
end
Anonymous user