Difarense intrà łe version de "Modulo:Controło de autorità"

[Version verifegà][Version verifegà]
Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica
Targheta: Desfà
Nessun oggetto della modifica
Targheta: Desfà
Riga 1:
require('ModuloModule:No globals')
 
local p = {}
local function generic ( id, link, parameter )
local idlinktitle = mw.ustringtitle.gsubgetCurrentTitle( id, ' ', '%%%%20' )
local namespace = title.namespace
idlink = mw.ustring.gsub( id, '%[', '%%5B' )
local testcases = (string.sub(title.subpageText,1,9) == 'testcases')
idlink = mw.ustring.gsub( id, '%]', '%%5D' )
link = mw.ustring.gsub( link, '$1', idlink )
return '[' .. link .. ' ' .. id .. ']'
end
 
--[[==========================================================================]]
local function bncLink ( id, link, parameter )
--[[ Category functions ]]
-- filtro local del BNC, para evadir multitud de identificadores de Wikidata que no se enlazan adecuadamente
--[[==========================================================================]]
-- véase https://www.wikidata.org/wiki/Wikidata:Database_reports/Constraint_violations/P1890#%22Format%22_violations
 
if ( string.match( id, '^%d%d%d%d%d%d%d%d%d$' ) ) then
function p.getCatForId( id )
return generic ( id, link, parameter )
local catName = ''
if namespace == 0 then
catName = 'Articles with '..id..' identifiers'
elseif namespace == 2 and not title.isSubpage then
catName = 'User pages with '..id..' identifiers'
else
catName = 'Miscellaneous pages with '..id..' identifiers'
end
return '[[Category:'..catName..']]'..p.redCatLink(catName)
return false
end
 
function p.redCatLink( catName ) --catName == 'Blah' (not 'Category:Blah', not '[[Category:Blah]]')
local function bnfLink ( id, link, parameter )
if catName and catName ~= '' and
-- representación local del BNF, con doble enlace
testcases == false and
return generic( id, link, parameter ) .. ' [http://data.bnf.fr/ark:/12148/cb' .. id .. ' (data)]'
mw.title.new(catName, 14).exists == false
then
return '[[Category:Pages with red-linked authority control categories]]'
end
return ''
end
 
local function ineLink p.createRow( id, rawValues, link, parameterlinks, withUid, specialCat, prefix)
local catName = 'Articles with faulty '..(specialCat or id)..' identifiers'
-- representación especial del INE, enlace no estándar con cinco parámetros utilizados
if links then -- all links[] use withUid = false; no check needed
local ineMainRE, ineTailRE = '^(%d%d)(%d%d%d)', '(%d%d)(%d%d)(%d%d)'
local row = ''
local codProv, codMuni, codEC, codES, codNUC = string.match( id, ineMainRE .. ineTailRE .. '$' )
if prefix then
if not codEC or not codES or not codNUC then
row = row..'*'..prefix
codProv, codMuni = string.match( id, ineMainRE .. '$' )
if codProv and codMuni then
codEC, codES, codNUC = '00', '00', '00'
else
codProv, codMuni = string.match( id, ineMainRE )
codEC, codES, codNUC = '', '', ''
end
for i, l in ipairs( links ) do
if i == 1 and not prefix then row = row..'*'
else row = row..'\n**' end
if l then
row = row..'<span class="uid">'..l..'</span>'
else
row = row..'<span class="error">The '..id..' id '..rawValues[i]..' is not valid.</span>[[Category:'..catName..']]'..p.redCatLink(catName)
end
end
return row..'\n'
elseif link then -- All IDs that have a prefix support multiple identifiers, so prefix is not needed
if withUid then
return '*<span class="nowrap"><span class="uid">'..link..'</span></span>\n'
end
return '*<span class="nowrap">'..link..'</span>\n'
end
if codProv and codMuni then
return '* <span class="error">The '..id..' id '..rawValues..' is not valid.</span>[[Category:'..catName..']]'..p.redCatLink(catName)..'\n'
link = 'http://www.ine.es/nomen2/inicio_a.do?accion=busquedaAvanzada&inicio=inicio_a&subaccion=&botonBusquedaAvanzada=Consultar+selecci%C3%B3n&numPag=0&ordenAnios=ASC&comunidad=00&entidad_amb=no&poblacion_amb=T&poblacion_op=%3D&poblacion_txt=&denominacion_op=like&denominacion_txt=&codProv=$1&codMuni=$2&codEC=$3&codES=$4&codNUC=$5'
end
link = link:gsub('$1', codProv):gsub('$2', codMuni):gsub('$3', codEC):gsub('$4', codES):gsub('$5', codNUC)
 
return generic( id, link, parameter )
--[[==========================================================================]]
--[[ Property formatting functions ]]
--[[==========================================================================]]
 
-- If a link has a suitable entry in the global inter-wiki prefix table at [[:m:Interwiki_map]],
-- please consider routing through this prefix rather than as external link URL.
-- This will ease future maintenance as necessary updates to the link can be centrally carried out there rather than by updating this module.
-- The "external link" icon would disappear for such entries.
 
function p.aagLink( id, label)
--P3372's format regex: \d+ (e.g. 1)
if not id:match( '^%d+$' ) then
return false
end
return '[https://www.aucklandartgallery.com/explore-art-and-ideas/artist/'..id..'/ '..(label or 'Auckland')..']'..p.getCatForId( 'AAG' )
return id
end
 
local function commonscat p.acmLink( id, link, parameterlabel )
--P864's format regex: \d{11} (e.g. 12345678901)
-- representación especial del enlace a las categorías de Commons, para mantener el formato de enlace interwiki
if not id:match( '^%d%d%d%d%d%d%d%d%d%d%d$' ) then
local idlink = mw.ustring.gsub( id, ' ', '_' )
return false
link = mw.ustring.gsub( link, '$1', idlink )
end
return '<span class="plainlinks">[' .. link .. ' ' .. id .. ']</span>'
return '[https://dl.acm.org/profile/'..id..' '..(label or 'Association for Computing Machinery')..']'..p.getCatForId( 'ACM-DL' )
end
 
local function sisterprojects p.adbLink( id, link, parameterlabel )
--P1907's format regex: [a-z][-a-z]+-([1-3]\d|[1-9])\d{0,3} (e.g. barton-sir-edmund-toby-71)
-- enlaces interproyecto
if not id:match( '^[a-z][-a-z]+-[1-3]%d%d?%d?%d?$' ) and
local prefix = {
not id:match( '^[a-z][-a-z]+-[1-9]%d?%d?%d?$' ) then
-- Ejemplo: -- enwiki = 'w:en',
return false
commonswiki = 'c',
eswikivoyage = 'voy',
eswiktionary = 'wikt',
eswikibooks = 'b',
eswikinews = 'n',
eswikiversity = 'v',
eswikiquote = 'q',
eswikisource = 's',
mediawikiwiki = 'mw',
metawiki = 'm',
specieswiki = 'species',
}
if prefix[ parameter ] then
return '[['..prefix[ parameter ]..':'..id..'|'..id..']]'
end
return '[http://adb.anu.edu.au/biography/'..id..' '..(label or 'Australia')..']'..p.getCatForId( 'ADB' )
return false
end
 
function getCommonsValue p.agsaLink( itemIdid, label )
--P6804's format regex: [1-9]\d* (e.g. 3625)
local commonslink = ''
if not id:match( '^[1-9]%d*$' ) then
local categories = ''
return false
end
return '[https://www.agsa.sa.gov.au/collection-publications/collection/creators/_/'..id..'/ '..(label or 'South Australia')..']'..p.getCatForId( 'AGSA' )
end
 
function p.autoresuyLink( id, label )
local property = getIdsFromWikidata( itemId, 'P373' )
--P2558's format regex: [1-9]\d{0,4} (e.g. 12345)
if property and property[1] then
if not id:match( '^[1-9]%d?%d?%d?%d?$' ) then
property = property[1]
return false
commonslink = commonslink .. getLink( 373, property, commonscat )
else
property = ''
end
return '[https://autores.uy/autor/'..id..' '..(label or 'Uruguay')..']'..p.getCatForId( 'autores.uy' )
end
 
function p.awrLink( id, label )
local sitelink = getIdsFromSitelinks( itemId, 'commonswiki' )
--P4186's format regex: (([A-Z]{3}\d{4})|([A-Z]{2}\d{5}))[a-z] (e.g. PR00768b)
if sitelink and sitelink[1] then
if not id:match( '^[A-Z][A-Z][A-Z]%d%d%d%d[a-z]$' ) and
sitelink = sitelink[1]
not id:match( '^[A-Z][A-Z]%d%d%d%d%d[a-z]$' ) then
if sitelink ~= 'Category:' .. property then
return false
if commonslink == '' then
commonslink = commonslink .. sisterprojects( sitelink, nil, 'commonswiki' )
end
end
else
sitelink = ''
end
return '[http://www.womenaustralia.info/biogs/'..id..'.htm '..(label or 'Australian Women\'s Register')..']'..p.getCatForId( 'AWR' )
end
 
function p.bibsysLink( id, label )
if property and sitelink then
--P1015's format regex: [1-9]\d* or [1-9](\d{0,8}|\d{12}) (e.g. 1234567890123)
if sitelink ~= 'Category:' .. property then
--TODO: follow up @ [[d:Property talk:P1015#Discrepancy between the 2 regex constraints]] or escalate/investigate
-- categories = categories .. '[[Categoría:Wikipedia:Control de autoridades con enlaces diferentes de Commons]]'
if not id:match( '^[1-9]%d?%d?%d?%d?%d?%d?%d?%d?$' ) and
end
not id:match( '^[1-9]%d%d%d%d%d%d%d%d%d%d%d%d$' ) then
elseif sitelink then -- not property
return false
-- categories = categories .. '[[Categoría:Wikipedia:Control de autoridades sin Commonscat]]'
elseif property then -- not sitelink
-- categories = categories .. '[[Categoría:Wikipedia:Control de autoridades sin Commons]]'
else -- not property and not sitelink
-- categories = categories .. '[[Categoría:Wikipedia:Control de autoridades sin ningún enlace de Commons]]'
end
return '[https://authority.bibsys.no/authority/rest/authorities/html/'..id..' '..(label or 'Norway')..']'..p.getCatForId( 'BIBSYS' )
if commonslink ~= '' then
end
return { commonslink .. categories }
 
function p.bildLink( id, label )
--P2092's format regex: \d+ (e.g. 1)
if not id:match( '^%d+$' ) then
return false
end
return '[https://www.bildindex.de/document/obj'..id..' '..(label or 'Bildindex (Germany)')..']'..p.getCatForId( 'Bildindex' )
return {}
end
 
function p.bncLink( id, label )
local conf = {}
--P1890's format regex: \d{9} (e.g. 123456789)
--In this order: name of the parameter, label, propertyId in Wikidata, formatting function, category id
if not id:match( '^%d%d%d%d%d%d%d%d%d$' ) then
-- -- name of the parameter: unique name
return false
-- -- label: internal link in wiki format
end
-- -- propertyId in Wikidata: number without 'P' suffix
return '[http://www.bncatalogo.cl/F?func=direct&local_base=red10&doc_number='..id..' '..(label or 'Chile')..']'..p.getCatForId( 'BNC' )
-- -- formatting function: one of these four options
end
-- -- -- local function (like 'generic')
-- -- -- string 'y' (yes), to show a default identifier 'ID'
-- -- -- string 'n' (no), to show the real identifier
-- -- -- any other string, to show this string as identifier ('id', 'url', 'link', ...)
-- -- category id: one of these tree options
-- -- -- number 0, to not add category
-- -- -- number 1, to add a category based on the name of the parameter
-- -- -- any string, to add a category based on this string
conf.databases = {}
conf.databases[1] = {}
conf.databases[1].name = '[[Control de autoridades]]'
conf.databases[1].list = {
{
title = 'Proyectos Wikimedia',
group = {
{ 'Wikidata', '[[Archivo:Wikidata-logo.svg|20px|link=Wikidata|alt=Wd|Wikidata]] Datos', 'Wikidata:$1', 'n', 0 },
{ 'Commons', '[[Archivo:Commons-logo.svg|15px|link=Wikimedia Commons|alt=Commonscat|Commonscat]] Multimedia', getCommonsValue, 'n', 0 },
{ 'Wikivoyage', '[[Archivo:Wikivoyage-logo.svg|15px|link=Wikiviajes|alt=Wikivoyage|Wikivoyage]] Guía turística', 'eswikivoyage', sisterprojects, 0 },
{ 'Wiktionary', '[[Archivo:Wiktionary-logo.svg|15px|link=Wikcionario|alt=Wiktionary|Wiktionary]] Diccionario', 'eswiktionary', sisterprojects, 0 },
{ 'Wikibooks', '[[Archivo:Wikibooks-logo.svg|15px|link=Wikilibros|alt=Wikibooks|Wikibooks]] Libros y manuales', 'eswikibooks', sisterprojects, 0 },
{ 'Wikinews', '[[Archivo:Wikinews-logo.svg|20px|link=Wikinoticias|alt=Wikinews|Wikinews]] Noticias', 'eswikinews', sisterprojects, 0 },
{ 'Wikiversity', '[[Archivo:Wikiversity-logo.svg|15px|link=Wikiversidad|alt=Wikiversity|Wikiversity]] Recursos didácticos', 'eswikiversity', sisterprojects, 0 },
{ 'Wikiquote', '[[Archivo:Wikiquote-logo.svg|15px|link=Wikiquote|alt=Wikiquote|Wikiquote]] Citas célebres', 'eswikiquote', sisterprojects, 0 },
{ 'Wikisource', '[[Archivo:Wikisource-logo.svg|15px|link=Wikisource|alt=Wikisource|Wikisource]] Textos', 'eswikisource', sisterprojects, 0 },
{ 'MediaWiki', '[[Archivo:MediaWiki-2020-icon.svg|20px|link=MediaWiki|alt=MediaWiki|MediaWiki]] MediaWiki', 'mediawikiwiki', sisterprojects, 0 },
{ 'Meta-Wiki', '[[Archivo:Wikimedia Community Logo.svg|15px|link=Wikimedia Meta-Wiki|alt=Meta-Wiki|Meta-Wiki]] Coordinación', 'metawiki', sisterprojects, 0 },
{ 'Wikispecies', '[[Archivo:Wikispecies-logo.svg|15px|link=Wikispecies|alt=Wikispecies|Wikispecies]] Especies', 'specieswiki', sisterprojects, 0 },
},
},
{
title = 'Identificadores',
group = {
{ 'ISSN', '[[ISSN]]', 236, 'n', 1 },
{ 'VIAF', '[[Virtual International Authority File|VIAF]]', 214, 'n', 1 },
{ 'ISNI', '[[International Standard Name Identifier|ISNI]]', 213, 'n', 1 },
 
function p.bneLink( id, label )
{ 'BCN', '[[Biblioteca del Congreso de la Nación Argentina|BCN]]', 2879, 'n', 1 },
--P950's format regex: (XX|FF|a)\d{4,7}|(bima|bimo|bica|bis[eo]|bivi|Mise|Mimo|Mima)\d{10} (e.g. XX1234567)
{ 'BNA', '[[Biblioteca Nacional de la República Argentina|BNA]]', 3788, 'n', 1 },
if not id:match( '^[XF][XF]%d%d%d%d%d?%d?%d?$' ) and
{ 'BNE', '[[Biblioteca Nacional de España|BNE]]', 950, 'n', 1 },
not id:match( '^a%d%d%d%d%d?%d?%d?$' ) and
{ 'BNF', '[[Bibliothèque nationale de France|BNF]]', 268, bnfLink, 1 },
not id:match( '^bi[mcsv][aoei]%d%d%d%d%d%d%d%d%d%d$' ) and
{ 'BNM', '[[Biblioteca Nacional de México|BNM]]', 4440, 'n', 1 },
not id:match( '^Mi[sm][eoa]%d%d%d%d%d%d%d%d%d%d$' ) then
{ 'BNC', '[[Biblioteca Nacional de Chile|BNC]]', 1890, bncLink, 1 },
return false
{ 'CANTIC', '[[Biblioteca de Cataluña|CANTIC]]', 1273, 'n', 1 },
end
{ 'GND', '[[Integrated Authority File|GND]]', 227, 'n', 1 },
return '[http://catalogo.bne.es/uhtbin/authoritybrowse.cgi?action=display&authority_id='..id..' '..(label or 'Spain')..']'..p.getCatForId( 'BNE' ) --no https as of 9/2019
{ 'LCCN', '[[Library of Congress Control Number|LCCN]]', 244, 'n', 1 },
end
{ 'NCL', '[[National Central Library|NCL]]', 1048, 'n', 0 },
{ 'NDL', '[[National Diet Library|NDL]]', 349, 'n', 0 },
{ 'NKC', '[[National Library of the Czech Republic|NKC]]', 691, 'n', 0 },
{ 'NLA', '[[National Library of Australia|NLA]]', 409, 'n', 1 },
{ 'RLS', '[[Biblioteca del Estado Ruso|BER]]', 947, 'n', 0 },
 
function p.bnfLink( id, label )
{ 'CINII', '[[CiNii]]', 271, 'n', 0 },
--P268's format regex: \d{8}[0-9bcdfghjkmnpqrstvwxz] (e.g. 123456789)
{ 'NARA', '[[National Archives and Records Administration|NARA]]', 1225, 'n', 0 },
if not id:match( '^c?b?%d%d%d%d%d%d%d%d[0-9bcdfghjkmnpqrstvwxz]$' ) then
{ 'LCCNLCOC', '[[Library of Congress Control Number|LCCN]]', 1144, 'n', 0 },
return false
{ 'SNAC', '[[d:Q29861311|SNAC]]', 3430, 'n', 1 },
end
{ 'S2', '[[:d:Q22908627|S2]]', 4012, 'n', 0 },
--Add cb prefix if it has been removed
{ 'SUDOC', '[[Système universitaire de documentation|SUDOC]]', 269, 'n', 0 },
if not id:match( '^cb.+$' ) then
{ 'ULAN', '[[Union List of Artist Names|ULAN]]', 245, 'n', 1 },
id = 'cb'..id
{ 'frickSpain ', '[[Colección Frick|research.frick]]', 8572, 'n', 1 },
end
{ 'ORCID', '[[ORCID]]', 496, 'n', 1 },
return '[https://catalogue.bnf.fr/ark:/12148/'..id..' '..(label or 'France')..'] [https://data.bnf.fr/ark:/12148/'..id..' (data)]'..p.getCatForId( 'BNF' )
{ 'Scopus', '[[Scopus]]', 1153, 'n', 1 },
end
-- { 'SELIBR', '[[LIBRIS|SELIBR]]', 906, 'n', 1 },
{ 'BIBSYS', '[[BIBSYS]]', 1015, 'n', 1 },
{ 'UB', '[[Universidad de Barcelona|UB]]', 1580, 'n', 1 },
{ 'IPNIaut', '[[Índice Internacional de Nombres de las Plantas|IPNI]]', 586, 'n', 'IPNI' },
{ 'MGP', '[[Mathematics Genealogy Project|MGP]]', 549, 'n', 0 },
{ 'autores.uy', '[[autores.uy]]', 2558, 'n', 1 },
{ 'Slovenska biografija', '[[:d:Q15975890|Slovenska biografija]]', 1254, 'n', 0 },
{ 'SBN', '[[Istituto Centrale per il Catalogo Unico|ICCU]]', 396, 'n', 1 },
{ 'ARAE', '[[:d:Q105580684|ARAE]]', 9226, 'n', 1 },
 
function p.botanistLink( id, label )
{ 'CCBAE', '[[:d:Q61505171|CCBAE]]', 6493, 'n', 1 },
--P428's format regex: ('t )?(d')?(de )?(la )?(van (der )?)?(Ma?c)?(De)?(Di)?\p{Lu}?C?['\p{Ll}]*([-'. ]*(van )?(y )?(d[ae][nr]?[- ])?(Ma?c)?[\p{Lu}bht]?C?['\p{Ll}]*)*\.? ?f?\.? (e.g. L.)
-- { 'DIR3', '[[Directorio Común de Unidades Orgánicas y Oficinas|DIR3]]', 6222, 'n', 1 },
--not easily/meaningfully implementable in Lua's regex since "(this)?" is not allowed...
{ 'CensoGuia', '[[Censo-Guía de Archivos de España e Iberoamérica]]', 3998, 'n', 'Censo-Guía' },
if not mw.ustring.match( id, "^[%u%l%d%. '-]+$" ) then --better than nothing
{ 'Libraries.org', 'Libraries.org', 4848, 'n', 1 },
return false
{ 'DirectorioMuseos', '[[:d:Q56246649|Directorio de Museos y Colecciones de España]]', 5763, 'n', 1 },
end
{ 'SUCA', 'SUCA', 5946, 'n', 1 },
id = id:gsub(' +', '%%20')
return '[https://www.ipni.org/ipni/advAuthorSearch.do?find_abbreviation='..id..' '..(label or 'International Plant Names Index')..']'..p.getCatForId( 'Botanist' )
end
 
function p.bpnLink( id, label )
{ 'BOE', '[[Boletín Oficial del Estado|BOE]]', 4256, 'n', 1 },
--P651's format regex: \d{6,8} (e.g. 00123456)
if not id:match( '^%d%d%d%d%d%d%d%d$' ) and --original format regex, changed 8/2019 to
not id:match( '^0?%d%d%d%d%d%d%d$' ) and --allow 1-2 leading 0s, allowed by the website
not id:match( '^0?0?%d%d%d%d%d%d$' ) then
return false
end
return '[http://www.biografischportaal.nl/en/persoon/'..id..' '..(label or 'Netherlands')..']'..p.getCatForId( 'BPN' ) --no https as of 9/2019
end
 
function p.canticLink( id, label )
{ 'RoyalSociety', '[[Royal Society]]', 2070, 'url', 'Royal Society' },
--P1273's format regex: a\d{7}[0-9x] (e.g. a10640745)
{ 'HAW', '[[Academia de Ciencias y Humanidades de Heidelberg|HAW]]', 2273, 'n', 1 },
if not id:match( '^a%d%d%d%d%d%d%d[%dx]$' ) then
{ 'SAW', '[[Academia Sajona de Ciencias de Leipzig|SAW]]', 3411, 'n', 1 },
return false
{ 'KNAW', '[[Real Academia de Artes y Ciencias de los Países Bajos|KNAW]]', 2454, 'n', 1 },
end
-- { 'KVAB', '[[Real Academia Flamenca de Ciencias y Artes de Bélgica|KVAB]]', 3887, 'n', 1 },
return '[http://cantic.bnc.cat/registres/CUCId/'..id..' '..(label or 'Catalonia')..']'..p.getCatForId( 'CANTIC' ) --no https as of 10/2019
{ 'Leopoldina', '[[Deutsche Akademie der Naturforscher Leopoldina|Leopoldina]]', 3413, 'n', 1 },
end
{ 'CONICET', '[[CONICET]]', 3900, 'n', 1 },
{ 'Grierson', '[[Directorio de científicos argentinos Dra. Grierson|Grierson]]', 3946, 'n', 1 },
{ 'RANM', '[[Real Academia Nacional de Medicina|RANM]]', 3945, 'n', 1 },
-- { 'ANMF', '[[Académie Nationale de Médecine|ANMF]]', 3956, 'n', 1 },
{ 'Léonore', '[[Base Léonore|Léonore]]', 640, 'n', 0 },
{ 'USCongress', '[[Biographical Directory of the United States Congress|US Congress]]', 1157, 'n', 0 },
{ 'BPN', '[[Biografisch Portaal|BPN]]', 651, 'n', 1 },
 
function p.ciniiLink( id, label )
-- { 'ISCO', '[[d:Q1233766|ISCO]]', 952, 'n', 1 },
--P271's format regex: DA\d{7}[\dX] (e.g. DA12345678)
{ 'AAT', '[[Art & Architecture Thesaurus|AAT]]', 1014, 'n', 1 },
if not id:match( '^DA%d%d%d%d%d%d%d[%dX]$' ) then
{ 'OpenLibrary', '[[Open Library]]', 648, 'n', 'Open Library' },
return false
{ 'PARES', '[[PARES]]', 4813, 'n', 1 },
end
{ 'SSRN', '[[Social Science Research Network|SSRN]]', 3747, 'n', 'SSRN autor' },
return '[https://ci.nii.ac.jp/author/'..id..'?l=en '..(label or 'CiNii (Japan)')..']'..p.getCatForId( 'CINII' )
{ 'SIKART', '[[SIKART]]', 781, 'n', 0 },
end
{ 'KULTURNAV', '[[KulturNav]]', 1248, 'id', 0 },
{ 'RKDartists', '[[Rijksbureau voor Kunsthistorische Documentatie|RKD]]', 650, 'n', 1 },
{ 'GoogleScholar', '[[Google Académico]]', 1960, 'n', 'Google Académico' },
{ 'Microsoft Academic', '[[Microsoft Academic]]', 6366, 'n', 1 },
{ 'RID', '[[ResearcherID]]', 1053, 'n', 1 },
{ 'NLM', '[[Biblioteca Nacional de Medicina de los Estados Unidos|NLM]]', 1055, 'n', 1 },
{ 'Latindex', '[[Latindex]]', 3127, 'n', 1 },
{ 'ERIH PLUS', '[[ERIH PLUS]]', 3434, 'n', 1 },
{ 'IPNIpub', '[[Índice Internacional de Nombres de las Plantas|IPNI]]', 2008, 'n', 1 },
{ 'SUDOCcat', '[[Système universitaire de documentation|SUDOC]]', 1025, 'n', 'SUDOC catálogo' },
{ 'ZDB', '[[Zeitschriftendatenbank|ZDB]]', 1042, 'n', 1 },
{ 'NorwegianRegister', '[[Norsk senter for forskningsdata|Norwegian Register]]', 1270, 'n', 'Norwegian Register' },
{ 'DOAJ', '[[Directory of Open Access Journals|DOAJ]]', 5115, 'n', 1 },
{ 'ACNP', 'ACNP', 6981, 'n', 1 },
{ 'DipFedBra', '[[Cámara de Diputados de Brasil]]', 7480, 'n', 1 },
{ 'HCDN', '[[Cámara de Diputados de la Nación Argentina|Estadísticas HCDN]]', 4693, 'n', 1 },
{ 'HCDNbio', '[[Cámara de Diputados de la Nación Argentina|Biografía HCDN]]', 5225, 'n', 1 },
{ 'Directorio Legislativo', 'Directorio Legislativo', 6585, 'n', 0 },
-- { 'Legislatura CABA', '[[Legislatura de la Ciudad de Buenos Aires|Legislatura CABA]]', 4667, 'n', 1 },
{ 'Archivo Histórico de Diputados de España', '[[Congreso de los Diputados|Archivo Histórico de Diputados (1810-1977)]]', 9033, 'n', 1 },
{ 'Asamblea de Madrid', '[[Asamblea de Madrid]]', 4797, 'n', 1 },
{ 'BCNCL', '[[Biblioteca del Congreso Nacional de Chile|Biografías BCN]]', 5442, 'url', 0 },
{ 'RBD', '[[Ministerio de Educación de Chile|RBD MINEDUC]]', 1919, 'n', 0 },
{ 'CineChile', 'CineChile', 6750, 'url', 0 },
{ 'Tebeosfera-autor', '[[Tebeosfera]]', 5562, 'n', 1 },
{ 'DPRR', 'DPRR', 6863, 'n', 0},
{ 'tribunsdelaplebe.fr', 'TDLP', 8961, 'n', 0},
{ 'Pleiades', 'Pleiades', 1584, 'n', 0},
{ 'Número IMO', 'Número IMO', 458, 'n', 0},
},
},
{
title = 'Diccionarios y enciclopedias',
group = {
{ 'Auñamendi', '[[Enciclopedia Auñamendi|Auñamendi]]', 3218, 'n', 1 },
{ 'GEA', '[[Gran Enciclopedia Aragonesa|GEA]]', 1807, 'n', 1 },
{ 'GEN', '[[Gran Enciclopedia Navarra|GEN]]', 7388, 'n', 1 },
{ 'DBSE', '[[Diccionario biográfico del socialismo español|DBSE]]', 2985, 'url', 1 },
{ 'DBE', '[[Diccionario biográfico español|DBE]]', 4459, 'url', 1 },
{ 'HDS', '[[Historical Dictionary of Switzerland|HDS]]', 902, 'n', 0 },
{ 'LIR', '[[Diccionario histórico de Suiza|LIR]]', 886, 'n', 0 },
{ 'TLS', '[[Theaterlexikon der Schweiz|TLS]]', 1362, 'n', 0 },
{ 'Britannica', '[[Enciclopedia Británica|Britannica]]', 1417, 'url', 0 },
{ 'ELEM', '[[Enciclopedia de la Literatura en México|ELEM]]', 1565, 'n', 0 },
{ 'Treccani', '[[Enciclopedia Treccani|Treccani]]', 4223, 'url', 0 },
},
},
{
title = 'Repositorios digitales',
group = {
{ 'PerséeRevista', '[[Persée (portal)|Persée]]', 2733, 'n', 'Persée revista' },
{ 'DialnetRevista', '[[Dialnet]]', 1609, 'n', 'Dialnet revista' },
{ 'Redalyc', '[[Redalyc]]', 3131, 'n', 1 },
-- { 'UNZrevista', '[[UNZ.org|UNZ]]', 2735, 'n', 0 },
-- { 'JSTORrevista', '[[JSTOR]]', 1230, 'n', 'JSTOR revista' },
{ 'HathiTrust', '[[HathiTrust]]', 1844, 'n', 1 },
{ 'Galicianaobra', '[[Galiciana]]', 3004, 'n', 'Galiciana obra' },
{ 'Trove', '[[Trove]]', 5603, 'n', 1 },
{ 'BVMCobra', '[[Biblioteca Virtual Miguel de Cervantes|BVMC]]', 3976, 'n', 'BVMC obra' },
{ 'BVMCpersona', '[[Biblioteca Virtual Miguel de Cervantes|BVMC]]', 2799, 'n', 'BVMC persona' },
{ 'Persée', '[[Persée (portal)|Persée]]', 2732, 'n', 1 },
{ 'Dialnet', '[[Dialnet]]', 1607, 'n', 1 },
{ 'GutenbergAutor', '[[Proyecto Gutenberg]]', 1938, 'n', 'Proyecto Gutenberg autor' },
{ 'BHL-bibliografia', '[[Biodiversity Heritage Library|BHL]]', 4327, 'n', 0 },
-- { 'UNZautor', '[[UNZ.org|UNZ]]', 2734, 'n', 'UNZ' },
{ 'TLL', '[[:d:Q570837|TLL]]', 7042, 'n', 'The Latin Library' },
{ 'BDCYL', '[[Biblioteca Digital de Castilla y León|BDCYL]]', 3964, 'n', 1 },
{ 'BVPB', '[[d:Q18596294|BVPB]]', 4802, 'n', 1 },
{ 'BIDICAM', '[[d:Q61500710|BIDICAM]]', 6490, 'n', 1 },
{ 'BVANDALUCIA', '[[Biblioteca Virtual de Andalucía|BVA]]', 6496, 'n', 1 },
{ 'BVPHautoridad', '[[Biblioteca Virtual de Prensa Histórica|BVPH]]', 6492, 'n', 1 },
{ 'BivaldiAutor', '[[Biblioteca Valenciana Digital|BiValDi]]', 3932, 'n', 'Bivaldi autor' },
{ 'GalicianaAutor', '[[Galiciana]]', 3307, 'n', 'Galiciana autor' },
{ 'Packard Humanities Institute', '[[Packard Humanities Institute|PHI]]', 6941, 'n', 0 },
{ 'Europeana', '[[Europeana]]', 7704, 'n', 1 },
{ 'DOI', '[[Identificador de objeto digital|DOI]]', 356, 'n', 1 },
{ 'Handle', '[[Sistema Handle|Handle]]', 1184, 'url', 1 },
{ 'MNCARS', '[[Museo Nacional Centro de Arte Reina Sofía|MNCARS]]', 4439, 'url', 1 },
{ 'MuseoDelPradoPersona', '[[Museo del Prado]]', 5321, 'n', 'Museo del Prado (persona)' },
{ 'MuseoDelPradoObra', '[[Museo del Prado]]', 8905, 'n', 'Museo del Prado (obra)' },
},
},
{
title = 'Hemerotecas digitales',
group = {
{ 'HemBNE', '[[Hemeroteca Digital de la Biblioteca Nacional de España|Hemeroteca digital de la BNE]]', 2768, 'n', 1 },
{ 'BVPH', '[[Biblioteca Virtual de Prensa Histórica]]', 2961, 'n', 1 },
{ 'Memoriademadrid', '[[Memoriademadrid]]', 7372, 'n', 1 },
},
},
{
title = 'Astronomía',
group = {
{ 'Simbad', '[[SIMBAD]]', 3083, 'n', 0 },
{ 'JPL-Small-Body-Database', '[[JPL Small-Body Database|JPL]]', 716, 'n', 0 },
{ 'MPC', '[[Centro de Planetas Menores|MPC]]', 5736, 'n', 0 },
{ 'NASA-Exoplanet-Archive', '[[NASA Exoplanet Archive]]', 5667, 'n', 0 },
{ 'GazPlaNom', 'Gazetteer of Planetary Nomenclature', 2824, 'n', 0 },
},
},
{
title = 'Lugares',
group = {
{ 'OSM', '[[OpenStreetMap|OSM]]', 402, 'n', 'Relación OSM' },
{ 'TGN', '[[Getty Thesaurus of Geographic Names|TGN]]', 1667, 'n', 1 },
{ 'AtlasIR', '[[:d:Q24575107|Atlas Digital del Imperio Romano]]', 1936, 'n', 0 },
{ 'Pleiades', '[[:d:Q24423804|Pleiades]]', 1584, 'n', 0 },
{ 'TmGEO', '[[:d:Q22094624|Trismegistos GEO]]', 1958, 'n', 0 },
{ 'SNCZI-IPE-EMBALSE', '[[Sistema Nacional de Cartografía de Zonas Inundables|SNCZI]]-IPE', 4568, 'n', 'SNCZI-IPE embalse' },
{ 'SNCZI-IPE-PRESA', '[[Sistema Nacional de Cartografía de Zonas Inundables|SNCZI]]-IPE', 4558, 'n', 'SNCZI-IPE presa' },
{ 'NATURA2000', '[[Red Natura 2000|Natura 2000]]', 3425, 'n', 'Natura 2000' },
{ 'WWF', '[[Fondo Mundial para la Naturaleza|WWF]]', 1294, 'n', 1 },
{ 'IDESCAT', '[[Instituto de Estadística de Cataluña|IDESCAT]]', 4335, 'n', 1 },
{ 'INE', '[[Instituto Nacional de Estadística (España)|INE]]', 772, ineLink, 1 },
{ 'INE Portugal', '[[Instituto Nacional de Estatística (Portugal)|INE]]', 6324, 'n', 1 },
{ 'OFS-Suiza', '[[Oficina Federal de Estadística (Suiza)|OFS]]', 771, 'n', 1 },
{ 'IBGE', '[[Instituto Brasileiro de Geografia e Estatística|IBGE]]', 1585, 'n', 1 },
{ 'TOID', '[[TOID]]', 3120, 'n', 1 },
{ 'INSEE-commune', '[[Institut National de la Statistique et des Études Économiques|INSEE]]', 374, 'n', 'INSEE (comuna)' },
{ 'INSEE-departamento', '[[Institut National de la Statistique et des Études Économiques|INSEE]]', 2586, 'n', 'INSEE (departamento)' },
{ 'INSEE-region', '[[Institut National de la Statistique et des Études Économiques|INSEE]]', 2585, 'n', 'INSEE (región)' },
{ 'INSEE-canton', '[[Institut National de la Statistique et des Études Économiques|INSEE]]', 2506, 'n', 'INSEE (cantón)' },
{ 'SIRUTA', '[[SIRUTA]]', 843, 'n', 1 },
{ 'LAU', '[[Unidad administrativa local|LAU]]', 782, 'n', 1 },
{ 'KSH', '[[Központi Statisztikai Hivatal|KSH]]', 939, 'n', 1 },
{ 'OKATO', '[[OKATO]]', 721, 'n', 1 },
{ 'OSTAT', '[[Statistik Austria|ÖSTAT]]', 964, 'n', 'ÖSTAT-Nr'},
{ 'GNIS', 'GNIS', 590, 'n', 0},
},
},
{
title = 'Arquitectura',
group = {
{ 'DocomomoIberico', '[[Fundación Docomomo Ibérico|Docomomo Ibérico]]', 3758, 'n', 'Docomomo Ibérico' },
{ 'COAMinmueble', '[[Colegio Oficial de Arquitectos de Madrid|COAM]]', 2917, 'n', 'COAM inmueble' },
{ 'COAMpersona', '[[Colegio Oficial de Arquitectos de Madrid|COAM]]', 4488, 'n', 'COAM persona' },
},
},
{
title = 'Faros',
group = {
{ 'ARHLS', '[[Amateur Radio Lighthouse Society|ARHLS]]', 2980, 'n', 0 },
{ 'NGA', '[[Agencia Nacional de Inteligencia-Geoespacial|NGA]]', 3563, 'n', 0 },
{ 'UKHO', '[[Instituto Hidrográfico del Reino Unido|UKHO]]', 3562, 'n', 0 },
{ 'MarineTraffic', '[[MarineTraffic]]', 3601, 'n', 0 },
{ 'OnlineListofLights', '[[:d:Q843152|Online List of Lights]]', 3223, 'n', 0 },
},
},
{
title = 'Patrimonio histórico',
group = {
{ 'World Heritage Site', '[[Patrimonio de la Humanidad]]', 757, 'n', 'Centro del Patrimonio Mundial' },
{ 'CNMLBH', '[[Comisión Nacional de Monumentos, de Lugares y de Bienes Históricos|CNMLBH]]', 4587, 'n', 'cnmlbh' },
{ 'IGESPAR', '[[Instituto de Gestão do Património Arquitetónico e Arqueológico|IGESPAR]]', 1702, 'n', 1 },
{ 'SIPA', '[[Sistema de Informação para o Património Arquitetónico|SIPA]]', 1700, 'n', 1 },
{ 'Infopatrimonio', '[[:d:Q64745161|Infopatrimônio]]', 4372, 'n', 'Infopatrimônio' },
{ 'AustriaObjektID', 'Austria ObjektID', 2951, 'n', 'Austria ObjektID' },
{ 'FBBID', '[[Fredede og Bevaringsværdige Bygninger|FBB]]', 2783, 'n', 'FBB' },
{ 'Fornminnesregistret', '[[Fornminnesregistret|FMIS]]', 1260, 'n', 'FMIS' },
{ 'BerlinerKulturdenkmal', 'Berliner Kulturdenkmal', 2424, 'n', 'Berliner Kulturdenkmal' },
{ 'NHLE', '[[National Heritage List for England|NHLE]]', 1216, 'n', 1 },
{ 'NRHP', '[[Registro Nacional de Lugares Históricos|NRHP]]', 649, 'n', 1 },
{ 'KULTURMINNE', '[[Riksantikvaren|Kulturminne]]', 758, 'n', 'Kulturminne' },
{ 'CRHP', '[[:d:Q3456275|CRHP]]', 477, 'n', 1 },
{ 'MERIMEE', '[[Base Mérimée|Mérimée]]', 380, 'n', 'Mérimée' },
{ 'CADW', '[[Cadw]]', 1459, 'n', 'Cadw' },
{ 'Památkový Katalog', '[[Památkový katalog]]', 762, 'n', 'Památkový katalog' },
{ 'PatrimonioIran', 'Patrimonio Nacional de Irán', 1369, 'n', 'Patrimonio Nacional de Irán' },
{ 'Rijksmonument', 'Rijksmonument', 359, 'n', 'Rijksmonument' },
{ 'BIC', '[[Bien de Interés Cultural (España)|BIC]]', 808, 'n', 1 },
{ 'BCIN', '[[Bien Cultural de Interés Nacional|BCIN]]', 1586, 'n', 1 },
{ 'IPAC', '[[Inventario del Patrimonio Arquitectónico de Cataluña|IPAC]]', 1600, 'n', 1 },
{ 'IGPCV', '[[Inventario General del Patrimonio Cultural Valenciano|IGPCV]]', 2473, 'n', 1 },
{ 'IAPH', '[[Instituto Andaluz del Patrimonio Histórico|IAPH]]', 8425, 'n', 0 },
{ 'BDI-IAPH', '[[Instituto Andaluz del Patrimonio Histórico|Patrimonio Inmueble de Andalucía]]', 3318, 'n', 1 },
{ 'SIPCA', '[[SIPCA]]', 3580, 'n', 1 },
{ 'PWJCYL', '[[Junta de Castilla y León|Patrimonio Web JCyL]]', 3177, 'n', 'Patrimonio Web JCyL' },
{ 'CPCCLM', '[[Catálogo de Patrimonio Cultural de Castilla-La Mancha]]', 6539, 'n', 1 },
{ 'HispaniaNostra', '[[Lista roja de patrimonio en peligro|Lista Roja Hispania Nostra]]', 4868, 'url', 'Lista Roja Hispania Nostra' },
{ 'HGC', '[[Heritage Gazetteer for Cyprus]]', 6916, 'n', 1 },
{ 'HGL', '[[Heritage Gazetteer of Libya]]', 6751, 'n', 1 },
},
},
{
title = 'Deportistas',
group = {
{ 'COI', '[[Comité Olímpico Internacional|COI]]', 3171, 'n', 0 },
{ 'World Athletics', '[[World Athletics]]', 1146, 'n', 0 },
{ 'Liga Diamante', '[[Liga de Diamante]]', 3923, 'n', 0 },
{ 'ITU', '[[Unión Internacional de Triatlón|ITU]]', 3604, 'n', 0 },
{ 'ATP', '[[Asociación de Tenistas Profesionales|ATP]]', 536, 'n', 0 },
{ 'Copa Davis', '[[Copa Davis]]', 2641, 'n', 0 },
{ 'WTA', '[[Womens Tennis Association|WTA]]', 597, 'n', 0 },
{ 'Fed Cup', '[[Fed Cup]]', 2642, 'n', 0 },
{ 'ITF', '[[Federación Internacional de Tenis|ITF]]', 599, 'n', 0 },
{ 'ITHF', '[[Salón de la Fama del Tenis Internacional|ITHF]]', 3363, 'n', 0 },
{ 'ITTF', '[[Federación Internacional de Tenis de Mesa|ITTF]]', 1364, 'n', 0 },
{ 'FIFA', '[[FIFA]]', 1469, 'n', 0 },
{ 'UEFA', '[[UEFA]]', 2276, 'n', 0 },
{ 'Soccerway', '[[Soccerway]]', 2369, 'n', 0 },
{ 'Transfermarkt', '[[Transfermarkt]]', 2446, 'n', 0 },
{ 'FootballDatabase', '[[FootballDatabase]]', 3537, 'n', 0 },
{ 'BDFutbol', '[[BDFutbol]]', 3655, 'n', 0 },
{ 'EPCR', '[[European Professional Club Rugby|EPCR]]', 3666, 'n', 0 },
{ 'FIDE', '[[Federación Internacional de Ajedrez|FIDE]]', 1440, 'n', 0 },
{ 'BoxRec', '[[BoxRec]]', 1967, 'n', 0 },
{ 'Sherdog', '[[Sherdog]]', 2818, 'n', 0 },
{ 'WWE', '[[WWE]]', 2857, 'n', 0 },
{ 'NSK', '[[Asociación Japonesa de Sumo|NSK]]', 3385, 'n', 0 },
{ 'IJF', '[[Federación Internacional de Yudo|IJF]]', 4559, 'n', 0 },
{ 'FINA', '[[Federación Internacional de Natación|FINA]]', 3408, 'n', 0 },
{ 'ISHOF', '[[International Swimming Hall of Fame|ISHOF]]', 3691, 'n', 0 },
{ 'NFL', '[[National Football League|NFL]]', 3539, 'n', 0 },
{ 'NHL', '[[National Hockey League|NHL]]', 3522, 'n', 0 },
{ 'FIH', '[[Federación Internacional de Hockey|FIH]]', 3742, 'n', 0 },
{ 'MLB', '[[Grandes Ligas de Béisbol|MLB]]', 3541, 'n', 0 },
{ 'FIL', '[[Federación Internacional de Luge|FIL]]', 2990, 'n', 0 },
{ 'IBSF', '[[Federación Internacional de Bobsleigh y Skeleton|IBSF]]', 2991, 'n', 0 },
{ 'WAF', '[[Federación Internacional de Tiro con Arco|WAF]]', 3010, 'n', 0 },
{ 'FEI', '[[Federación Ecuestre Internacional|FEI]]', 3111, 'n', 0 },
{ 'FIE', '[[Federación Internacional de Esgrima|FIE]]', 2423, 'n', 0 },
{ 'CEE', '[[Confederación Europea de Esgrima|CEE]]', 4475, 'n', 0 },
{ 'IBU', '[[Unión Internacional de Biatlón|IBU]]', 2459, 'n', 0 },
{ 'ISU', '[[Unión Internacional de Patinaje sobre Hielo|ISU]]', 2694, 'n', 0 },
{ 'FIG', '[[Federación Internacional de Gimnasia|FIG]]', 2696, 'n', 0 },
{ 'UIPM', '[[Unión Internacional de Pentatlón Moderno|UIPM]]', 2726, 'n', 0 },
{ 'BWF', '[[Federación Mundial de Bádminton|BWF]]', 2729, 'n', 0 },
{ 'WCF', '[[Federación Mundial de Curling|WCF]]', 3557, 'n', 0 },
{ 'EHF', '[[Federación Europea de Balonmano|EHF]]', 3573, 'n', 0 },
{ 'IWF', '[[Federación Internacional de Halterofilia|IWF]]', 3667, 'n', 0 },
{ 'IOF', '[[Federación Internacional de Orientación|IOF]]', 3672, 'n', 0 },
{ 'ISSF', '[[Federación Internacional de Tiro Deportivo|ISSF]]', 2730, 'n', 0 },
{ 'FIVB', '[[Federación Internacional de Voleibol|FIVB]]', 2801, 'n', 0 },
{ 'CEV', '[[Confederación Europea de Voleibol|CEV]]', 3725, 'n', 0 },
{ 'ICF', '[[Federación Internacional de Piragüismo|ICF]]', 3689, 'n', 0 },
{ 'FISA', '[[Federación Internacional de Sociedades de Remo|FISA]]', 2091, 'n', 0 },
{ 'IFSC', '[[Federación Internacional de Escalada Deportiva|IFSC]]', 3690, 'n', 0 },
{ 'NLL', '[[National Lacrosse League|NLL]]', 3955, 'n', 0 },
{ 'PGA', '[[Professional Golfers Association of America|PGA]]', 2811, 'n', 0 },
{ 'LPGA', '[[LPGA]]', 2810, 'n', 0 },
{ 'FIBA', '[[Federación Internacional de Baloncesto|FIBA]]', 3542, 'n', 0 },
{ 'Euroliga', '[[Euroliga]]', 3536, 'n', 0 },
{ 'WNBA', '[[WNBA]]', 3588, 'n', 0 },
{ 'NBA', '[[NBA]]', 3647, 'n', 0 },
{ 'ACB', '[[Asociación de Clubs de Baloncesto|ACB]]', 3525, 'n', 0 },
{ 'Entr. ACB', '[[Asociación de Clubs de Baloncesto|Entrenador ACB]]', 6297, 'n', 0 },
},
},
{
title = 'Cine',
group = {
{ 'FilmAffinity', '[[FilmAffinity]]', 480, 'n', 0 },
{ 'IMDb', '[[IMDb]]', 345, 'n', 0 },
{ 'Óscar', '[[Premios Óscar|Óscar]]', 6145, 'n', 0 },
{ 'AFI', '[[Catálogo AFI|AFI]]', 3593, 'n', 0 },
{ 'Allcinema', '[[Allcinema]]', 2465, 'n', 0 },
{ 'AllMovie', '[[AllMovie]]', 1562, 'n', 0 },
{ 'AlloCiné', '[[AlloCiné]]', 1265, 'n', 0 },
{ 'BFI', '[[BFI]]', 2703, 'n', 0 },
{ 'Box Office Mojo', '[[Box Office Mojo]]', 1237, 'n', 0 },
},
},
{
title = 'Empresarios',
group = {
{ 'Bloomberg', '[[Bloomberg L.P.|Bloomberg]]', 3052, 'n', 0 },
{ 'Crunchbase', '[[Crunchbase]]', 2087, 'n', 0 },
},
},
{
title = 'Informática',
group = {
{ 'TOP500', 'TOP500', 7307, 'n', 0 },
{ 'Arch', 'Arch Linux', 3454, 'n', 0 },
{ 'AUR', 'AUR', 4162, 'n', 0 },
{ 'Debian', 'Debian', 3442, 'n', 0 },
{ 'Fedora', 'Fedora', 3463, 'n', 0 },
{ 'FSD', 'Free Software Directory', 2537, 'n', 0 },
{ 'Gentoo', 'Gentoo', 3499, 'n', 0 },
{ 'OpenHub', '[[Open Hub]]', 1972, 'n', 0 },
{ 'PyPI', '[[PyPI]]', 5568, 'n', 0 },
{ 'Snap', 'Snap', 4435, 'n', 0 },
{ 'Ubuntu', 'Ubuntu', 3473, 'n', 0 },
}
},
{
title = 'Bases de datos taxonómicas',
group = {
{ 'Algabase', '[[AlgaeBase]]', 1348, 'n', 0 },
{ 'ADW', '[[Animal Diversity Web|ADW]]', 4024, 'n', 0 },
{ 'AmphibiaWeb', 'AmphibiaWeb', 5036, 'n', 0 },
{ 'BOLD', 'BOLD', 3606, 'n', 0 },
{ 'APD', 'African Plant DB', 2036, 'n', 0 },
{ 'Avibase', 'Avibase', 2026, 'n', 0 },
{ 'BHL', '[[Biodiversity Heritage Library|BHL]]', 687, 'n', 0 },
{ 'BioLib', 'BioLib', 838, 'n', 0 },
{ 'BirdLife', '[[BirdLife International|BirdLife]]', 5257, 'n', 0 },
{ 'CatalogueOfLife', '[[Catalogue of Life]]', 3088, 'n', 0 },
{ 'CONABIO', '[[Comisión Nacional para el Conocimiento y Uso de la Biodiversidad|CONABIO]]', 4902, 'n', 0 },
{ 'Dyntaxa', 'Dyntaxa', 1939, 'n', 0 },
{ 'eBird', '[[eBird]]', 3444, 'n', 0 },
{ 'EOL', '[[Enciclopedia de la vida|EOL]]', 830, 'n', 0 },
{ 'FaunaEuropaea', '[[Fauna Europaea]]', 1895, 'n', 0 },
{ 'FishBase', '[[FishBase]]', 938, 'n', 0 },
{ 'FloraBase', 'FloraBase', 3101, 'n', 0 },
{ 'FOC', '[[Flora of China|Fl. China]]', 1747, 'n', 0 },
{ 'GBIF', '[[Global Biodiversity Information Facility|GBIF]]', 846, 'n', 0 },
{ 'GlobalSpecies', 'GlobalSpecies', 6433, 'n', 0 },
{ 'GRIN', '[[Germplasm Resources Information Network|GRIN]]', 1421, 'url', 0 },
{ 'IBC', [[Internet Bird Collection|IBC]], 3099, 'n', 0 },
{ 'IndexFungorum', '[[Index Fungorum]]', 1391, 'n', 0 },
{ 'IOBIS', 'OBIS', 6754, 'n', 0 },
{ 'IPNI', '[[Índice Internacional de Nombres de las Plantas|IPNI]]', 961, 'n', 0 },
{ 'ITIS', '[[Sistema Integrado de Información Taxonómica|ITIS]]', 815, 'n', 0 },
{ 'LPSN', '[[Listado de nombres procariotas con posición en nomenclatura|LPSN]]', 1991, 'url', 0 },
{ 'MSW', '[[Mammal Species of the World|MSW]]', 959, 'n', 0 },
{ 'MycoBank', '[[MycoBank]]', 962, 'n', 0 },
{ 'NCBI', '[[Centro Nacional para la Información Biotecnológica|NCBI]]', 685, 'n', 0 },
{ 'FossilWorks', '[[Paleobiology Database]]', 842, 'n', 0 },
{ 'PlantList', '[[The Plant List|PlantList]]', 1070, 'n', 0 },
{ 'SpeciesPlus', 'Species+', 2040, 'n', 0 },
{ 'Taxonomicon', 'Taxonomicon', 7066, 'n', 0 },
{ 'Tropicos', '[[W3TROPICOS]]', 960, 'n', 0 },
{ 'UICN', '[[Unión Internacional para la Conservación de la Naturaleza|UICN]]', 627, 'n', 0 },
{ 'USDAP', '[[Departamento de Agricultura de los Estados Unidos|USDA Plants]]', 1772, 'n', 0 },
{ 'VASCAN', 'VASCAN', 1745, 'n', 0 },
{ 'WoRMS', '[[Registro Mundial de Especies Marinas|WoRMS]]', 850, 'n', 0 },
{ 'uBio', 'uBio', 4728, 'n', 0 },
{ 'Xeno-canto', 'Xeno-canto', 2426, 'n', 0 },
{ 'Zoobank', '[[Zoobank]]', 1746, 'n', 0 },
},
},
{
title = 'Identificadores médicos',
group = {
{ 'DOID', 'DOID', 699, 'n', 0 },
{ 'CIE9', '[[CIE-9]]', 493, 'n', 0 },
{ 'CIE10', '[[CIE-10]]', 494, 'n', 0 },
{ 'CIE9MC', '[[CIE-9-MC]]', 1692, 'n', 0 },
{ 'CIE10MC', 'CIE-10-MC', 4229, 'n', 0 },
{ 'CIEO', '[[CIE-O]]', 563, 'n', 0 },
{ 'CIAP2', '[[Clasificación Internacional de Atención Primaria|CIAP-2]]', 667, 'n', 0 },
{ 'OMIM', '[[Herencia Mendeliana en el Hombre|OMIM]]', 492, 'n', 0 },
{ 'DSM IV', '[[Manual diagnóstico y estadístico de los trastornos mentales|DSM IV]]', 663, 'n', 0 },
{ 'DSM 5', '[[DSM 5|DSM-5]]', 1930, 'n', 0 },
{ 'DiseasesDB', '[[Diseases Database|DiseasesDB]]', 557, 'n', 0 },
{ 'MedlinePlus', '[[MedlinePlus]]', 604, 'n', 0 },
{ 'eMedicine', '[[eMedicine]]', 673, 'n', 0 },
{ 'MeSH', '[[Medical Subject Headings|MeSH]]', 486, 'n', 0 },
{ 'MeSHdq', 'MeSH D/Q', 9340, 'y', 0 },
{ 'DeCS', '[[Descriptores en Ciencias de la Salud|DeCS]]', 9272, 'n', 0 },
{ 'Orphanet', '[[Orphanet]]', 1550, 'n', 0 },
{ 'TA98', '[[Terminología Anatómica|TA]]', 1323, 'n', 1 },
{ 'FMA', '[[Foundational Model of Anatomy|FMA]]', 1402, 'n', 0 },
{ 'UMLS', 'UMLS', 2892, 'n', 0 },
{ 'GeneReviews', 'GeneReviews', 668, 'n', 0 },
{ 'NumE', '[[Número E]]', 628, 'n', 0 },
}
},
{
title = 'Identificadores químicos',
group = {
{ 'CAS', '[[Número CAS]]', 231, 'n', 0 },
{ 'EINECS', '[[EINECS|Números EINECS]]', 232, 'n', 0},
{ 'ATC', '[[Código ATC]]', 267, 'n', 0 },
{ 'RTECS', '[[RTECS]]', 657, 'n', 0 },
{ 'ChEBI', '[[ChEBI]]', 683, 'n', 0 },
{ 'ChEMBL', '[[ChEMBL]]', 592, 'n', 0 },
{ 'ChemSpider', '[[ChemSpider]]', 661, 'n', 0 },
{ 'DrugBank', '[[DrugBank]]', 715, 'n', 0 },
{ 'PubChem', '[[PubChem]]', 662, 'n', 0 },
{ 'UNII', '[[Unique Ingredient Identifier|UNII]]', 652, 'n', 0 },
{ 'KEGG', '[[KEGG]]', 665, 'n', 0 },
{ 'SMILES', '[[SMILES]]', 233, 'y', 0 },
{ 'InChI', '[[International Chemical Identifier|InChI]]', 234, 'y', 0 },
{ 'InChIKey', 'InChI key', 235, 'y', 0 },
}
},
{
title = 'Identificadores biológicos',
group = {
{ 'MGI', '[[Mouse Genome Informatics|MGI]]', 231, 'n', 0 },
{ 'HomoloGene', '[[HomoloGene]]', 593, 'n', 0 },
{ 'UniProt', '[[UniProt]]', 352, 'n', 0 },
}
},
{
title = 'Identificadores astronómicos',
group = {
{ 'COSPAR', 'COSPAR', 247, 'n', 0 },
{ 'SCN', '[[Satellite Catalog Number|SCN]]', 377, 'n', 0 },
{ 'NSSDCA', '[[International Designator|NSSDCA]]', 8913, 'n', 0 }
}
},
{
title = 'Ontologías',
group = {
{ 'IEV', 'Número IEV', 8855, 'n', 0 },
{ 'OUM2', 'OUM 2.0', 8769, 'n', 0 }
}
}
}
-- -- Example row: --
-- conf.databases[2] = {}
-- conf.databases[2].name = 'External links'
-- conf.databases[2].list = {
-- {
-- title = '',
-- group = {
-- { 'Website', 'Website', 856, 'n', 0 },
-- },
-- },
-- }
 
function p.cwgcLink( id, label )
--In this order: alternate name, name of parameter from databases table
--P1908's format regex: [1-9]\d* (e.g. 75228351)
conf.aliases = {
if not id:match( '^[1-9]%d*$' ) then
{ 'Wd', 'Wikidata' },
return false
{ 'PND', 'GND' },
end
{ 'Commonscat', 'Commons' },
return '[https://www.cwgc.org/find-war-dead/casualty/'..id..'/ '..(label or 'Commonwealth War Graves Commission')..']'..p.getCatForId( 'CWGC' )
}
end
 
local function getCatForIdp.emuLink( parameterid, categorylabel )
--P4613's format regex: \d{1,6} (e.g. 15409 (or 015409))
local title = mw.title.getCurrentTitle()
if not id:match( '^%d%d?%d?%d?%d?%d?$' ) then
local namespace = title.namespace
return false
if category == 0 then
return ''
elseif category == 1 then
category = parameter
end
return '[http://esu.com.ua/search_articles.php?id='..id..' '..(label or 'Ukraine')..']'..p.getCatForId( 'EMU' )
if namespace == 0 then
end
return '[[Categoría:Wikipedia:Artículos con identificadores ' .. category .. ']]\n'
 
elseif namespace == 2 and not title.isSubpage then
function p.daaoLink( id, label )
return '[[Categoría:Wikipedia:Páginas de usuario con identificadores ' .. category .. ']]\n'
--P1707's format regex: [a-z\-]+\d* (e.g. rolf-harris)
if not id:match( '^[a-z%-]+%d*$' ) then
return false
end
return '[https://www.daao.org.au/bio/'..id..' '..(label or 'Australian Artists')..']'..p.getCatForId( 'DAAO' )
end
 
function p.dblpLink( id, label )
--P2456's format regex: \d{2,3} /\d+(-\d+)?|[a-z] /[a-zA-Z][0-9A-Za-z]*(-\d+)? (e.g. 123/123)
if not id:match( '^%d%d%d?/%d+$' ) and
not id:match( '^%d%d%d?/%d+%-%d+$' ) and
not id:match( '^[a-z]/[a-zA-Z][0-9A-Za-z]*$' ) and
not id:match( '^[a-z]/[a-zA-Z][0-9A-Za-z]*%-%d+$' ) then
return false
end
return '[https://dblp.org/pid/'..id..' '..(label or 'DBLP (computer science)')..']'..p.getCatForId( 'DBLP' )
end
 
function p.dibLink( id, label )
--P6829's format regex: a\d{4}\d?(-[A-D])? (e.g. a1953)
if not id:match( '^a%d%d%d%d%d?%-?[A-D]?$' ) then
return false
end
return '[https://dib.cambridge.org/viewReadPage.do?articleId='..id..' '..(label or 'Ireland')..']'..p.getCatForId( 'DIB' )
end
 
function p.dsiLink( id, label )
--P2349's format regex: [1-9]\d* (e.g. 1538)
if not id:match( '^[1-9]%d*$' ) then
return false
end
return '[http://www.uni-stuttgart.de/hi/gnt/dsi2/index.php?table_name=dsi&function=details&where_field=id&where_value='..id..' '..(label or 'Scientific illustrators')..']'..p.getCatForId( 'DSI' )
end
 
function p.fastLink( id, label )
--P2163's format regex: [1-9]\d{0,7} (e.g. 1916996)
if not id:match( '^[1-9]%d?%d?%d?%d?%d?%d?%d?$' ) then
return false
end
return '[http://id.worldcat.org/fast/'..id..'/ '..(label or 'Faceted Application of Subject Terminology')..']'..p.getCatForId( 'FAST' )
end
 
 
function p.fnzaLink( id, label )
--P6792's format regex: [1-9]\d* (e.g. 9785)
if not id:match( '^[1-9]%d*$' ) then
return false
end
return '[https://findnzartists.org.nz/artist/'..id..'/ '..(label or 'New Zealand Artists')..']'..p.getCatForId( 'FNZA' )
end
 
function p.gndLink( id, label )
--P227's format regex: 1[012]?\d{7}[0-9X]|[47]\d{6}-\d|[1-9]\d{0,7}-[0-9X]|3\d{7}[0-9X] (e.g. 4079154-3)
if not id:match( '^1[012]?%d%d%d%d%d%d%d[0-9X]$' ) and
not id:match( '^[47]%d%d%d%d%d%d%-%d$' ) and
not id:match( '^[1-9]%d?%d?%d?%d?%d?%d?%d?%-[0-9X]$' ) and
not id:match( '^3%d%d%d%d%d%d%d[0-9X]$' ) then
return false
end
return '[https://d-nb.info/gnd/'..id..' '..(label or 'Integrated Authority File (Germany)')..']'..p.getCatForId( 'GND' )
end
 
function p.hdsLink( id, label )
--P902's format regex: \d{6} (e.g. 050123)
if not id:match( '^%d%d%d%d%d%d$' ) then
return false
end
return '[https://hls-dhs-dss.ch/fr/articles/'..id..' '..(label or 'Historical Dictionary of Switzerland')..']'..p.getCatForId( 'HDS' )
end
 
function p.iaafLink( id, label )
--P1146's format regex: [0-9][0-9]* (e.g. 012)
if not id:match( '^%d+$' ) then
return false
end
return '[https://www.iaaf.org/athletes/_/'..id..' '..(label or 'World Athletics')..']'..p.getCatForId( 'IAAF' )
end
 
 
function p.iccuLink( id, label )
--P396's format regex: IT\\ICCU\\(\d{10}|\D\D[\D\d]\D\\\d{6}) (e.g. IT\ICCU\CFIV\000163)
if not id:match( '^IT\\ICCU\\%d%d%d%d%d%d%d%d%d%d$' ) and
not id:match( '^IT\\ICCU\\%u%u[%u%d]%u\\%d%d%d%d%d%d$' ) then --legacy: %u used here instead of %D (but the faulty ID cat is empty, out of ~12k uses)
return false
end
return '[https://opac.sbn.it/opacsbn/opac/iccu/scheda_authority.jsp?bid='..id..' '..(label or 'Italy')..']'..p.getCatForId( 'ICCU' )
end
function p.iciaLink( id, label )
--P1736's format regex: \d+ (e.g. 1)
if not id:match( '^%d+$' ) then
return false
end
return '[https://www.imj.org.il/artcenter/newsite/en/?artist='..id..' '..(label or 'ICIA (Israel)')..']'..p.getCatForId( 'ICIA' )
end
 
function p.ieuLink( id, label )
--P9070's format regex: [A-Z]\\[A-Z]\\[A-Za-z0-9]+ (e.g. K\Y\Kyiv)
if not id:match( '^[A-Z]\\[A-Z]\\%w+$' ) then
return false
end
return '[http://www.encyclopediaofukraine.com/display.asp?linkpath=pages\\'..id..' '..(label or 'Internet Encyclopedia of Ukraine')..']'..p.getCatForId( 'IEU' )
end
 
function p.isniLink( id, label )
id = p.validateIsni( id ) --e.g. 0000-0000-6653-4145
if not id then
return false
end
return '[https://isni.org/isni/'..id..' '..(label or 'ISNI')..']'..p.getCatForId( 'ISNI' )
end
 
function p.jocondeLink( id, label )
--P347's format regex: [\-0-9A-Za-z]{11} (e.g. 12345678901)
local regex = '^'..string.rep('[%-0-9A-Za-z]', 11)..'$'
if not id:match( regex ) then
return false
end
return '[https://www.pop.culture.gouv.fr/notice/joconde/'..id..' '..(label or 'Joconde (France)')..']'..p.getCatForId( 'Joconde' )
end
 
function p.kulturnavLink( id, label )
--P1248's format regex: [0-9a-f]{8}\-[0-9a-f]{4}\-[0-9a-f]{4}\-[0-9a-f]{4}\-[0-9a-f]{12} (e.g. 12345678-1234-1234-1234-1234567890AB)
if not id:match( '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$' ) then
return false
end
return '[http://kulturnav.org/'..id..' '..(label or 'KulturNav (Norway)')..']'..p.getCatForId( 'KULTURNAV' ) --no https as of 9/2019
end
 
function p.lccnLink( id, label )
local parts = p.splitLccn( id ) --e.g. n78039510
if not parts then
return false
end
local lccnType = parts[1] ~= 'sh' and 'names' or 'subjects'
id = parts[1] .. parts[2] .. p.append( parts[3], '0', 6 )
return '[https://id.loc.gov/authorities/'..lccnType..'/'..id..' '..(label or 'United States')..']'..p.getCatForId( 'LCCN' )
end
 
function p.lirLink( id, label )
--P886's format regex: \d+ (e.g. 1)
if not id:match( '^%d+$' ) then
return false
end
return '[http://www.e-lir.ch/e-LIR___Lexicon.'..id..'.450.0.html '..(label or 'Lexicon Istoric Retic (Switzerland)')..']'..p.getCatForId( 'LIR' ) --no https as of 9/2019
end
 
function p.lnbLink( id, label )
--P1368's format regex: \d{9} (e.g. 123456789)
if not id:match( '^%d%d%d%d%d%d%d%d%d$' ) then
return false
end
return '[https://kopkatalogs.lv/F?func=direct&local_base=lnc10&doc_number='..id..'&P_CON_LNG=ENG '..(label or 'Latvia')..']'..p.getCatForId( 'LNB' )
end
 
function p.leonoreLink( id, label )
--P640's format regex: LH//\d{1,4}/\d{1,3}|19800035/\d{1,4}/\d{1,5}(Bis|Ter)?|C/0/\d{1,2} (e.g. LH//2064/18)
if not id:match( '^LH//%d%d?%d?%d?/%d%d?%d?$' ) and --IDs from LH//1/1 to LH//2794/54 (legionaries)
not id:match( '^19800035/%d%d?%d?%d?/%d%d?%d?%d?%d?$' ) and --IDs from 19800035/1/1 to 19800035/385/51670 (legionnaires who died 1954-1977 & some who died < 1954)
not id:match( '^19800035/%d%d?%d?%d?/%d%d?%d?%d?%d?Bis$' ) and --IDs from ?
not id:match( '^19800035/%d%d?%d?%d?/%d%d?%d?%d?%d?Ter$' ) and --IDs from ?
not id:match( '^C/0/%d%d?$' ) then --IDs from C/0/1 to C/0/84 (84 famous legionaries)
return false
end
return '[http://www.culture.gouv.fr/public/mistral/leonore_fr?ACTION=CHERCHER&FIELD_1=COTE&VALUE_1='..id..' '..(label or 'Léonore (France)')..']'..p.getCatForId( 'Léonore' ) --no https as of 9/2019
end
 
function p.maLink( id, label )
--P6366's format regex: [1-9]\d{3,9} (e.g. 1498221862)
if not id:match( '^[1-9]%d%d%d%d?%d?%d?%d?%d?%d?$' ) then
return false
end
return '[https://academic.microsoft.com/v2/detail/'..id..' '..(label or 'Microsoft Academic')..']'..p.getCatForId( 'MA' )
end
 
function p.mbaLink( id, label )
--P434's format regex: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (e.g. 12345678-1234-1234-1234-1234567890AB)
if not id:match( '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$' ) then
return false
end
local url = 'https://musicbrainz.org/artist/'..id
local cat = p.getCatForId( 'MusicBrainz' )--special cat name
if label then
return '['..url..' '..label..']'..cat
else
return '[[MBA (identifier)|MusicBrainz]] ['..url..' artist]'..cat
return '[[Categoría:Wikipedia:Páginas misceláneas con identificadores ' .. category .. ']]\n'
end
end
 
function getIdsFromSitelinksp.mbareaLink( itemIdid, propertylabel )
--P982's format regex: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (e.g. 12345678-1234-1234-1234-1234567890AB)
local ids = {}
if not id:match( '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$' ) then
local siteLink = itemId and mw.wikibase.getSitelink( itemId, property )
return false
if siteLink then
end
table.insert( ids, siteLink )
local url = 'https://musicbrainz.org/area/'..id
local cat = p.getCatForId( 'MusicBrainz area' )--special cat name
if label then
return '['..url..' '..label..']'..cat
else
return '[[MBAREA (identifier)|MusicBrainz]] ['..url..' area]'..cat
end
return ids
end
 
function getIdsFromWikidatap.mbiLink( itemIdid, propertylabel )
--P1330's format regex: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (e.g. 12345678-1234-1234-1234-1234567890AB)
local ids = {}
if not id:match( '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$' ) then
local declaraciones = mw.wikibase.getBestStatements(itemId, property)
return false
end
for _, statement in pairs( declaraciones) do
local url = 'https://musicbrainz.org/instrument/'..id
if statement.mainsnak.datavalue then
local cat = p.getCatForId( 'MusicBrainz instrument' )--special cat name
table.insert( ids, statement.mainsnak.datavalue.value )
if label then
end
return '['..url..' '..label..']'..cat
else
return '[[MBI (identifier)|MusicBrainz]] ['..url..' instrument]'..cat
end
return ids
end
 
function getLinkp.mblLink( propertyid, val, masklabel )
--P966's format regex: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (e.g. 12345678-1234-1234-1234-1234567890AB)
local link = ''
if not id:match( '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$' ) then
if mw.ustring.find( val, '//' ) then
linkreturn = valfalse
end
local url = 'https://musicbrainz.org/label/'..id
local cat = p.getCatForId( 'MusicBrainz label' )--special cat name
if label then
return '['..url..' '..label..']'..cat
else
return '[[MBL (identifier)|MusicBrainz]] ['..url..' label]'..cat
if type(property) == 'number' then
local entityObject = mw.wikibase.getEntityObject('P'..property)
local dataType = entityObject.datatype
if dataType == 'external-id' then
local allStatements = entityObject:getAllStatements('P1630')
if allStatements then
for pos = 1, #allStatements, 1 do
local q = allStatements[pos].qualifiers
if q and q.P407 and q.P407[1].datavalue.value.id == 'Q1321' then
link = allStatements[pos].mainsnak.datavalue.value
end
end
end
if link == '' then
local formatterURL = entityObject:getBestStatements('P1630')[1]
if formatterURL then
link = formatterURL.mainsnak.datavalue.value
else
local formatterURL = entityObject:getBestStatements('P3303')[1]
if formatterURL then link = formatterURL.mainsnak.datavalue.value end
end
end
elseif dataType == 'url' then
local subjectItem = entityObject:getBestStatements('P1629')[1]
if subjectItem then
local officialWebsite = mw.wikibase.getBestStatements(subjectItem.mainsnak.datavalue.value.id, 'P856')[1]
if officialWebsite then
link = officialWebsite.mainsnak.datavalue.value
end
end
elseif dataType == 'string' then
local formatterURL = entityObject:getBestStatements('P1630')[1]
if formatterURL then
link = formatterURL.mainsnak.datavalue.value
else
local formatterURL = entityObject:getBestStatements('P3303')[1]
if formatterURL then
link = formatterURL.mainsnak.datavalue.value
else
local subjectItem = entityObject:getBestStatements('P1629')[1]
if subjectItem then
local officialWebsite = mw.wikibase.getBestStatements(subjectItem.mainsnak.datavalue.value.id,'P856')[1]
if officialWebsite then
link = officialWebsite.mainsnak.datavalue.value
end
end
end
end
end
elseif type(property) == 'string' then
link = property
end
end
end
link = mw.ustring.gsub(link, '^[Hh][Tt][Tt][Pp]([Ss]?)&#58;//', 'http%1://') -- fix wikidata URL
 
if type(mask) == 'function' then
function p.mbpLink( id, label )
return mask( val, link, property )
--P1004's format regex: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (e.g. 12345678-1234-1234-1234-1234567890AB)
if not id:match( '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$' ) then
return false
end
local url = 'https://musicbrainz.org/place/'..id
link = mw.ustring.gsub(link, '$1', mw.ustring.gsub( mw.ustring.gsub( val, '%%', '%%%%' ), ' ', '%%%%20' ) or val )
local cat = p.getCatForId( 'MusicBrainz place' )--special cat name
if mw.ustring.find( link, '//' ) then
if type(mask) == 'string'label then
return '['..url..' '..label..']'..cat
link = mw.ustring.gsub( link, '%[', '%%5B' )
link = mw.ustring.gsub( link, '%]', '%%5D' )
if mask == 'y' then
return '['..link..' ID]'
elseif mask == 'n' then
return '['..link..' '..val..']'
end
return '['..link..' '..mask..']'
end
elseif link == '' then
return val
else
return '[[MBP (identifier)|MusicBrainz]] ['..linkurl..'| place]'..val..']]'cat
end
end
 
local function createRowp.mbrgLink( id, label, rawValue, link, withUid )
--P436's format regex: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (e.g. 12345678-1234-1234-1234-1234567890AB)
if link then
if not id:match( '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$' ) then
if label and label ~= '' then label = '<span style="white-space:nowrap;">'..label .. ':</span> ' end
return false
if withUid then
end
return '* ' .. label .. '<span class="uid">' .. link .. '</span>\n'
local url = 'https://musicbrainz.org/release-group/'..id
else
local cat = p.getCatForId( 'MusicBrainz release group' )--special cat name
return '* ' .. label .. link .. '\n'
if label then
end
return '['..url..' '..label..']'..cat
else
return '[[MBRG (identifier)|MusicBrainz]] ['..url..' release group]'..cat
return '* <span class="error">El ' .. id .. ' id ' .. rawValue .. ' no es válido</span>[[Categoría:Wikipedia:Páginas con problemas en el control de autoridades]]\n'
end
end
 
local function copyTablep.mbsLink(inTable id, label )
--P1407's format regex: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (e.g. 12345678-1234-1234-1234-1234567890AB)
if type(inTable) ~= 'table' then return inTable end
if not id:match( '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$' ) then
local outTable = setmetatable({}, getmetatable(inTable))
return false
for key, value in pairs (inTable) do outTable[copyTable(key)] = copyTable(value) end
end
return outTable
local url = 'https://musicbrainz.org/series/'..id
local cat = p.getCatForId( 'MusicBrainz series' )--special cat name
if label then
return '['..url..' '..label..']'..cat
else
return '[[MBS (identifier)|MusicBrainz]] ['..url..' series]'..cat
end
end
 
local function splitLccnp.mbwLink( id, label )
--P435's format regex: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (e.g. 12345678-1234-1234-1234-1234567890AB)
if not id:match( '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$' ) then
return false
end
local url = 'https://musicbrainz.org/work/'..id
local cat = p.getCatForId( 'MusicBrainz work' )--special cat name
if label then
return '['..url..' '..label..']'..cat
else
return '[[MBW (identifier)|MusicBrainz]] ['..url..' work]'..cat
end
end
 
function p.mgpLink( id, label )
--P549's format regex: \d{1,6} (e.g. 123456)
if not id:match( '^%d%d?%d?%d?%d?%d?$' ) then
return false
end
return '[https://genealogy.math.ndsu.nodak.edu/id.php?id='..id..' '..(label or 'Mathematics Genealogy Project')..']'..p.getCatForId( 'MGP' )
end
 
function p.naraLink( id, label )
--P1225's format regex: ^([1-9]\d{0,8})$ (e.g. 123456789)
if not id:match( '^[1-9]%d?%d?%d?%d?%d?%d?%d?%d?$' ) then
return false
end
return '[https://catalog.archives.gov/id/'..id..' '..(label or 'National Archives (US)')..']'..p.getCatForId( 'NARA' )
end
 
function p.nclLink( id, label )
--P1048's format regex: \d+ (e.g. 1081436)
if not id:match( '^%d+$' ) then
return false
end
return '[http://aleweb.ncl.edu.tw/F/?func=accref&acc_sequence='..id..'&CON_LNG=ENG '..(label or 'Taiwan')..']'..p.getCatForId( 'NCL' ) --no https as of 9/2019
end
 
function p.ndlLink( id, label )
--P349's format regex: 0?\d{8} (e.g. 012345678)
if not id:match( '^0?%d%d%d%d%d%d%d%d$' ) then
return false
end
return '[https://id.ndl.go.jp/auth/ndlna/'..id..' '..(label or 'Japan')..']'..p.getCatForId( 'NDL' )
end
 
function p.ngvLink( id, label )
--P2041's format regex: \d+ (e.g. 12354)
if not id:match( '^%d+$' ) then
return false
end
return '[https://www.ngv.vic.gov.au/explore/collection/artist/'..id..'/ '..(label or 'Victoria')..']'..p.getCatForId( 'NGV' )
end
 
function p.nkcLink( id, label )
--P691's format regex: [a-z]{2,4}[0-9]{2,14} (e.g. abcd12345678901234)
if not id:match( '^[a-z][a-z][a-z]?[a-z]?%d%d%d?%d?%d?%d?%d?%d?%d?%d?%d?%d?%d?%d?$' ) then
return false
end
return '[https://aleph.nkp.cz/F/?func=find-c&local_base=aut&ccl_term=ica='..id..'&CON_LNG=ENG '..(label or 'Czech Republic')..']'..p.getCatForId( 'NKC' )
end
 
function p.nlaLink( id, label )
--P409's format regex: [1-9][0-9]{0,11} (e.g. 123456789012)
if not id:match( '^[1-9]%d?%d?%d?%d?%d?%d?%d?%d?%d?%d?%d?$' ) then
return false
end
return '[https://nla.gov.au/anbd.aut-an'..id..' '..(label or 'Australia')..']'..p.getCatForId( 'NLA' )
end
 
function p.nlgLink( id, label )
--P3348's format regex: [1-9]\d* (e.g. 1)
if not id:match( '^[1-9]%d*$' ) then
return false
end
return '[https://data.nlg.gr/resource/authority/record'..id..' '..(label or 'Greece')..']'..p.getCatForId( 'NLG' )
end
 
function p.nliLink( id, label )
--P949's format regex: \d{9} (e.g. 123456789)
if not id:match( '^%d%d%d%d%d%d%d%d%d$' ) then
return false
end
return '[http://uli.nli.org.il/F/?func=direct&doc_number='..id..'&local_base=nlx10'..' '..(label or 'Israel')..']'..p.getCatForId( 'NLI' )
end
 
function p.nlkLink( id, label )
--P5034's format regex: KA.(19|20).{7} (e.g. KAC201501465)
if not id:match( '^KA.19.......$' ) and
not id:match( '^KA.20.......$' ) then
return false
end
return '[https://nl.go.kr/authorities/resource/'..id..' '..(label or 'Korea')..']'..p.getCatForId( 'NLK' )
end
 
function p.nlpLink( id, label )
--P1695's format regex: 9810[0-9]\d* or A[0-9]{7}[0-9X] (e.g. 9810123456789012345 or A10414836)
if not id:match( '^9810%d+$' ) and
not id:match( '^A%d%d%d%d%d%d%d[%dX]$' ) then
return false
end
return '[https://tools.wmflabs.org/wikidata-externalid-url?p=1695&id='..id..' '..(label or 'Poland')..']'..p.getCatForId( 'NLP' )
end
 
function p.nlrLink( id, label )
--P1003's format regex: \d{9} (e.g. 123456789)
if not id:match( '^%d%d%d%d%d%d%d%d%d$' ) then
return false
end
return '[http://aleph.bibnat.ro:8991/F/?func=direct&local_base=NLR10&doc_number='..id..' '..(label or 'Romania')..']'..p.getCatForId( 'NLR' )
end
 
function p.nskLink( id, label )
--P1375's format regex: \d{9} (e.g. 123456789)
if not id:match( '^%d%d%d%d%d%d%d%d%d$' ) then
return false
end
return '[http://katalog.nsk.hr/F/?func=direct&doc_number='..id..'&local_base=nsk10 '..(label or 'Croatia')..']'..p.getCatForId( 'NSK' ) --no https as of 9/2019
end
 
function p.ntaLink( id, label )
--P1006's format regex: \d{8}[\dX] (e.g. 12345678X)
if not id:match( '^%d%d%d%d%d%d%d%d[%dX]$' ) then
return false
end
return '[http://data.bibliotheken.nl/id/thes/p'..id..' '..(label or 'Netherlands')..']'..p.getCatForId( 'NTA' )
end
 
function p.orcidLink( id, label )
id = p.validateIsni( id ) --e.g. 0000-0002-7398-5483
if not id then
return false
end
id = id:sub( 1, 4 )..'-'..id:sub( 5, 8 )..'-'..id:sub( 9, 12 )..'-'..id:sub( 13, 16 )
return '[https://orcid.org/'..id..' '..(label or 'ORCID')..']'..p.getCatForId( 'ORCID' )
end
 
function p.picLink( id, label )
--P2750's format regex: [1-9]\d* (e.g. 1)
if not id:match( '^[1-9]%d*$' ) then
return false
end
return '[https://pic.nypl.org/constituents/'..id..' '..(label or 'Photographers\' Identities')..']'..p.getCatForId( 'PIC' )
end
 
function p.plwabnLink( id, label )
--P7293's format regex: 981[0-9]{8}05606 (e.g. 9810696457305606)
if not id:match( '^981%d%d%d%d%d%d%d%d05606*$' ) then
return false
end
return '[http://mak.bn.org.pl/cgi-bin/KHW/makwww.exe?BM=1&NU=1&IM=4&WI='..id..' '..(label or 'Poland')..']'..p.getCatForId( 'PLWABN' )
end
 
function p.publonsLink( id, label )
--P3829's format regex: \d+ (e.g. 654601)
if not id:match( '^%d+$' ) then
return false
end
return '[https://publons.com/author/'..id..'/ '..(label or 'Publons (researchers)')..']'..p.getCatForId( 'Publons' )
end
 
function p.ridLink( id, label )
--P1053's format regex: [A-Z]{1,3}-\d{4}-(19|20)\d\d (e.g. AAS-5150-2020)
if not id:match( '^[A-Z][A-Z]?[A-Z]?%-%d%d%d%d%-19%d%d$' ) and
not id:match( '^[A-Z][A-Z]?[A-Z]?%-%d%d%d%d%-20%d%d$' ) then
return false
end
return '[https://www.researcherid.com/rid/'..id..' '..(label or 'ResearcherID')..']'..p.getCatForId( 'RID' )
end
 
function p.rismLink( id, label )
--P5504's format regex: (pe|ks)?\[1-9]d* (e.g. pe30006410)
if not id:match( '^pe[1-9]%d*$' ) and --99% start with 'pe'
not id:match( '^ks[1-9]%d*$' ) and
not id:match( '^[1-9]%d*$' ) then
return false
end
return '[https://opac.rism.info/search?id='..id..' '..(label or 'RISM (France)')..']'..p.getCatForId( 'RISM' )
end
 
function p.reroLink( id, label )
--P3065's format regex: 0[1-2]-[A-Z0-9]{1,10} (e.g. 02-A012345678)
if not id:match( '^0[1-2]%-[A-Z%d][A-Z%d]?[A-Z%d]?[A-Z%d]?[A-Z%d]?[A-Z%d]?[A-Z%d]?[A-Z%d]?[A-Z%d]?[A-Z%d]?$' ) then
return false
end
return '[http://data.rero.ch/'..id..' '..(label or 'RERO (Switzerland)')..']'..p.getCatForId( 'RERO' )
end
 
function p.rkdartistsLink( id, label )
--P650's format regex: [1-9]\d{0,5} (e.g. 123456)
if not id:match( '^[1-9]%d?%d?%d?%d?%d?$' ) then
return false
end
return '[https://rkd.nl/en/explore/artists/'..id..' '..(label or 'RKD Artists (Netherlands)')..']'..p.getCatForId( 'RKDartists' )
end
 
function p.rkdidLink( id, label )
--P350's format regex: [1-9]\d{0,5} (e.g. 123456)
if not id:match( '^[1-9]%d?%d?%d?%d?%d?$' ) then
return false
end
return '[https://rkd.nl/nl/explore/images/'..id..' '..(label or 'RKD ID (Netherlands)')..']'..p.getCatForId( 'RKDID' )
end
 
function p.rslLink( id, label )
--P947's format regex: \d{1,9} (e.g. 123456789)
if not id:match( '^%d%d?%d?%d?%d?%d?%d?%d?%d?$' ) then
return false
end
return '[http://aleph.rsl.ru/F?func=find-b&find_code=SYS&adjacent=Y&local_base=RSL11&request='..id..'&CON_LNG=ENG '..(label or 'Russia')..']'..p.getCatForId( 'RSL' ) --no https as of 9/2019
end
 
function p.selibrLink( id, label )
--P906's format regex: [1-9]\d{4,5} (e.g. 123456)
if not id:match( '^[1-9]%d%d%d%d%d?$' ) then
return false
end
return '[https://libris.kb.se/auth/'..id..' '..(label or 'Sweden')..']'..p.getCatForId( 'SELIBR' )
end
 
function p.sikartLink( id, label )
--P781's format regex: \d{7,9} (e.g. 123456789)
if not id:match( '^%d%d%d%d%d%d%d%d?%d?$' ) then
return false
end
return '[http://www.sikart.ch/KuenstlerInnen.aspx?id='..id..'&lng=en '..(label or 'SIKART (Switzerland)')..']'..p.getCatForId( 'SIKART' ) --no https as of 9/2019
end
 
function p.snacLink( id, label )
--P3430's format regex: \d*[A-Za-z][0-9A-Za-z]* (e.g. A)
if not id:match( '^%d*[A-Za-z][0-9A-Za-z]*$' ) then
return false
end
return '[https://snaccooperative.org/ark:/99166/'..id..' '..(label or 'Social Networks and Archival Context')..']'..p.getCatForId( 'SNAC-ID' )
end
 
function p.sudocLink( id, label )
--P269's format regex: (\d{8}[\dX]|) (e.g. 026927608)
if not id:match( '^%d%d%d%d%d%d%d%d[%dxX]$' ) then --legacy: allow lowercase 'x'
return false
end
return '[https://www.idref.fr/'..id..' '..(label or 'SUDOC (France)')..']'..p.getCatForId( 'SUDOC' )
end
 
function p.s2authoridLink( id, label )
--P4012's format regex: [1-9]\d* (e.g. 1796130)
if not id:match( '^[1-9]%d*$' ) then
return false
end
return '[https://www.semanticscholar.org/author/'..id..' '..(label or 'Semantic Scholar')..']'..p.getCatForId( 'Semantic Scholar author' ) --special cat name
end
 
function p.ta98Link( id, label )
--P1323's format regex: A\d{2}\.\d\.\d{2}\.\d{3}[FM]? (e.g. A12.3.45.678)
if not id:match( '^A%d%d%.%d%.%d%d%.%d%d%d[FM]?$' ) then
return false
end
local longurl = '[http://tools.wmflabs.org/wikidata-externalid-url/?p=1323&url_prefix=https:%2F%2Fwww.unifr.ch%2Fifaa%2FPublic%2FEntryPage%2FTA98%20Tree%2FEntity%20TA98%20EN%2F&url_suffix=%20Entity%20TA98%20EN.htm&id='
return longurl..id..' '..(label or 'Terminologia Anatomica')..']'..p.getCatForId( 'TA98' )
end
 
function p.tdviaLink( id, label )
--P7314's format regex: [a-z/-]+] (e.g. barkan-omer-lutfi)
if not id:match( '^[a-z/-]+$' ) then
return false
end
return '[https://islamansiklopedisi.org.tr/'..id..' '..(label or 'Encyclopedia of Islam')..']'..p.getCatForId( 'TDVİA' )
end
 
 
function p.tepapaLink( id, label )
--P3544's format regex: \d+ (e.g. 1)
if not id:match( '^%d+$' ) then
return false
end
return '[https://collections.tepapa.govt.nz/agent/'..id..' '..(label or 'Te Papa (New Zealand)')..']'..p.getCatForId( 'TePapa' )
end
 
function p.tlsLink( id, label )
id = id:gsub(' +', '_')
--P1362's format regex: \p{Lu}[\p{L}\d_',\.\-\(\)\*/–]{3,59} (e.g. Abcd)
local class = "[%a%d_',%.%-%(%)%*/–]"
local regex = '^%u'..string.rep(class, 3)..string.rep(class..'?', 56)..'$'
if not mw.ustring.match( id, regex ) then
return false
end
return '[http://tls.theaterwissenschaft.ch/wiki/'..id..' '..(label or 'Theaterlexikon (Switzerland)')..']'..p.getCatForId( 'TLS' ) --no https as of 9/2019
end
 
function p.troveLink( id, label )
--P1315's format regex: [1-9]\d{5,7} (e.g. 12345678)
if not id:match( '^[1-9]%d%d%d%d%d%d?%d?$' ) then
return false
end
return '[https://trove.nla.gov.au/people/'..id..' '..(label or 'Trove (Australia)')..']'..p.getCatForId( 'Trove' )
end
 
function p.ukparlLink( id, label )
--P6213's format regex: [a-zA-Z\d]{8} (e.g. AQUupyiR)
if not id:match( '^[a-zA-Z%d][a-zA-Z%d][a-zA-Z%d][a-zA-Z%d][a-zA-Z%d][a-zA-Z%d][a-zA-Z%d][a-zA-Z%d]$' ) then
return false
end
return '[https://id.parliament.uk/'..id..' '..(label or 'UK Parliament')..']'..p.getCatForId( 'UKPARL' )
end
 
function p.ulanLink( id, label )
--P245's format regex: 500\d{6} (e.g. 500123456)
if not id:match( '^500%d%d%d%d%d%d$' ) then
return false
end
return '[https://www.getty.edu/vow/ULANFullDisplay?find=&role=&nation=&subjectid='..id..' '..(label or 'Artist Names (Getty)')..']'..p.getCatForId( 'ULAN' )
end
 
function p.uscongressLink( id, label )
--P1157's format regex: [A-Z]00[01]\d{3} (e.g. A000123)
if not id:match( '^[A-Z]00[01]%d%d%d$' ) then
return false
end
return '[http://bioguide.congress.gov/scripts/biodisplay.pl?index='..id..' '..(label or 'US Congress')..']'..p.getCatForId( 'USCongress' ) --no https as of 9/2019
end
 
function p.vcbaLink( id, label )
--P8034's format regex: \d{3}\/[1-9]\d{0,5} (e.g. 494/9793)
if not id:match( '^%d%d%d\/[1-9]%d?%d?%d?%d?%d?$' ) then
return false
end
id = id:gsub('\/', '_')
return '[https://opac.vatlib.it/auth/detail/'..id..' '..(label or 'Vatican')..']'..p.getCatForId( 'VcBA' )
end
 
function p.viafLink( id, label )
--P214's format regex: [1-9]\d(\d{0,7}|\d{17,20}) (e.g. 123456789, 1234567890123456789012)
if not id:match( '^[1-9]%d%d?%d?%d?%d?%d?%d?%d?$' ) and
not id:match( '^[1-9]%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d?%d?%d?$' ) then
return false
end
-- If the "VIAF" entry at [[:m:Interwiki map]] would resolve to "https://viaf.org/viaf/$1" (rather than "http://viaf.org/viaf/$1", as it currently still does),
-- then the code below could change from '[https://viaf.org/viaf/'..id..' '..id..']' to '[[:VIAF:'..id..'|'..id..']]'.
return '[https://viaf.org/viaf/'..id..' '..(label or 'VIAF')..']'..p.getCatForId( 'VIAF' )
end
 
--[[=========================== Helper functions =============================]]
 
function p.append(str, c, length)
while str:len() < length do
str = c..str
end
return str
end
 
--Returns the ISNI check digit isni must be a string where the 15 first elements are digits, e.g. 0000000066534145
function p.getIsniCheckDigit( isni )
local total = 0
for i = 1, 15 do
local digit = isni:byte( i ) - 48 --Get integer value
total = (total + digit) * 2
end
local remainder = total % 11
local result = (12 - remainder) % 11
if result == 10 then
return 'X'
end
return tostring( result )
end
 
--Validate ISNI (and ORCID) and retuns it as a 16 characters string or returns false if it's invalid
--See http://support.orcid.org/knowledgebase/articles/116780-structure-of-the-orcid-identifier
function p.validateIsni( id )
--P213 (ISNI) format regex: [0-9]{4} [0-9]{4} [0-9]{4} [0-9]{3}[0-9X] (e.g. 0000-0000-6653-4145)
--P496 (ORCID) format regex: 0000-000(1-[5-9]|2-[0-9]|3-[0-4])\d{3}-\d{3}[\dX] (e.g. 0000-0002-7398-5483)
id = id:gsub( '[ %-]', '' ):upper()
if not id:match( '^%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d[%dX]$' ) then
return false
end
if p.getIsniCheckDigit( id ) ~= string.char( id:byte( 16 ) ) then
return false
end
return id
end
 
function p.splitLccn( id )
--P244's format regex: (n|nb|nr|no|ns|sh)([4-9][0-9]|00|20[0-1][0-9])[0-9]{6} (e.g. n78039510)
if id:match( '^%l%l?%l?%d%d%d%d%d%d%d%d%d?%d?$' ) then
id = id:gsub( '^(%l+)(%d+)(%d%d%d%d%d%d)$', '%1/%2/%3' )
Line 790 ⟶ 884:
end
 
--[[==========================================================================]]
local p = {}
--[[ Wikidata & documentation functions ]]
--[[==========================================================================]]
 
function p.authorityControlgetIdsFromWikidata( frameitemId, property )
local pArgsids = frame:getParent().args{}
local statements = mw.wikibase.getBestStatements( itemId, property )
local parentArgs = copyTable(pArgs)
if statements then
local stringArgs = false
for _, statement in ipairs( statements ) do
local fromForCount, itemCount, rowCount = 1, 0, 0
if statement.mainsnak.datavalue then
local mobileContent = ''
table.insert( ids, statement.mainsnak.datavalue.value )
--Cleanup args
for k, v in pairs( pArgs ) do
if type(k) == 'string' then
--make args case insensitive
local lowerk = mw.ustring.lower(k)
if not parentArgs[lowerk] or parentArgs[lowerk] == '' then
parentArgs[lowerk] = v
parentArgs[k] = nil
end
--remap abc to abc1
if not mw.ustring.find(lowerk, '%d$') then --if no number at end of param
if not parentArgs[lowerk..'1'] or parentArgs[lowerk..'1'] == '' then
parentArgs[lowerk..'1'] = v
parentArgs[lowerk] = nil
end
end
if v and v ~= '' then
--find highest from param
if mw.ustring.sub(lowerk,1,4) == 'from' then
local fromNumber = tonumber(mw.ustring.sub(lowerk,5,-1))
if fromNumber and fromNumber >= fromForCount then fromForCount = fromNumber end
elseif mw.ustring.sub(lowerk,1,3) == 'for' then
local forNumber = tonumber(mw.ustring.sub(lowerk,4,-1))
if forNumber and forNumber >= fromForCount then fromForCount = forNumber end
elseif mw.ustring.lower(v) ~= 'no' and lowerk ~= 'for' then
stringArgs = true
end
end
end
end
return ids
end
 
-- Creates a human-readable standalone wikitable version of p.conf, and tracking categories with page counts, for use in the documentation
--Setup navbox
function p.docConfTable( frame )
local navboxParams = {
local wikiTable = '{| class="wikitable sortable"\n'..
name = '[[juto:Controło de autorità|Controło de autorità]]',
'! rowspan=2 | Parameter\n'..
bodyclass = 'hlist',
'! rowspan=2 | Section\n'..
groupstyle = 'width: 12%; text-align:center;',
'! rowspan=2 | Appears as\n'..
}
'! rowspan=2; data-sort-type=number | Wikidata property\n'..
for f = 1, fromForCount, 1 do
'! colspan=4 | Tracking categories and page counts\n'..
local title = {}
'|-\n'..
--cleanup parameters
'! [[:Category:Articles with authority control information|'.. 'Articles]]\n'..
if parentArgs['from'..f] == '' then parentArgs['from'..f] = nil end
'! [[:Category:User pages with authority control information|'.. 'User pages]]\n'..
if parentArgs['for'..f] == '' then parentArgs['for'..f] = nil end
'! [[:Category:Miscellaneous pages with authority control information|'..'Misc. pages]]\n'..
--remap aliases
'! [[:Category:Articles with faulty authority control information|'.. 'Faulty IDs]]\n'..
for _, a in pairs( conf.aliases ) do
'|-\n'
local alias, name = mw.ustring.lower(a[1]), mw.ustring.lower(a[2])
local lang = mw.getContentLanguage()
if parentArgs[alias..f] and not parentArgs[name..f] then
local a, u, m, f, P = 0, 0, 0, 0, 0 --cumulative sums
parentArgs[name..f] = parentArgs[alias..f]
for _, conf in pairs( p.conf ) do
parentArgs[alias..f] = nil
local param, pid, section = conf[1], conf[2], conf[4]
end
local appearsAs
if param == 'WORLDCATID' then
-- WorldCat is special
appearsAs = '[https://www.worldcat.org/identities/lccn-n78039510 WorldCat]'
elseif conf.prefix then
appearsAs = conf.prefix
else
appearsAs = conf[3](conf[5])
end
local link = conf.link or param..' (identifier)'
 
local category = conf.category or param
--Fetch Wikidata item
local args = { id = 'f', pid }
local itemId = parentArgs['from'..f] or mw.wikibase.getEntityIdForCurrentPage()
local wpl = frame:expandTemplate{ title = 'Wikidata property link', args = args }
local label = itemId and (mw.wikibase.getSitelink(itemId) or mw.wikibase.getLabel(itemId)) or ''
--cats
if label and label ~= '' then
local articleCat = 'Articles with '..category..' identifiers'
title = mw.title.new(label)
local userCat = 'User pages with '..category..' identifiers'
if not title then title = mw.title.getCurrentTitle() end
local miscCat = 'Miscellaneous pages with '..category..' identifiers'
local faultyCat = 'Articles with faulty '..category..' identifiers'
--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') )
--calcs
P = P + 1 --property count
a = a + lang:parseFormattedNumber(articleCount)
u = u + lang:parseFormattedNumber(userCount)
m = m + lang:parseFormattedNumber(miscCount)
f = f + lang:parseFormattedNumber(faultyCount)
--concat
wikiTable = wikiTable..'\n'..
'|-\n'..
'||[['..link..'|'..param..']]'..
'||'..section..
'||'..appearsAs..
'||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
--append derivative WorldCat cats
local wcd = { 'WorldCat-LCCN', 'WorldCat-VIAF' }
for _, w in pairs(wcd) do
local articleCat = 'Articles with '..w..' identifiers'
local articleCount = lang:formatNum( mw.site.stats.pagesInCategory(articleCat, 'pages') )
local appearsAs
if w == 'WorldCat-LCCN' then
appearsAs = '[https://www.worldcat.org/identities/lccn-n79-113947 WorldCat (via Library of Congress)]'
else
appearsAs = '[https://www.worldcat.org/identities/containsVIAFID/12345789 WorldCat (via VIAF)]'
title = mw.title.getCurrentTitle()
end
a = a + lang:parseFormattedNumber(articleCount)
wikiTable = wikiTable..'\n'..
'|-\n'..
'||'..'—'..
'||General'..
'||'..appearsAs..
'||data-sort-value='..w..'|'..'—'..
'||style="text-align: right;"|[[:Category:'..articleCat..'|'..articleCount..']]'..
'||style="text-align: right;"|—'..
'||style="text-align: right;"|—'..
'||style="text-align: right;"|—'
end
--append sums
wikiTable = wikiTable..'\n'..
'|-\n'..
'! style="text-align: right;" colspan=3|Totals'..
'||style="text-align: right;"|'..lang:formatNum(P)..
'||style="text-align: right;"|'..lang:formatNum(a)..
'||style="text-align: right;"|'..lang:formatNum(u)..
'||style="text-align: right;"|'..lang:formatNum(m)..
'||style="text-align: right;"|'..lang:formatNum(f)
return require('Module:Suppress categories').main(wikiTable)..'\n|}'
end
 
--[[==========================================================================]]
if (not parentArgs['wikidata'..f] or parentArgs['wikidata'..f] == '') and (title.namespace == 0 or title.namespace == 104) then
--[[ Configuration ]]
parentArgs['wikidata'..f] = parentArgs['from'..f] or itemId or ''
--[[==========================================================================]]
end
if title.namespace == 0 or title.namespace == 104 or stringArgs then --Only in the main namespaces or if there are manual overrides
 
-- Please use "<parameter> (identifier)" redirects rather than linking directly to the target page.
if fromForCount > 1 and #conf.databases > 1 then
-- This reduces clutter in "What links here" on both the redirect and the target,
if parentArgs['for'..f] and parentArgs['for'..f] ~= '' then
-- and improves reverse lookup of articles where a manifestation of each identifier is used.
navboxParams['list'..(rowCount + 1)] = "'''" .. parentArgs['for'..f] .. "'''"
else
navboxParams['list'..(rowCount + 1)] = "'''" .. title.text .. "'''"
end
navboxParams['list'..(rowCount + 1)..'style'] = 'background-color: #ddf;'
rowCount = rowCount + 1
end
for _, db in pairs( conf.databases ) do
if db.list and #db.list > 0 then
local listElements = {}
for n, gr in pairs( db.list ) do
local groupElements = {}
if gr.group and #gr.group > 0 then
for _, params in pairs( gr.group ) do
local id = mw.ustring.lower( params[1] )
-- Wikidata fallback if requested
if itemId and params[3] ~= 0 and (not parentArgs[id..f] or parentArgs[id..f] == '') then
local wikidataIds = {}
if type( params[3] ) == 'function' then
wikidataIds = params[3]( itemId )
elseif type( params[3] ) == 'string' then
wikidataIds = getIdsFromSitelinks(itemId, params[3] )
else
wikidataIds = getIdsFromWikidata( itemId, 'P' .. params[3] )
end
if wikidataIds[1] then
parentArgs[id..f] = wikidataIds[1]
end
end
-- Worldcat
if id == 'issn' and parentArgs['worldcatid'..f] and parentArgs['worldcatid'..f] ~= '' then -- 'issn' is the first element following the 'wikidata' item
table.insert( groupElements, createRow( id, '', parentArgs['worldcatid'..f], '[//www.worldcat.org/identities/' .. parentArgs['worldcatid'..f] .. ' WorldCat]', false ) ) --Validation?
elseif id == 'viaf' and parentArgs[id..f] and string.match( parentArgs[id..f], '^%d+$' ) and not parentArgs['worldcatid'..f] then -- Hackishly copy the validation code; this should go away when we move to using P1793 and P1630
table.insert( groupElements, createRow( id, '', parentArgs[id..f], '[//www.worldcat.org/identities/containsVIAFID/' .. parentArgs[id..f] .. ' WorldCat]', false ) )
elseif id == 'lccn' and parentArgs[id..f] and parentArgs[id..f] ~= '' and not parentArgs['viaf'..f] and not parentArgs['worldcatid'..f] then
local lccnParts = splitLccn( parentArgs[id..f] )
if lccnParts and lccnParts[1] ~= 'sh' then
table.insert( groupElements, createRow( id, '', parentArgs[id..f], '[//www.worldcat.org/identities/lccn-' .. lccnParts[1] .. lccnParts[2] .. '-' .. lccnParts[3] .. ' WorldCat]', false ) )
end
end
 
-- p.conf table basic format: { 'parameter name', propertyId # in Wikidata, formatting/validation function, section, example ID for documentation }
local val = parentArgs[id..f]
-- p.conf table optional named parameters:
if val and val ~= '' and mw.ustring.lower(val) ~= 'no' and params[3] ~= 0 then
-- link: to override the link in the documentation (defaults to "<parameter> (identifer)")
local link
-- category: to override the ID in category names (defaults to "... with <parameter> identifiers")
if type( params[3] ) == 'function' then
-- prefix: to include a prefix (usually a wikilink explaining what the identifier is) before the external link itself
link = val
p.conf = {
else
{ 'AAG', 3372, p.aagLink, 'Art galleries and museums', '1' },
link = getLink( params[3], val, params[4] )
{ 'ACM-DL', 864, p.acmLink, 'Scientific databases', '12345678901', link = 'ACM DL (identifier)' },
end
{ 'ADB', 1907, p.adbLink,'Biographical dictionaries', 'barton-sir-edmund-toby-71' },
if link and link ~= '' then
{ 'AGSA', 6804, p.agsaLink, 'Art galleries and museums', '3625' },
table.insert( groupElements, createRow( id, params[2], val, link, true ) .. getCatForId( params[1], params[5] or 0 ) )
{ 'autores.uy', 2558, p.autoresuyLink, 'Biographical dictionaries', '12345' },
itemCount = itemCount + 1
{ 'AWR', 4186, p.awrLink, 'Biographical dictionaries', 'PR00768b' },
end
{ 'BIBSYS', 1015, p.bibsysLink, 'National libraries', '1234567890123' },
end
{ 'Bildindex', 2092, p.bildLink, 'Art research institutes', '1' },
end
{ 'BNC', 1890, p.bncLink, 'National libraries', '123456789' },
if #groupElements > 0 then
{ 'BNE', 950, p.bneLink, 'National libraries', 'XX1234567' },
if gr.title and gr.title ~= '' then
{ 'BNF', 268, p.bnfLink, 'National libraries', '123456789' },
table.insert( listElements, "* '''"..gr.title.."'''\n" )
{ 'Botanist', 428, p.botanistLink , 'Scientific databases', 'L.' },
end
{ 'BPN', 651, p.bpnLink , 'Biographical dictionaries', '12345678' },
table.insert( listElements, table.concat( groupElements ) )
{ 'CANTIC', 1273, p.canticLink, 'National libraries', 'a12345678' },
if n == 1 and #groupElements > 1 then
{ 'CINII', 271, p.ciniiLink, 'Scientific databases', 'DA12345678', link = 'CiNii (identifier)' },
table.insert( listElements, "\n----\n" )
{ 'CWGC', 1908, p.cwgcLink, 'Other', '1234567' },
end
{ 'DAAO', 1707, p.daaoLink, 'Art research institutes', 'rolf-harris' },
-- mobile version
{ 'DBLP', 2456, p.dblpLink, 'Scientific databases', '123/123' },
if n == 1 then
{ 'DIB', 6829, p.dibLink, 'Biographical dictionaries', 'a1234' },
mobileContent = table.concat( groupElements )
{ 'DSI', 2349, p.dsiLink, 'Art research institutes', '1538' },
end
{ 'EMU', 4613, p.emuLink, 'National libraries', '15409' },
end
{ 'FAST', 2163, p.fastLink, 'Other', '1' },
{ 'FNZA', 6792, p.fnzaLink, 'Art research institutes', '12' },
{ 'GND', 227, p.gndLink, 'General', '4079154-3' },
{ 'HDS', 902, p.hdsLink, 'Other', '050123' },
{ 'IAAF', 1146, p.iaafLink, 'Other', '123' },
{ 'ICCU', 396, p.iccuLink, 'National libraries', 'IT\\ICCU\\CFIV\\000163' }, --formerly SBN
{ 'ICIA', 1736, p.iciaLink, 'Art research institutes', '1' },
{ 'IEU', 9070, p.ieuLink, 'Other', 'N\\A\\NationalAcademyofArtandArchitecture' },
{ 'ISNI', 213, p.isniLink, 'General', '0000-0000-6653-4145', prefix = '[[ISNI (identifier)|ISNI]]' },
{ 'Joconde', 347, p.jocondeLink, 'Art research institutes', '12345678901' },
{ 'KULTURNAV', 1248, p.kulturnavLink, 'Art research institutes', '12345678-1234-1234-1234-1234567890AB', link = 'KulturNav (identifier)' },
{ 'LCCN', 244, p.lccnLink, 'National libraries', 'n78039510' },
{ 'LIR', 886, p.lirLink, 'Other', '1' },
{ 'LNB', 1368, p.lnbLink, 'National libraries', '123456789' },
{ 'Léonore', 640, p.leonoreLink, 'Other', 'LH//1/1', prefix = '[[Léonore (identifier)|Léonore (France)]]' },
{ 'MA', 6366, p.maLink, 'Other', '123456789' },
{ 'MBA', 434, p.mbaLink, 'Other', '12345678-1234-1234-1234-1234567890AB', category = 'MusicBrainz' }, --special cat name
{ 'MBAREA', 982, p.mbareaLink, 'Other', '12345678-1234-1234-1234-1234567890AB', category = 'MusicBrainz area' }, --special cat name
{ 'MBI', 1330, p.mbiLink, 'Other', '12345678-1234-1234-1234-1234567890AB', category = 'MusicBrainz instrument' }, --special cat name
{ 'MBL', 966, p.mblLink, 'Other', '12345678-1234-1234-1234-1234567890AB', category = 'MusicBrainz label' }, --special cat name
{ 'MBP', 1004, p.mbpLink, 'Other', '12345678-1234-1234-1234-1234567890AB', category = 'MusicBrainz place' }, --special cat name
{ 'MBRG', 436, p.mbrgLink, 'Other', '12345678-1234-1234-1234-1234567890AB', category = 'MusicBrainz release group' }, --special cat name
{ 'MBS', 1407, p.mbsLink, 'Other', '12345678-1234-1234-1234-1234567890AB', category = 'MusicBrainz series' }, --special cat name
{ 'MBW', 435, p.mbwLink, 'Other', '12345678-1234-1234-1234-1234567890AB', category = 'MusicBrainz work' }, --special cat name
{ 'MGP', 549, p.mgpLink, 'Scientific databases', '123456' },
{ 'NARA', 1225, p.naraLink, 'Other', '12345678' },
{ 'NCL', 1048, p.nclLink, 'National libraries', '1081436' },
{ 'NDL', 349, p.ndlLink, 'National libraries', '012345678' },
{ 'NGV', 2041, p.ngvLink, 'Art galleries and museums', '12354' },
{ 'NKC', 691, p.nkcLink, 'National libraries', 'abcd12345678901234' },
{ 'NLA', 409, p.nlaLink, 'National libraries', '123456789012' },
{ 'NLG', 3348, p.nlgLink, 'National libraries', '12345678' },
{ 'NLI', 949, p.nliLink, 'National libraries', '123456789' },
{ 'NLK', 5034, p.nlkLink, 'National libraries', 'KAB197000000' },
{ 'NLP', 1695, p.nlpLink, 'National libraries', '9810123456789012345' },
{ 'NLR', 1003, p.nlrLink, 'National libraries', '123456789' },
{ 'NSK', 1375, p.nskLink, 'National libraries', '123456789' },
{ 'NTA', 1006, p.ntaLink, 'National libraries', '12345678X' },
{ 'ORCID', 496, p.orcidLink, 'General', '0000-0002-7398-5483', prefix = '[[ORCID (identifier)|ORCID]]' },
{ 'PIC', 2750, p.picLink, 'Art research institutes', '1' },
{ 'PLWABN', 7293, p.plwabnLink, 'National libraries', '9812345678905606' },
{ 'Publons', 3829, p.publonsLink, 'Scientific databases', '2776255' },
{ 'RID', 1053, p.ridLink, 'Scientific databases', 'A-1234-1934' },
{ 'RISM', 5504, p.rismLink, 'Other', 'pe1', prefix = '[[RISM (identifier)|RISM (France)]]' },
{ 'RERO', 3065, p.reroLink, 'Other', '02-A012345678', prefix = '[[RERO (identifier)|RERO (Switzerland)]]' },
{ 'RKDartists', 650, p.rkdartistsLink, 'Art research institutes', '123456' },
{ 'RKDID', 350, p.rkdidLink, 'Art research institutes', '123456' },
{ 'RSL', 947, p.rslLink, 'National libraries', '123456789' },
{ 'SELIBR', 906, p.selibrLink, 'National libraries', '123456' },
{ 'SIKART', 781, p.sikartLink, 'Art research institutes', '123456789' },
{ 'SNAC-ID', 3430, p.snacLink, 'Other', 'A' },
{ 'SUDOC', 269, p.sudocLink, 'Other', '026927608', prefix = '[[SUDOC (identifier)|SUDOC (France)]]' },
{ 'S2AuthorId', 4012, p.s2authoridLink, 'Scientific databases', '1796130', category = 'Semantic Scholar author' }, --special cat name
{ 'TA98', 1323, p.ta98Link, 'Scientific databases', 'A12.3.45.678' },
{ 'TDVİA', 7314, p.tdviaLink, 'Other', 'asim-b-behdele' },
{ 'TePapa', 3544, p.tepapaLink, 'Art galleries and museums', '1' },
{ 'TLS', 1362, p.tlsLink, 'Other', 'Abcd' },
{ 'Trove', 1315, p.troveLink, 'Other', '12345678', prefix = '[[Trove (identifier)|Trove (Australia)]]' }, --formerly NLA-person
{ 'UKPARL', 6213, p.ukparlLink, 'Other', 'AQUupyiR' },
{ 'ULAN', 245, p.ulanLink, 'Art research institutes', '500123456' },
{ 'USCongress', 1157, p.uscongressLink, 'Other', 'A000123', link = 'US Congress (identifier)' },
{ 'VcBA', 8034, p.vcbaLink, 'National libraries', '494/9793' },
{ 'VIAF', 214, p.viafLink, 'General', '123456789', prefix = '[[VIAF (identifier)|VIAF]]' },
{ 'WORLDCATID', 7859, nil, 'General', nil, link = 'WorldCat Identities (identifier)' },
}
 
-- Legitimate aliases to p.conf, for convenience
-- Format: { 'alias', 'parameter name in p.conf' }
p.aliases = {
{ 'DNB', 'GND' }, --Deutsche Nationalbibliothek -> Gemeinsame Normdatei
{ 'Leonore', 'Léonore' }, --alias name without diacritics
{ 'leonore', 'Léonore' }, --lowercase variant without diacritics
{ 'MusicBrainz', 'MBA' },
{ 'MusicBrainz artist', 'MBA' },
{ 'MusicBrainz label', 'MBL' },
{ 'MusicBrainz release group', 'MBRG' },
{ 'MusicBrainz work', 'MBW' },
{ 'SBN', 'ICCU' }, --SBN alias to be deprecated at a later stage
{ 'TDVIA', 'TDVİA' }, --alias name without diacritics
{ 'tdvia', 'TDVİA' }, --lowercase variant without diacritics
}
 
-- Deprecated aliases to p.conf; tracked in [[Category:Articles with deprecated authority control identifiers]]
-- Format: { 'deprecated parameter name', 'replacement parameter name in p.conf' }
p.deprecated = {
{ 'GKD', 'GND' },
{ 'PND', 'GND' },
{ 'RLS', 'RSL' },
{ 'SWD', 'GND' },
{ 'NARA-organization', 'NARA' },
{ 'NARA-person', 'NARA' },
}
 
--[[==========================================================================]]
--[[ Main ]]
--[[==========================================================================]]
 
function p.authorityControl( frame )
local resolveEntity = require( 'Module:ResolveEntityId' )
local parentArgs = frame:getParent().args --WD IDs added here later
local iParentArgs = 0 --count original/manual parent args only later
local worldcatCat = ''
local elementsCat = ''
local multipleIdCat = ''
local suppressedIdCat = ''
local suppressedIdCatArts = ''
local deprecatedIdCat = ''
local differentOnWDCat = ''
local sameOnWDCat = ''
local stateCat = ''
--redirect aliases to proper parameter names
for _, a in pairs( p.aliases ) do
local alias, param = a[1], a[2]
if (parentArgs[param] == nil or parentArgs[param] == '') and parentArgs[alias] then
parentArgs[param] = parentArgs[alias]
end
end
--redirect deprecated parameters to proper parameter names, and assign tracking cat
for _, d in pairs( p.deprecated ) do
local dep, param = d[1], d[2]
if (parentArgs[param] == nil or parentArgs[param] == '') and parentArgs[dep] then
parentArgs[param] = parentArgs[dep]
if namespace == 0 then
deprecatedIdCat = '[[Category:Articles with deprecated authority control identifiers|'..dep..']]'
end
end
end
--use QID= parameter for testing/example purposes only
local itemId = nil
if namespace ~= 0 then
local qid = parentArgs['qid'] or parentArgs['QID']
if qid then
itemId = 'Q'..mw.ustring.gsub(qid, '^[Qq]', '')
itemId = resolveEntity._id(itemId) --nil if unresolvable
end
else
itemId = mw.wikibase.getEntityIdForCurrentPage()
end
--Wikidata fallback if available
if itemId then
local suppressedIdCount = 0
local iMatches = 0
for _, params in ipairs( p.conf ) do
if params[2] > 0 then
local val = parentArgs[mw.ustring.lower(params[1])] or parentArgs[params[1]]
if val == nil or val == '' then
local wikidataIds = p.getIdsFromWikidata( itemId, 'P'..params[2] )
if wikidataIds[1] then
if val == '' and (namespace == 0 or testcases) then
suppressedIdCount = suppressedIdCount + 1
suppressedIdCat = '[[Category:Articles with suppressed authority control identifiers|'..params[1]..']]'
else
parentArgs[params[1]] = wikidataIds[1] --add ID from WD
end
end
else
-- Generate navbox title
iParentArgs = iParentArgs + 1
if #listElements > 0 then
local wikidataIds = p.getIdsFromWikidata( itemId, 'P'..params[2] )
if fromForCount > 1 and #conf.databases == 1 then
if parentArgswikidataIds['for'..f1] and parentArgs['for'..f]differentOnWDCat ~== '' then
local bMatch = false
navboxParams['group'..(rowCount + 1)] = "''" .. parentArgs['for'..f] .. "''"
for _, wd in pairs( wikidataIds ) do
else
if val == wd then
navboxParams['group'..(rowCount + 1)] = "''" .. title.text .. "''"
iMatches = iMatches + 1
bMatch = true
end
else
navboxParams['group'..(rowCount + 1)] = db.name or ''
end
if bMatch == false then
navboxParams['list'..(rowCount + 1)] = table.concat( listElements )
differentOnWDCat = '[[Category:Pages using authority control with parameters different on Wikidata|'..params[1]..']]'
rowCount = rowCount + 1
end end end end end
if iMatches > 0 and iMatches == iParentArgs then
sameOnWDCat = '[[Category:Pages using authority control with parameters all matching Wikidata]]'
end
if parentArgs['arts'] == 'arts' and suppressedIdCount > 0 then
if namespace == 0 or testcases then
local s = 's'
if suppressedIdCount == 1 then s = '' end
local sCat = 'ACArt with '..suppressedIdCount..' suppressed element'..s
suppressedIdCatArts = '[[Category:'..sCat..']]'..p.redCatLink(sCat)
end
end
end
--configure rows
local rct = 0
local sectionOrder = {'General','National libraries','Art galleries and museums',
'Art research institutes','Biographical dictionaries','Scientific databases',
'Other'}
local sections = {
['General'] = {},
['National libraries'] = {},
['Art galleries and museums'] = {},
['Art research institutes'] = {},
['Biographical dictionaries'] = {},
['Scientific databases'] = {},
['Other'] = {}
}
--don't show NLP if PLWABN is present, since they both go to the National Library of Poland
--and the library has deprecated NLP IDs in favor of PLWABN IDs
if parentArgs.PLWABN or parentArgs.plwabn then
parentArgs.NLP = ''
parentArgs.nlp = ''
end
for _, params in ipairs( p.conf ) do
local val = parentArgs[mw.ustring.lower(params[1])] or parentArgs[params[1]]
local tval, tlinks = {}, {} --init tables
if val and val ~= '' and type(params[3]) == 'function' then
table.insert( tval, val )
if params.prefix then
table.insert( tlinks, params[3]( val, '1' ) )
else
table.insert( tlinks, params[3]( val ) )
end
end
--collect other unique vals (IDs) from WD, if present
if itemId and tval[1] then
local nextIdVal = 2
local wikidataIds = p.getIdsFromWikidata( itemId, 'P'..params[2] )
for _, v in pairs( wikidataIds ) do
local bnew = true
for _, w in pairs( tval ) do
if v == w then bnew = false end
end
if bnew then
table.insert( tval, v )
table.insert( tlinks, params[3]( v, tostring(nextIdVal) ) )
nextIdVal = nextIdVal + 1
end
end
end
--assemble
if tval[1] then
table.insert( sections[params[4]], p.createRow( params[1], tval, nil, tlinks, true, params.category, params.prefix) )
rct = rct + 1
if tval[2] then
multipleIdCat = p.getCatForId( 'multiple' )
end
end
end
if rowCount > 0 then
--WorldCat
local Navbox = require('Modulo:Navbox')
local worldcatId = parentArgs['worldcatid'] or parentArgs['WORLDCATID']
if fromForCount > 1 then
if worldcatId and worldcatId ~= '' then --if WORLDCATID present & unsuppressed
--add missing names
table.insert( sections['General'], p.createRow( 'WORLDCATID', worldcatId, '[https://www.worldcat.org/identities/'..mw.uri.encode(worldcatId, 'PATH')..' WorldCat]', nil, false ) ) --Validation?
for r = 1, rowCount, 1 do
worldcatCat = p.getCatForId( 'WORLDCATID' )
if navboxParams['group'..r] == '' then
rct = rct + 1
navboxParams['group'..r] = "''" .. mw.wikibase.getEntity(parentArgs['wikidata'..r]):getLabel().."''"
elseif worldcatId == nil then --if WORLDCATID absent but unsuppressed
local viafId = parentArgs['viaf'] or parentArgs['VIAF']
local lccnId = parentArgs['lccn'] or parentArgs['LCCN']
if viafId and viafId ~= '' and p.viafLink( viafId ) then --VIAF must be present, unsuppressed, & validated
table.insert( sections['General'], p.createRow( 'VIAF', viafId, '[https://www.worldcat.org/identities/containsVIAFID/'..viafId..' WorldCat (via VIAF)]', nil, false ) )
if namespace == 0 then
worldcatCat = '[[Category:Articles with WorldCat-VIAF identifiers]]'
end
rct = rct + 1
elseif lccnId and lccnId ~= '' and p.lccnLink( lccnId ) then --LCCN must be present, unsuppressed, & validated
local lccnParts = p.splitLccn( lccnId )
if lccnParts and lccnParts[1] ~= 'sh' then
local lccnIdFmtd = lccnParts[1]..lccnParts[2]..'-'..lccnParts[3]
table.insert( sections['General'], p.createRow( 'LCCN', lccnId, '[https://www.worldcat.org/identities/lccn-'..lccnIdFmtd..' WorldCat (via Library of Congress)]', nil, false ) )
if namespace == 0 then
worldcatCat = '[[Category:Articles with WorldCat-LCCN identifiers]]'
end
end
ifrct fromForCount= >rct 2+ then1
end
navboxParams['navbar'] = 'plain'
elseif worldcatId == '' then --if WORLDCATID suppressed
else
suppressedIdCat = '[[Category:Articles with suppressed authority control identifiers|WORLDCATID]]'
navboxParams['state'] = 'off'
end
navboxParams['navbar'] = 'off'
--configure Navbox
local outString = ''
if rct > 0 then
local Navbox = require('Module:Navbox')
local sectionID = 1
local args = { pid = 'identifiers' } -- #target the list of identifiers
if testcases and itemId then args = { pid = 'identifiers', qid = itemId } end --expensive
local pencil = frame:expandTemplate{ title = 'EditAtWikidata', args = args}
local navboxArgs = {
name = 'Authority control',
navboxclass = 'authority-control',
bodyclass = 'hlist',
state = parentArgs.state or 'autocollapse',
navbar = 'off'
}
for _, sectName in ipairs(sectionOrder) do
if #sections[sectName] ~= 0 then
navboxArgs['group'..sectionID] = sectName
navboxArgs['list'..sectionID] = table.concat(sections[sectName])
sectionID = sectionID + 1
end
end
if navboxArgs.group2 then
local mainCategories = ''
navboxArgs.title = '[[Help:Authority control|Authority control]]'..pencil
if stringArgs then
else
mainCategories = mainCategories .. ''
local sect = navboxArgs.group1
if sect == 'General' or sect == 'Other' then
-- Just say "Authority control" with no label if only general or only other IDs are present
-- since "general" is redundant and "other" is silly when there's nothing to contrast it with
navboxArgs.group1 = '[[Help:Authority control|Authority control]]'..pencil
else
navboxArgs.group1 = '[[Help:Authority control|Authority control: '..sect..']] '..pencil
end
end
outString = Navbox._navbox(navboxArgs)
if itemCount > 13 then
end
if itemCount > 30 then
itemCount = 'más de 30'
--auxCats
if rct == 0 or rct >= 25 then
if namespace == 0 or testcases then
local eCat = 'AC with '..rct..' elements'
elementsCat = '[[Category:'..eCat..']]'..p.redCatLink(eCat)
end
end
if parentArgs.state then
if namespace == 0 or testcases then
local sCat
if parentArgs.state == 'collapsed' then sCat = 'AC using state parameter: collapsed'
elseif parentArgs.state == 'expanded' then sCat = 'AC using state parameter: expanded'
elseif parentArgs.state == 'autocollapse' then sCat = 'AC using state parameter: autocollapse'
else sCat = 'AC using state parameter: other'
end
stateCat = '[[Category:'..sCat..']]'..p.redCatLink(sCat)
mainCategories = mainCategories .. ''
end
navboxParams['style'] = 'width: inherit';
return frame:extensionTag{ name = 'templatestyles', args = { src = 'Modèl:Controło de autorità/styles.css' } }
.. tostring(
mw.html.create( 'div' )
:addClass( 'mw-authority-control' )
:wikitext( Navbox._navbox( navboxParams ) )
:done()
:tag('div')
:addClass( 'mw-mf-linked-projects' )
:addClass( 'hlist' )
:newline()
:wikitext( mobileContent )
:done()
:done()
)
.. mainCategories
else
return ''
end
local auxCats = worldcatCat..elementsCat..multipleIdCat..suppressedIdCat..suppressedIdCatArts..
deprecatedIdCat..differentOnWDCat..sameOnWDCat..stateCat
if testcases then
auxCats = mw.ustring.gsub(auxCats, '(%[%[)(Category)', '%1:%2') --for easier checking
end
--out
outString = outString..auxCats
if namespace ~= 0 then
outString = mw.ustring.gsub(outString, '(%[%[)(Category:Articles)', '%1:%2') --by definition
end
return outString
end
 
Traesto fora da Wikipèdia - L'ençiclopedia łìbara e cołaboradiva in łéngua Vèneta "https://vec.wikipedia.org/wiki/Modulo:Controło_de_autorità"