Modulo:Controllo di autorità/sandbox: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m fix riga vuota |
migliorata gestione categorie per identificativo, semplificata e separata |
||
Riga 8:
local modlingue = require( 'Modulo:Linguaggi' )
require( 'Module:No globals' )
return '[[Categoria:Voci con codice ' .. id .. ']]'▼
else▼
end▼
local function viafLink( id )
Riga 29 ⟶ 13:
return false
end
return '[http://viaf.org/viaf/' .. id .. ' ' .. id .. ']'
end
Riga 96 ⟶ 80:
return false
end
return '[http://opac.sbn.it/opacsbn/opac/iccu/scheda_authority.jsp?bid=' .. id .. ' ' .. id .. ']'
end
Riga 159 ⟶ 143:
local lccnType = parts[1] ~= 'sh' and 'names' or 'subjects'
id = parts[1] .. parts[2] .. append( parts[3], '0', 6 )
return '[http://id.loc.gov/authorities/' .. lccnType .. '/' .. id .. ' ' .. id .. ']'
end
local function mbLink( id )
-- TODO Implement some sanity checking regex
return '[//musicbrainz.org/artist/' .. id .. ' ' .. id .. ']'
end
Riga 200 ⟶ 184:
return false
end
return '[http://isni.org/isni/' .. id .. ' ' .. id:sub( 1, 4 ) .. ' ' .. id:sub( 5, 8 ) .. ' ' .. id:sub( 9, 12 ) .. ' ' .. id:sub( 13, 16 ) .. ']'
end
Riga 209 ⟶ 193:
end
id = id:sub( 1, 4 ) .. '-' .. id:sub( 5, 8 ) .. '-' .. id:sub( 9, 12 ) .. '-' .. id:sub( 13, 16 )
return '[http://orcid.org/' .. id .. ' ' .. id .. ']'
end
local function gndLink( id )
return '[http://d-nb.info/gnd/' .. id .. ' ' .. id .. ']'
end
Riga 220 ⟶ 204:
return false
end
return '[//libris.kb.se/auth/' .. id .. ' ' .. id .. ']'
end
Riga 229 ⟶ 213:
end
return '[http://catalogue.bnf.fr/ark:/12148/' .. id .. ' ' .. id .. '] [http://data.bnf.fr/ark:/12148/' .. id .. ' (data)]'
end
Riga 236 ⟶ 220:
return false
end
return '[http://www.biografischportaal.nl/en/persoon/' .. id .. ' ' .. id .. ']'
end
local function ridLink( id )
return '[http://www.researcherid.com/rid/' .. id .. ' ' .. id .. ']'
end
local function bibsysLink( id )
return '[http://ask.bibsys.no/ask/action/result?cmd=&kilde=biblio&cql=bs.autid+%3D+' .. id .. '&feltselect=bs.autid ' .. id .. ']'
end
local function ulanLink( id )
return '[//www.getty.edu/vow/ULANFullDisplay?find=&role=&nation=&subjectid=' .. id .. ' ' .. id .. ']'
end
local function nlaLink( id )
return '[//nla.gov.au/anbd.aut-an' .. id .. ' ' .. id .. ']'
end
Riga 259 ⟶ 243:
return false
end
return id
end
Riga 266 ⟶ 250:
return false
end
return '[http://thesaurus.cerl.org/record/' .. id .. ' ' .. id .. ']'
if link then▼
end
--In this order: name of the parameter, label, propertyId in Wikidata, formatting function, lingue
local conf = {
{ 'VIAF', '[[Virtual International Authority File|VIAF]]', 214, viafLink, lingue = { 'en' } },
Riga 328 ⟶ 300:
local val = mWikidata._getProperty({ 'P' .. params[3], n = 1 })
if val then
local el, cat
local lingue = params['lingue'] and ( modlingue.lingue( params['lingue'] ) .. ' ' ) or ''▼
▲ local lingue = params['lingue'] and ( modlingue.lingue( params['lingue'] ) .. ' ' ) or ''
el = string.format( '%s <span class="uid">%s%s</span>', params[2], lingue, link )
el = string.format( '<span class="error">Il valore %s di %s non è valido.</span>', val, params[1] )
cat = string.format( '[[Categoria:Voci con codici controllo di autorità non validi (%s)]]', params[1] )
table.insert( elements, el )
table.insert( categories, cat )
end
end
|