Open main menu

Changes

Module:Authority control

89 bytes added, 11:15, 10 October 2018
Allow WORLDCATID suppression, per talk, and minor changes, from sandbox
if statement.mainsnak.datavalue.value['numeric-id'] == qid then
return true
end end end end end
return false
end
for _, conf in pairs( p.conf ) do
local param, link, pid = conf[1], conf[2], conf[3]
if param == 'MBA' then param = 'MusicBrainz' end --it's weird; 'MusicBrainz' for cats only
local args = { id = 'f', pid }
local wpl = frame:expandTemplate{ title = 'Wikidata property link', args = args }
--cats
if param == 'MBA' then param = 'MusicBrainz' end --it's weird; 'MusicBrainz' for cat name only
local articleCat = 'Wikipedia articles with '..param..' identifiers'
local userCat = 'User pages with '..param..' identifiers'
local miscCat = 'Miscellaneous pages with '..param..' identifiers'
local faultyCat = 'Wikipedia articles with faulty authority control identifiers ('..param..')'
if param == 'MusicBrainz' then param = 'MBA' end --it's weird; 'MBA' otherwise
--counts
local 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') )
if param == 'MusicBrainz' then param = 'MBA' end --it's weird; 'MBA' for param name onlyconcat
wikiTable = wikiTable..'\n'..
'|-\n'..
if parentArgs['WORLDCATID'] and parentArgs['WORLDCATID'] ~= '' then
table.insert( elements, p.createRow( 'WORLDCATID', '', parentArgs['WORLDCATID'], '[https://www.worldcat.org/identities/' .. parentArgs['WORLDCATID'] .. ' WorldCat Identities]', false ) ) --Validation?
elseif parentArgs['WORLDCATID'] == nil then --must be unsuppressed if parentArgs['VIAF'] and string.match( parentArgs['VIAF'], '^%d+$' ) then -- Hackishly copy the validation code; this should go away when we move to using P1793 and P1630 table.insert( elements, p.createRow( 'VIAF', '', parentArgs['VIAF'], '[https://www.worldcat.org/identities/containsVIAFID/' .. parentArgs['VIAF'] .. ' WorldCat Identities]', false ) ) elseif parentArgs['LCCN'] and parentArgs['LCCN'] ~= '' then local lccnParts = p.splitLccn( parentArgs['LCCN'] ) if lccnParts and lccnParts[1] ~= 'sh' then table.insert( elements, p.createRow( 'LCCN', '', parentArgs['LCCN'], '[https://www.worldcat.org/identities/lccn-' .. lccnParts[1] .. lccnParts[2] .. '-' .. lccnParts[3] .. ' WorldCat Identities]', false ) ) end
end
end
--Configured rows
local rct = 0
Anonymous user