Modulo:Controllo di autorità/sandbox: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
Importo codice per WorldCat da en.wiki |
riporto alla versione corrente con modifiche per WorldCat Etichetta: Modifica da mobile avanzata |
||
Riga 2:
* Modulo che implementa il template Controllo di autorità.
* Il modulo è stato importato inizialmente da:
*
]]
Riga 13:
return false
end
return string.format( '[https://viaf.org/viaf/%s %s]', id, id ),
end
Riga 56 ⟶ 57:
return false
end
return string.format( '[
end
Riga 83 ⟶ 84:
local lccnType = parts[1] ~= 'sh' and 'names' or 'subjects'
id = parts[1] .. parts[2] .. append( parts[3], '0', 6 )
local worldCatId
▲ return string.format( '[http://id.loc.gov/authorities/%s/%s %s]', lccnType, id, id )
worldCatId = parts[1] .. parts[2] .. '-' .. parts[3]
end▼
return string.format( '[http://id.loc.gov/authorities/%s/%s %s]', lccnType, id, id ),
worldCatId and string.format( '[https://www.worldcat.org/identities/lccn-%s %s]', worldCatId, worldCatId)
end
Riga 104 ⟶ 110:
id = 'cb' .. id
end
return string.format( '[
end
Riga 127 ⟶ 133:
end
return string.format( '[https://thesaurus.cerl.org/record/%s %s]', id, id )
end▼
local function ndlLink( id )▼
if not string.match( id, '^%d+$' ) then
return false
end▼
end
Riga 181 ⟶ 194:
-- TODO Implement some sanity checking regex
return '[http://www.genealogy.ams.org/id.php?id=' .. id .. ' ' .. id .. ']'
▲end
▲local function ndlLink( id )
▲ return '[http://id.ndl.go.jp/auth/ndlna/' .. id .. ' ' .. id .. ']'
end
Riga 267 ⟶ 276:
{ 'BAV', '[[Biblioteca apostolica vaticana|BAV]]', 1017, bavLink },
{ 'CERL', '[[Consortium of European Research Libraries|CERL]]', 1871, cerlLink },
{ 'NDL', '[[Biblioteca della Dieta nazionale del Giappone|NDL]]', 349, ndlLink, lingue = { 'en', 'ja' } },
--{ 'SELIBR', '[[LIBRIS|SELIBR]]', 906, selibrLink },
--{ 'SUDOC', '[[Système universitaire de documentation|SUDOC]]', 269, sudocLink },
Riga 276 ⟶ 286:
--{ 'MBA', '[[MusicBrainz]]', 434, mbLink },
--{ 'MGP', '[[Mathematics Genealogy Project|MGP]]', 549, mgpLink },
--{ 'NCL', '[[National Central Library|NCL]]', 1048, nclLink },
--{ 'NKC', '[[National Library of the Czech Republic|NKC]]', 691, nkcLink },
Riga 293 ⟶ 302:
local p = {}
▲ if lccnParts and lccnParts[1] ~= 'sh' then
▲ end
▲end
-- Funzione per il template {{Controllo di autorità}}.
Riga 332 ⟶ 313:
if val then
local el, cat
local link, worldCatLink = params[4]( val )
if link then
local lingue = params['lingue'] and ( modlingue.lingue( params['lingue'] ) .. ' ' ) or ''
el = string.format( '%s <span class="uid">%s%s</span>', params[2], lingue, link )
cat = string.format( '[[Categoria:Voci con codice %s]]', params[1] )
if worldCatLink then elements.worldCatLink = worldCatLink end
else
el = string.format( '<span class="error">Il valore %s di %s non è valido.</span>', val, params[1] )
Riga 344 ⟶ 326:
table.insert( categories, cat )
end
if elements.worldCatLink then
table.insert( elements, '[[WorldCat Identities]] ' .. modlingue.lingue({ 'en' }) .. ' ' .. elements.worldCatLink )
table.insert( categories, '[[Categoria:Voci con codice WorldCat]]' )
end
|