Changes

Jump to navigation Jump to search

Module:Authority control

2,512 bytes added, 12:07, 6 April 2013
+ ids
return false
end
return '[http://viaf.org/viaf/' .. id .. ' ' .. id .. ']'.. getCatForId( 'VIAF' )
end
return false
end
id = tableparts[1] .. parts[2] .concat. append( parts [3], '0', 6 ) return '[http://id.loc.gov/authorities/names/' .. id .. ' ' .. id .. ']'.. getCatForId( 'LCCN' )
end
end
if string.match( id, '^%l%l?%l?/%d%d%d?%d?/%d+$' ) then
local parts = return split( id, '/' ) parts[3] = append( parts[3], '0', 6 ) return parts
end
return false
function orcidLink( id )
return '[http://orcid.org/' .. id .. ' ' .. id .. ']'.. getCatForId( 'ORCID' )
end
return false
end
return '[http://d-nb.info/gnd/' .. id .. ' ' .. id .. ']'.. getCatForId( 'GND' )end function selibrLink( id ) return '[http://libris.kb.se/auth/' .. id .. ' ' .. id .. ']' .. getCatForId( 'SELIBR' )end function gkdLink( id ) return '[http://d-nb.info/gnd/' .. id .. ' ' .. id .. '][[Category:Wikipedia articles with deprecated authority control identifiers (GKD)]]'end function swdLink( id ) return '[http://d-nb.info/gnd/' .. id .. ' ' .. id .. '][[Category:Wikipedia:Authority control (key words only)]] [[Category:Wikipedia articles with deprecated authority control identifiers (SWD)]]'end function bnfLink( id ) --with or without cd? return '[http://catalogue.bnf.fr/ark:/12148/cb' .. id .. ' ' .. id .. ']' .. getCatForId( 'BNF' )end function bpnLink( id ) return '[http://www.biografischportaal.nl/persoon/' .. id .. ' ' .. id .. ']' .. getCatForId( 'BPN' )end function ridLink( id ) return '[http://www.researcherid.com/rid/' .. id .. ' ' .. id .. ']' .. getCatForId( 'RID' )end function bibsysLink( id ) return '[http://ask.bibsys.no/ask/action/result?cmd=&kilde=biblio&cql=bs.autid+%3D+' .. id .. '&feltselect=bs.autid ' .. id .. ']' .. getCatForId( 'BIBSYS' )end function ulanLink( id ) return '[http://www.getty.edu/vow/ULANFullDisplay?find=&role=&nation=&subjectid=' .. id .. ' ' .. id .. ']' .. getCatForId( 'ULAN' )end function createRow( id, label, rawValue, link ) if link then return '* ' .. label .. ' <span class="uid">' .. link .. '</span>\n' else return '* <span class="error">The ' .. id .. ' id ' .. rawValue .. ' is not valid.</span>[[Category:Wikipedia articles with faulty authority control identifiers (' .. id .. ')]]\n' end
end
{ 'LCCN', '[[Library of Congress Control Number|LCCN]]', 0, lccnLink },
{ 'ORCID', '[[ORCID]]', 0, orcidLink },
{ 'GND', '[[Universal Authority File|GND]]', 0, gndLink }, { 'SELIBR', '[[LIBRIS]]', 0, selibrLink }, { 'GKD', '[[Corporate Bodies Authority File|GKD]]', 0, gkdLink }, { 'GKD-v1', 'DNB', 0, gkdLink }, { 'SWD', '[[Subject Headings Authority File|SWD]]', 0, swdLink }, { 'BNF', '[[Bibliothèque nationale de France|BNF]]', 0, bnfLink }, { 'BPN', '[[Biografisch Portaal|BPN]]', 0, bpnLink }, { 'RID', '[[ResearcherID]]', 0, ridLink }, { 'BIBSYS', '[[BIBSYS]]', 0, bibsysLink }, { 'ULAN', '[[Union List of Artist Names|ULAN]]', 0, bpnLink }
}
--Create rows
local elements = {}
 
--Worldcat
if parentArgs['WORLDCATID'] and parentArgs['WORLDCATID'] ~= '' then
table.insert( elements, createRow( 'WORLDCATID', '', parentArgs['WORLDCATID'], '[http://www.worldcat.org/identities/' .. parentArgs['WORLDCATID'] .. ' WorldCat]' ) ) --Validation?
elseif parentArgs['LCCN'] and parentArgs['LCCN'] ~= '' then
local lccnParts = splitLccn( parentArgs['LCCN'] )
if lccnParts then
table.insert( elements, createRow( 'LCCN', '', parentArgs['LCCN'], '[http://www.worldcat.org/identities/lccn-' .. lccnParts[1] .. lccnParts[2] .. '-' .. lccnParts[3] .. ' WorldCat]' ) )
end
end
 
--Configured rows
for k, params in pairs( conf ) do
local val = parentArgs[params[1]]
if val and val ~= '' then
local link = params[4]( val ) if link then table.insert( elements, '* ' .. params[2] .. ': <span class="uid">' .. link .. '</span>' .. getCatForIdcreateRow( params[1] ) .. '\n' ) else table.insert( elements, '* <span class="error">The ' .. params[12] .. ' id :' .. , val .. ' is not valid.</span>[[Category:Wikipedia articles with faulty authority control identifiers (' .. , params[14] .. '( val ) )]]\n' ) end
end
end
Anonymous user

Navigation menu