Changes
Implement all missing ID-tracking cats; expand function p.docConfTable to produce links & counts to all ID-tracking cats, per talk request; catch all red cats in Category:Pages with red-linked authority control categories; from sandbox
local title = mw.title.getCurrentTitle()
local namespace = title.namespace
local cat = ''
local redcat = ''
if namespace == 0 then
elseif namespace == 2 and not title.isSubpage then
else
end
if mw.title.new(cat, 14).exists == false then
redcat = '[[Category:Pages with red-linked authority control categories]]'
end
cat = '[[Category:' .. cat .. ']]'
return cat .. redcat
end
return false
end
return '[https://www.iaaf.org/athletes/biographies/athcode=' .. id .. ' ' .. id .. ']'.. p.getCatForId( 'IAAF' )
end
function p.kulturnavLink( id )
return '[http://kulturnav.org/' .. id .. ' ' .. id .. ']'.. p.getCatForId( 'KULTURNAV' )
end
function p.sikartLink( id )
return '[http://www.sikart.ch/KuenstlerInnen.aspx?id=' .. id .. '&lng=en ' .. id .. ']'.. p.getCatForId( 'SIKART' )
end
function p.tlsLink( id )
local id2 = id:gsub(' +', '_')
return '[http://tls.theaterwissenschaft.ch/wiki/' .. id2 .. ' ' .. id .. ']'.. p.getCatForId( 'TLS' )
end
function p.ciniiLink( id )
return '[https://ci.nii.ac.jp/author/' .. id .. '?l=en ' .. id .. ']'.. p.getCatForId( 'CINII' )
end
function p.bneLink( id )
return '[http://catalogo.bne.es/uhtbin/authoritybrowse.cgi?action=display&authority_id=' .. id .. ' ' .. id .. ']'.. p.getCatForId( 'BNE' )
end
function p.uscongressLink( id )
return '[http://bioguide.congress.gov/scripts/biodisplay.pl?index=' .. id .. ' ' .. id .. ']'.. p.getCatForId( 'USCongress' )
end
function p.narapersonLink( id )
return '[https://research.archives.gov/person/' .. id .. ' ' .. id .. ']'.. p.getCatForId( 'NARA-person' )
end
function p.naraorganizationLink( id )
return '[https://research.archives.gov/organization/' .. id .. ' ' .. id .. ']'.. p.getCatForId( 'NARA-organization' )
end
function p.naraLink( id )
return '[https://catalog.archives.gov/id/' .. id .. ' ' .. id .. ']'.. p.getCatForId( 'NARA' )
end
function p.botanistLink( id )
local id2 = id:gsub(' +', '%%20')
return '[http://www.ipni.org/ipni/advAuthorSearch.do?find_abbreviation=' .. id2 .. ' ' .. id .. ']'.. p.getCatForId( 'Botanist' )
end
function p.mgpLink( id )
-- TODO Implement some sanity checking regex
return '[http://www.genealogy.ams.org/id.php?id=' .. id .. ' ' .. id .. ']'.. p.getCatForId( 'MGP' )
end
function p.rslLink( id )
-- TODO Implement some sanity checking regex
return '[http://aleph.rsl.ru/F?func=find-b&find_code=SYS&adjacent=Y&local_base=RSL11&request=' .. id .. '&CON_LNG=ENG ' .. id .. ']'.. p.getCatForId( 'RLS' ) --RLS == known typo
end
return false
end
return '[http://www.culture.gouv.fr/public/mistral/leonore_fr?ACTION=CHERCHER&FIELD_1=COTE&VALUE_1=' .. id .. ' ' .. id .. ']'.. p.getCatForId( 'Léonore' )
end
function p.nkcLink( id )
return '[https://aleph.nkp.cz/F/?func=find-c&local_base=aut&ccl_term=ica=' .. id .. '&CON_LNG=ENG ' .. id .. ']'.. p.getCatForId( 'NKC' )
end
return false
end
return '[http://aleweb.ncl.edu.tw/F/?func=accref&acc_sequence=' .. id .. '&CON_LNG=ENG ' .. id .. ']'.. p.getCatForId( 'NCL' )
end
function p.ndlLink( id )
return '[https://id.ndl.go.jp/auth/ndlna/' .. id .. ' ' .. id .. ']'.. p.getCatForId( 'NDL' )
end
return false
end
return '[https://www.idref.fr/' .. id .. ' ' .. id .. ']'.. p.getCatForId( 'SUDOC' )
end
function p.hlsLinkhdsLink( id )
if not string.match( id, '^%d+$' ) then
return false
end
return '[http://www.hls-dhs-dss.ch/textes/f/F' .. id .. '.php ' .. id .. ']'.. p.getCatForId( 'HDS' )
end
return false
end
return '[http://www.e-lir.ch/e-LIR___Lexicon.' .. id .. '.450.0.html ' .. id .. ']'.. p.getCatForId( 'LIR' )
end
return false
end
return '[https://www.bildindex.de/document/obj' .. id .. ' ' .. id .. ']' -- .. p.getCatForId( 'Bildindex' )
end
function p.jocondeLink( id )
return '[http://www2.culture.gouv.fr/public/mistral/joconde_fr?ACTION=CHERCHER&FIELD_1=REF&VALUE_1=' .. id .. ' ' .. id .. ']' -- .. p.getCatForId( 'Joconde' )
end
return false
end
return '[https://rkd.nl/nl/explore/images/' .. id .. ' ' .. id .. ']' -- .. p.getCatForId( 'RKDimages' )
end
return false
end
return '[http://balat.kikirpa.be/object/104257' .. id .. ' ' .. id .. ']' -- .. p.getCatForId( 'BALaT' )
end
end
-- Creates a human-readable standalone wikitable version of p.conf, and tracking categories with page counts, for use in the documentation
function p.docConfTable( frame )
local wikiTable = '{| class="wikitable sortable"\n' ..
for _, conf in pairs( p.conf ) do
local param , link, pid = conf[1] local link = , conf[2] local pid = , conf[3] if param == 'MBA' then param = 'MusicBrainz' end --it's weird
local args = { id = 'f', pid }
local wpl = frame:expandTemplate{ title = 'Wikidata property link', args = args }
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..')' local lang = mw.getContentLanguage() 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') ) wikiTable = wikiTable .. '\n' .. '|-\n' .. '||' .. param .. '||' .. link .. '||data-sort-value=' .. pid .. '|' .. wpl.. '||style="text-align: right;"|[[:Category:'..articleCat..'|'..articleCount..']]'.. '||style="text-align: right;"|[[:Category:'.. userCat..'|'.. userCount..']]'.. '||style="text-align: right;"|[[:Category:'.. miscCat..'|'.. miscCount..']]'.. '||style="text-align: right;"|[[:Category:'.. faultyCat..'|'.. faultyCount..']]'
end
return wikiTable .. '\n|}'
end
{ 'DBLP', '[[DBLP]]', 2456, p.dblpLink },
{ 'GND', '[[Integrated Authority File|GND]]', 227, p.gndLink },
{ 'HDS', '[[Historical Dictionary of Switzerland|HDS]]', 902, p.hlsLink hdsLink },
{ 'IAAF', '[[International Association of Athletics Federations|IAAF]]', 1146, p.iaafLink },
{ 'ISNI', '[[International Standard Name Identifier|ISNI]]', 213, p.isniLink },