<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.culturaitaliana.org/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AAuthority_control</id>
	<title>Module:Authority control - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.culturaitaliana.org/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AAuthority_control"/>
	<link rel="alternate" type="text/html" href="https://www.culturaitaliana.org/w/index.php?title=Module:Authority_control&amp;action=history"/>
	<updated>2026-04-09T14:27:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://www.culturaitaliana.org/w/index.php?title=Module:Authority_control&amp;diff=7642&amp;oldid=prev</id>
		<title>Admin: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://www.culturaitaliana.org/w/index.php?title=Module:Authority_control&amp;diff=7642&amp;oldid=prev"/>
		<updated>2020-11-05T20:02:10Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:02, 5 November 2020&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key wiki_redazione_en:diff::1.12:old-7641:rev-7642 --&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.culturaitaliana.org/w/index.php?title=Module:Authority_control&amp;diff=7641&amp;oldid=prev</id>
		<title>en&gt;Nizolan: added British Library sysnum ID</title>
		<link rel="alternate" type="text/html" href="https://www.culturaitaliana.org/w/index.php?title=Module:Authority_control&amp;diff=7641&amp;oldid=prev"/>
		<updated>2019-08-06T18:36:56Z</updated>

		<summary type="html">&lt;p&gt;added British Library sysnum ID&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;function getCatForId( id )&lt;br /&gt;
    local title = mw.title.getCurrentTitle()&lt;br /&gt;
    local namespace = title.namespace&lt;br /&gt;
    if namespace == 0 then&lt;br /&gt;
        return '[[Category:Main pages with authority control data]]'&lt;br /&gt;
    elseif namespace == 2 and not title.isSubpage then&lt;br /&gt;
        return '[[Category:User pages with ' .. id .. ' identifiers]]'&lt;br /&gt;
    elseif namespace == 100 and not title.isSubpage then&lt;br /&gt;
        return '[[Category:Portal pages with authority control data]]'&lt;br /&gt;
    elseif namespace == 102 and not title.isSubpage then&lt;br /&gt;
        return '[[Category:Author pages with authority control data]]'&lt;br /&gt;
    else&lt;br /&gt;
        return '[[Category:Miscellaneous pages with authority control data]]'&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- ** Author related authority controls follow **&lt;br /&gt;
&lt;br /&gt;
function viafLink( id )&lt;br /&gt;
    if not string.match( id, '^%d+$' ) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    return '[http://viaf.org/viaf/' .. id .. ' ' .. id .. ']' .. getCatForId( 'VIAF' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function nkcLink( id )&lt;br /&gt;
	return '[http://aleph.nkp.cz/F/?func=find-c&amp;amp;local_base=aut&amp;amp;ccl_term=ica=' .. id .. '&amp;amp;CON_LNG=ENG ' .. id .. ']' &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function nclLink( id )&lt;br /&gt;
    if not string.match( id, '^%d+$' ) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    return '[http://aleweb.ncl.edu.tw/F/?func=accref&amp;amp;acc_sequence=' .. id .. '&amp;amp;CON_LNG=ENG ' .. id .. ']' &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function ndlLink( id )&lt;br /&gt;
	return '[http://id.ndl.go.jp/auth/ndlna/' .. id .. ' ' .. id .. ']' &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function sudocLink( id )&lt;br /&gt;
    if not string.match( id, '^%d%d%d%d%d%d%d%d[%dxX]$' ) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    return '[http://www.idref.fr/' .. id .. ' ' .. id .. ']' &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function hlsLink( id )&lt;br /&gt;
    if not string.match( id, '^%d+$' ) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    return '[http://www.hls-dhs-dss.ch/textes/f/F' .. id .. '.php ' .. id .. ']'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function lirLink( id )&lt;br /&gt;
    if not string.match( id, '^%d+$' ) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    return '[http://www.e-lir.ch/e-LIR___Lexicon.' .. id .. '.450.0.html ' .. id .. ']'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function lccnLink( id )&lt;br /&gt;
    local parts = splitLccn( id )&lt;br /&gt;
    if not parts then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    id = parts[1] .. parts[2] .. append( parts[3], '0', 6 )&lt;br /&gt;
    return '[http://id.loc.gov/authorities/names/' .. id .. ' ' .. id .. ']' .. getCatForId( 'LCCN' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function splitLccn( id )&lt;br /&gt;
    if id:match( '^%l%l?%l?%d%d%d%d%d%d%d%d%d?%d?$' ) then&lt;br /&gt;
        id = id:gsub( '^(%l+)(%d+)(%d%d%d%d%d%d)$', '%1/%2/%3' )&lt;br /&gt;
    end&lt;br /&gt;
    if id:match( '^%l%l?%l?/%d%d%d?%d?/%d+$' ) then&lt;br /&gt;
         return mw.text.split( id, '/' )&lt;br /&gt;
    end&lt;br /&gt;
    return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function append(str, c, length)&lt;br /&gt;
    while str:len() &amp;lt; length do&lt;br /&gt;
        str = c .. str&lt;br /&gt;
    end&lt;br /&gt;
    return str&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function isniLink( id )&lt;br /&gt;
    id = validateIsni( id )&lt;br /&gt;
    if not id then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    return '[http://isni.org/isni/' .. id .. ' ' .. id:sub( 1, 4 ) .. ' ' .. id:sub( 5, 8 ) .. ' '  .. id:sub( 9, 12 ) .. ' '  .. id:sub( 13, 16 ) .. ']' .. getCatForId( 'ISNI' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--Validate ISNI (and ORCID) and retuns it as a 16 characters string or returns false if it's invalid&lt;br /&gt;
--See https://support.orcid.org/knowledgebase/articles/116780-structure-of-the-orcid-identifier&lt;br /&gt;
function validateIsni( id )&lt;br /&gt;
    id = id:gsub( '[ %-]', '' ):upper()&lt;br /&gt;
    if not id:match( '^%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d[%dX]$' ) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    if getIsniCheckDigit( id ) ~= string.char( id:byte( 16 ) ) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    return id&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--Returns the ISNI check digit isni must be a string where the 15 first elements are digits&lt;br /&gt;
function getIsniCheckDigit( isni )&lt;br /&gt;
    local total = 0&lt;br /&gt;
    for i = 1, 15 do&lt;br /&gt;
        local digit = isni:byte( i ) - 48 --Get integer value&lt;br /&gt;
        total = (total + digit) * 2&lt;br /&gt;
    end&lt;br /&gt;
    local remainder = total % 11&lt;br /&gt;
    local result = (12 - remainder) % 11&lt;br /&gt;
    if result == 10 then&lt;br /&gt;
        return &amp;quot;X&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    return tostring( result )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function orcidLink( id )&lt;br /&gt;
    id = validateIsni( id )&lt;br /&gt;
    if not id then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    id = id:sub( 1, 4 ) .. '-' .. id:sub( 5, 8 ) .. '-'  .. id:sub( 9, 12 ) .. '-'  .. id:sub( 13, 16 )&lt;br /&gt;
    return '[https://orcid.org/' .. id .. ' ' .. id .. ']' .. getCatForId( 'ORCID' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function gndLink( id )&lt;br /&gt;
    return '[http://d-nb.info/gnd/' .. id .. ' ' .. id .. ']' .. getCatForId( 'GND' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function BanglapediaEnglishLink( id )&lt;br /&gt;
    return '[http://en.banglapedia.org/index.php?title=' .. id .. ' ' .. id .. ']' .. getCatForId( 'Banglapedia' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function BHLcreatorID( id )&lt;br /&gt;
    return '[http://www.biodiversitylibrary.org/creator/' .. id .. ' ' .. id .. ']' .. getCatForId( 'BHL' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function MunksRollLink( id )&lt;br /&gt;
    return '[http://munksroll.rcplondon.ac.uk/Biography/Details/' .. id .. ' ' .. id .. ']' .. getCatForId( 'Munks Roll' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function selibrLink( id )&lt;br /&gt;
	if not string.match( id, '^%d+$' ) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    return '[http://libris.kb.se/auth/' .. id .. ' ' .. id .. ']' .. getCatForId( 'SELIBR' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function bnfLink( id )&lt;br /&gt;
    --Add cb prefix if it has been removed&lt;br /&gt;
    if not string.match( id, '^cb.+$' ) then&lt;br /&gt;
        id = 'cb' .. id&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return '[http://catalogue.bnf.fr/ark:/12148/' .. id .. ' ' .. id .. ']' .. getCatForId( 'BNF' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function bpnLink( id )&lt;br /&gt;
    if not string.match( id, '^%d+$' ) then&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    return '[http://www.biografischportaal.nl/persoon/' .. id .. ' ' .. id .. ']' .. getCatForId( 'BPN' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function ridLink( id )&lt;br /&gt;
    return '[http://www.researcherid.com/rid/' .. id .. ' ' .. id .. ']' .. getCatForId( 'RID' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function bibsysLink( id )&lt;br /&gt;
    return '[http://ask.bibsys.no/ask/action/result?cmd=&amp;amp;kilde=biblio&amp;amp;cql=bs.autid+%3D+' .. id .. '&amp;amp;feltselect=bs.autid ' .. id .. ']' .. getCatForId( 'BIBSYS' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function ulanLink( id )&lt;br /&gt;
    return '[http://www.getty.edu/vow/ULANFullDisplay?find=&amp;amp;role=&amp;amp;nation=&amp;amp;subjectid=' .. id .. ' ' .. id .. ']' .. getCatForId( 'ULAN' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function nlaLink( id )&lt;br /&gt;
	return '[http://nla.gov.au/anbd.aut-an' .. id .. ' ' .. id .. ']' .. getCatForId( 'NLA' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function mbLink( id )&lt;br /&gt;
    -- TODO Implement some sanity checking regex&lt;br /&gt;
    return '[//musicbrainz.org/artist/' .. id .. ' ' .. id .. ']' .. getCatForId( 'MusicBrainz' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function calisLink( id )&lt;br /&gt;
	return '[http://opac.calis.edu.cn/aopac/ajsp/detail.jsp?actionfrom=1&amp;amp;actl=CAL++' .. id .. ' ' .. id .. ']' .. getCatForId( 'CALIS' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function ciniiLink( id )&lt;br /&gt;
	return '[http://ci.nii.ac.jp/author/' .. id .. ' ' .. id .. ']' .. getCatForId( 'CiNii' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function sbnLink( id )&lt;br /&gt;
	return '[http://id.sbn.it/af/' .. id .. ' ' .. id .. ']' .. getCatForId( 'SBN' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function cbdbLink( id )&lt;br /&gt;
	return '[http://db1.ihp.sinica.edu.tw/cbdbc/cbdbkmeng?~~AAA' .. id .. ' ' .. id .. ']' .. getCatForId( 'CBDB' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function leonoreLink( id )&lt;br /&gt;
	return '[http://www.culture.gouv.fr/public/mistral/leonore_fr?ACTION=CHERCHER&amp;amp;FIELD_1=COTE&amp;amp;VALUE_1=' .. id .. ' ' .. id .. ']' .. getCatForId( 'Léonore' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function dbnlLink( id )&lt;br /&gt;
	return '[http://www.dbnl.org/auteurs/auteur.php?id=' .. id .. ' ' .. id .. ']' .. getCatForId( 'DBNL' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function rslLink( id )&lt;br /&gt;
	return '[http://aleph.rsl.ru/F?func=find-b&amp;amp;find_code=SYS&amp;amp;adjacent=Y&amp;amp;local_base=RSL11&amp;amp;request=' .. id .. ' ' .. id .. ']' .. getCatForId( 'RSL' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function ptbnpLink( id )&lt;br /&gt;
	return '[http://purl.pt/index/geral/aut/PT/' .. id .. '.html ' .. id .. ']' .. getCatForId( 'PTBNP' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function ntaLink( id )&lt;br /&gt;
	-- Nationale Thesaurus Auteursnamen, Koninklijke Bibliotheek&lt;br /&gt;
	return '[http://data.bibliotheken.nl/doc/thes/p' .. id .. ' ' .. id .. ']' .. getCatForId( 'NTA' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function bavLink( id )&lt;br /&gt;
	return id .. getCatForId( 'BAV' )&lt;br /&gt;
	-- there may not be an online catalogue for the Vatican Library (Wikidata is not currently linking to anything)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function nliLink( id )&lt;br /&gt;
	return '[http://a20.libnet.ac.il/F?func=find-b&amp;amp;REQUEST=' .. id .. '&amp;amp;find_code=SYS&amp;amp;local_base=NNL10 ' .. id .. ']' .. getCatForId( 'NLI' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function nlcLink( id )&lt;br /&gt;
	return '[http://opac.nlc.gov.cn/F/?func=accref&amp;amp;acc_sequence=' .. id .. ' ' .. id .. ']' .. getCatForId( 'NLC' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function nukatLink( id )&lt;br /&gt;
	return id .. getCatForId( 'NUKAT' )&lt;br /&gt;
	-- linking format not currently available on Wikidata and cannot find anything suitable as http://www.nukat.edu.pl/&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function botanistLink( id )&lt;br /&gt;
	id2 = mw.ustring.gsub(id, '%s', function(s) return mw.uri.encode(s, 'PATH') end)&lt;br /&gt;
    return '[http://www.ipni.org/ipni/advAuthorSearch.do?find_abbreviation=' .. id2 .. ' ' .. id .. ']' .. getCatForId( 'IPNI' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function naraIdLink( id )&lt;br /&gt;
	return '[http://research.archives.gov/person/' .. id .. ' ' .. id .. ']' .. getCatForId( 'NARA' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function ibdbLink( id )&lt;br /&gt;
	return '[http://www.ibdb.com/person.php?id=' .. id .. ' ' .. id .. ']' .. getCatForId( 'IBDB' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function isfdbIdLink( id )&lt;br /&gt;
	return '[http://www.isfdb.org/cgi-bin/ea.cgi?' .. id .. ' ' .. id .. ']' .. getCatForId( 'ISFDB' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function findGraveLink( id )&lt;br /&gt;
	return '[http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&amp;amp;GRid=' .. id .. ' ' .. id .. ']' .. getCatForId( 'Find a Grave' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function mgpLink( id )&lt;br /&gt;
	return '[http://genealogy.math.ndsu.nodak.edu/id.php?id=' .. id .. ' ' .. id .. ']' .. getCatForId( 'MGP' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function rkdLink( id )&lt;br /&gt;
	return '[http://explore.rkd.nl/nl/artists/' .. id .. ' ' .. id .. ']' .. getCatForId( 'RKD' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function bneLink( id )&lt;br /&gt;
	return '[http://catalogo.bne.es/uhtbin/authoritybrowse.cgi?action=display&amp;amp;authority_id=' .. id .. ' ' .. id .. ']' .. getCatForId( 'BNE' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function nlrLink( id )&lt;br /&gt;
	return '[http://alephnew.bibnat.ro:8991/F?func=find-b&amp;amp;request=' .. id .. '&amp;amp;find_code=SYS&amp;amp;adjacent=Y&amp;amp;local_base=NLR10 ' .. id .. ']' .. getCatForId( 'NLR' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function chLink( id )&lt;br /&gt;
	-- Catholic Hierarchy (database of bishops)&lt;br /&gt;
	return '[http://www.catholic-hierarchy.org/bishop/b' .. id .. '.html ' .. id .. ']' .. getCatForId( 'Catholic Hierarchy' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function sycomoreLink( id )&lt;br /&gt;
	return '[http://www.assemblee-nationale.fr/sycomore/fiche.asp?num_dept=' .. id .. ' ' .. id .. ']' .. getCatForId( 'Sycomore' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function uscongressLink( id )&lt;br /&gt;
    return '[http://bioguide.congress.gov/scripts/biodisplay.pl?index=' .. id .. ' ' .. id .. ']' &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function kulturnavLink( id )&lt;br /&gt;
    return '[http://kulturnav.org/language/en/' .. id .. ' id]' &lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function sikartLink( id )&lt;br /&gt;
    return '[http://www.sikart.ch/KuenstlerInnen.aspx?id=' .. id .. '&amp;amp;lng=en ' .. id .. ']' &lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function tlsLink( id )&lt;br /&gt;
	id2 = mw.ustring.gsub(id, '%s', function(s) return mw.uri.encode(s, 'WIKI') end)&lt;br /&gt;
    return '[http://tls.theaterwissenschaft.ch/wiki/' .. id2 .. ' ' .. id .. ']' &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function PrdlLink( id )&lt;br /&gt;
	return '[http://prdl.org/author_view.php?a_id=' .. id .. ' ' .. id .. ']' &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function NupillALink( id )&lt;br /&gt;
	return '[http://www.literaturabrasileira.ufsc.br/autores/?id=' .. id .. ' ' .. id .. ']' &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function MacTutorBLink( id )&lt;br /&gt;
	return '[http://www-history.mcs.st-andrews.ac.uk/Biographies/' .. id .. '.html ' .. id .. ']' &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function AtclLink( id )&lt;br /&gt;
	return '[http://www.victorianresearch.org/atcl/show_author.php?aid=' .. id .. ' ' .. id .. ']' &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function ElemLink( id )&lt;br /&gt;
	return '[http://www.elem.mx/autor/datos/' .. id .. ' ' .. id .. ']' &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function ImslpLink( id )&lt;br /&gt;
	id2 = mw.ustring.gsub(id, '%s', function(s) return mw.uri.encode(s, 'WIKI') end)&lt;br /&gt;
    return '[http://imslp.org/wiki/' .. id2 .. ' ' .. id .. ']' &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function OdnbLink( id )&lt;br /&gt;
	return '[https://doi.org/10.1093/ref:odnb/' .. id .. ' ' .. id .. ']' &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function GecLink( id )&lt;br /&gt;
	return '[http://www.enciclopedia.cat/enciclop%C3%A8dies/gran-enciclop%C3%A8dia-catalana/EC-GEC-' .. id .. '.xml ' .. id .. ']' &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- ** Subject related or general authority controls follow **&lt;br /&gt;
&lt;br /&gt;
function imdbLink( id )&lt;br /&gt;
	return '[http://www.imdb.com/Name?' .. id .. ' ' .. id .. ']' .. getCatForId( 'IMDB' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function freebaseLink( id )&lt;br /&gt;
	return '[http://www.freebase.com' .. id .. ' ' .. id .. ']' .. getCatForId( 'Freebase' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function naraOrgLink( id )&lt;br /&gt;
	return '[http://research.archives.gov/organization/' .. id .. ' ' .. id .. ']' .. getCatForId( 'NARA' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function naraGeoLink( id )&lt;br /&gt;
	return '[http://research.archives.gov/geographic-reference/' .. id .. ' ' .. id .. ']' .. getCatForId( 'NARA' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function naraSubLink( id )&lt;br /&gt;
	return '[http://research.archives.gov/topical-subject/' .. id .. ' ' .. id .. ']' .. getCatForId( 'NARA' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function naraTypeLink( id )&lt;br /&gt;
	return '[http://research.archives.gov/specific-records-type/' .. id .. ' ' .. id .. ']' .. getCatForId( 'NARA' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function isfdbPubLink( id )&lt;br /&gt;
	return '[http://www.isfdb.org/cgi-bin/publisher.cgi?' .. id .. ' ' .. id .. ']' .. getCatForId( 'ISFDB' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function isfdbConLink( id )&lt;br /&gt;
	return '[http://www.isfdb.org/cgi-bin/pl.cgi?' .. id .. ' ' .. id .. ']' .. getCatForId( 'ISFDB' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function lembpLink( id )&lt;br /&gt;
	--Lista de Encabezamientos de materia para las Bibliotecas Públicas = List of Subject Headings for Public Libraries (Spanish)&lt;br /&gt;
	return '[http://id.sgcb.mcu.es/lem/ver/Autoridades/' .. id .. '/concept ' .. id .. ']' .. getCatForId( 'LEMBP' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function ddcLink( id )&lt;br /&gt;
	return '[http://dewey.info/class/' .. id .. '/about ' .. id .. ']' .. getCatForId( 'DDC' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function libriVoxAuthorLink( id )&lt;br /&gt;
        return '[https://librivox.org/author/' .. id .. ' ' .. id .. ']' .. getCatForId( 'LVA' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function GutenbergLink( id )&lt;br /&gt;
	return '[https://www.gutenberg.org/ebooks/author/' .. id .. ' ' .. id .. ']' .. getCatForId( 'Gutenberg' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function syrBiographicalLink( id )&lt;br /&gt;
	return '[http://syriaca.org/person/' .. id .. ' ' .. id .. ']'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- ** Book and work related authority controls follow **&lt;br /&gt;
&lt;br /&gt;
function isbnLink( id )&lt;br /&gt;
	return '[[Special:BookSources/' .. id .. '|' .. id .. ']]' .. getCatForId( 'ISBN' )&lt;br /&gt;
	-- ISBN currently only reads ISBN-13 numbers from Wikidata and ignores ISBN-10 numbers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function oclcLink( id )&lt;br /&gt;
	return '[http://www.worldcat.org/oclc/' .. id .. '?lang=en ' .. id .. ']' .. getCatForId( 'OCLC' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function openLibLink( id )&lt;br /&gt;
	return '[http://openlibrary.org/books/' .. id .. ' ' .. id .. ']' .. getCatForId( 'Open Library' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function libraryThingLink( id )&lt;br /&gt;
	return '[http://www.librarything.com/work/' .. id .. ' ' .. id .. ']' .. getCatForId( 'LibraryThing' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function archiveLink( id )&lt;br /&gt;
	return '[http://www.archive.org/details/' .. id .. ' ' .. id .. ']' .. getCatForId( 'Internet Archive' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function gutenbergebookLink( id )&lt;br /&gt;
	return '[http://www.gutenberg.org/ebooks/' .. id .. ' ' .. id .. ']' .. getCatForId( 'Project Gutenberg' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function europeanaLink( id )&lt;br /&gt;
	return '[http://www.europeana.eu/portal/record/' .. id .. '.html ' .. id .. ']' .. getCatForId( 'Europeana' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function lccnBibliographicLink( id )&lt;br /&gt;
	return '[http://lccn.loc.gov/' .. id .. ' ' .. id .. ']' .. getCatForId( 'LCCN (bibliographic)' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function googleBooksLink( id )&lt;br /&gt;
	return '[http://books.google.com/books?id=' .. id .. ' ' .. id .. ']' .. getCatForId( 'Google Books' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function ndlBibliographicLink( id )&lt;br /&gt;
	return '[http://iss.ndl.go.jp/books?op_id=1&amp;amp;any=' .. id .. ' ' .. id .. ']' .. getCatForId( 'NDL (bibliographic)' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function issnLink( id )&lt;br /&gt;
	return '[http://www.worldcat.org/search?fq=x0:jrnl&amp;amp;q=n2:' .. id .. ' ' .. id .. ']' .. getCatForId( 'ISSN' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function doiLink( id )&lt;br /&gt;
	return '[http://dx.doi.org/' .. id .. ' ' .. id .. ']' .. getCatForId( 'DOI' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function eraLink( id )&lt;br /&gt;
	return '[http://lamp.infosys.deakin.edu.au/era/?page=jnamedet12f&amp;amp;eraid=' .. id .. ' ' .. id .. ']' .. getCatForId( 'ERA' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function ismnLink( id )&lt;br /&gt;
	return id .. getCatForId( 'ISMN' )&lt;br /&gt;
	-- no link currently available for ISMN on Wikidata and none found elsewhere&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function isfdbBookLink( id )&lt;br /&gt;
	return '[http://www.isfdb.org/cgi-bin/title.cgi?' .. id .. ' ' .. id .. ']' .. getCatForId( 'ISFDB' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function isfdbSerLink( id )&lt;br /&gt;
	return '[http://www.isfdb.org/cgi-bin/pe.cgi?' .. id .. ' ' .. id .. ']' .. getCatForId( 'ISFDB' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function sudocBibliographicLink( id )&lt;br /&gt;
	return '[http://www.sudoc.fr/' .. id .. ' ' .. id .. ']' .. getCatForId( 'SUDOC' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function swbLink( id )&lt;br /&gt;
	-- South-West German Library Network&lt;br /&gt;
	return '[http://swb.bsz-bw.de/DB=2.1/PPNSET?PPN=' .. id .. '&amp;amp;INDEXSET=1 ' .. id .. ']' .. getCatForId( 'SWB' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function zdbLink( id )&lt;br /&gt;
	-- Zeitschriftendatenbank&lt;br /&gt;
	return '[http://dispatch.opac.d-nb.de/DB=1.1/CMD?ACT=SRCHA&amp;amp;IKT=8506&amp;amp;TRM=' .. id .. ' ' .. id .. ']' .. getCatForId( 'ZDB' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function nlmLink( id )&lt;br /&gt;
	return '[http://locatorplus.gov/cgi-bin/Pwebrecon.cgi?DB=local&amp;amp;v1=1&amp;amp;ti=1,1&amp;amp;Search_Arg=' .. id .. '&amp;amp;Search_Code=0359&amp;amp;CNT=20&amp;amp;SID=1 ' ..id .. ']' .. getCatForId( 'NLM' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function selibrBibliographicLink( id )&lt;br /&gt;
	return '[http://libris.kb.se/bib/' .. id .. ' ' .. id .. ']' .. getCatForId( 'SELIBR' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function dliLink( id )&lt;br /&gt;
	return '[http://dli.gov.in/cgi-bin/DBscripts/allmetainfo.cgi?barcode=' .. id .. ' ' .. id .. ']' .. getCatForId( 'DLI' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function hathitrustLink( id )&lt;br /&gt;
	return '[http://catalog.hathitrust.org/Record/' .. id .. ' ' .. id .. ']' .. getCatForId( 'HathiTrust' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function blSysnumLink( id )&lt;br /&gt;
	return '[http://explore.bl.uk/BLVU1:LSCOP-ALL:BLL01' .. id .. ' ' .. id .. ']' .. getCatForId( 'BL' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Entry for Wikisource using 'wgArticleID' as an authority. Should always be last&lt;br /&gt;
&lt;br /&gt;
function wksLink( id )&lt;br /&gt;
    if id and wksid ~= '' then&lt;br /&gt;
	return false&lt;br /&gt;
    end&lt;br /&gt;
    return '[//en.wikisource.org/w/index.php?curid=' .. id .. ' ' .. id .. ']' .. getCatForId( 'WKS' )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- End of authority control link formatting functions&lt;br /&gt;
&lt;br /&gt;
function getIdsFromWikidata( item, property )&lt;br /&gt;
    local ids = {}&lt;br /&gt;
    if not item.claims[property] then&lt;br /&gt;
        return ids&lt;br /&gt;
    end&lt;br /&gt;
    for _, statement in pairs( item:getBestStatements( property ) ) do&lt;br /&gt;
		if statement.mainsnak.datavalue then&lt;br /&gt;
			table.insert( ids, statement.mainsnak.datavalue.value )&lt;br /&gt;
		end&lt;br /&gt;
    end&lt;br /&gt;
    return ids&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function matchesWikidataRequirements( item, reqs )&lt;br /&gt;
    for _, group in pairs( reqs ) do&lt;br /&gt;
        local property = 'p' .. group[1]&lt;br /&gt;
        local qid = group[2]&lt;br /&gt;
        if item.claims[property] ~= nil then&lt;br /&gt;
            for _, statement in pairs ( item.claims[property] ) do&lt;br /&gt;
            	if statement.mainsnak.datavalue ~= nil then&lt;br /&gt;
	                if statement.mainsnak.datavalue.value['numeric-id'] == qid then&lt;br /&gt;
    	                return true&lt;br /&gt;
        	        end&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function createRow( id, label, rawValue, link, withUid )&lt;br /&gt;
    if link then&lt;br /&gt;
        if withUid then&lt;br /&gt;
            return '* ' .. label .. '&amp;amp;#160;&amp;lt;span class=&amp;quot;uid plainlinks&amp;quot;&amp;gt;' .. link .. '&amp;lt;/span&amp;gt;\n'&lt;br /&gt;
        else&lt;br /&gt;
            return '* ' .. label .. '&amp;amp;#160;&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;' .. link .. '&amp;lt;/span&amp;gt;\n'&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        return '* &amp;lt;span class=&amp;quot;error&amp;quot;&amp;gt;The ' .. id .. ' id ' .. rawValue .. ' is not valid.&amp;lt;/span&amp;gt;[[Category:Wikisource articles with faulty authority control identifiers]]\n'&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- *** List of displayed authority control IDs ***&lt;br /&gt;
-- Authority controls will appear in the same order as the list below&lt;br /&gt;
--In this order: { name of the parameter, label, propertyId in Wikidata, formatting function },&lt;br /&gt;
local conf = {&lt;br /&gt;
    { 'VIAF', '[[w:Virtual International Authority File|VIAF]]', 214, viafLink },&lt;br /&gt;
    { 'LCCN', '[[w:Library of Congress Control Number|LCCN]]', 244, lccnLink },&lt;br /&gt;
    { 'ISNI', '[[w:International Standard Name Identifier|ISNI]]', 213, isniLink },&lt;br /&gt;
    { 'ORCID', '[[w:ORCID|ORCID]]', 496, orcidLink },&lt;br /&gt;
    { 'GND', '[[w:Integrated Authority File|GND]]', 227, gndLink },&lt;br /&gt;
    { 'Banglapedia', '[[w:Banglapedia|Banglapedia]]', 4255, BanglapediaEnglishLink },&lt;br /&gt;
    { 'BHL', '[[w:Biodiversity Heritage Library|BHL]]', 4081, BHLcreatorID },&lt;br /&gt;
    { 'Munks Roll', '[[w:Munk%27s_Roll|Munks Roll]]', 2941, MunksRollLink },&lt;br /&gt;
    { 'SELIBR', '[[w:LIBRIS|SELIBR]]', 906, selibrLink },&lt;br /&gt;
    { 'SUDOC', '[[w:Système universitaire de documentation|SUDOC]]', 269, sudocLink },&lt;br /&gt;
    { 'BNF', '[[w:Bibliothèque nationale de France|BNF]]', 268, bnfLink },&lt;br /&gt;
    { 'BPN', '[[w:Biografisch Portaal|BPN]]', 651, bpnLink },&lt;br /&gt;
    { 'RID', '[[w:ResearcherID|ResearcherID]]', 1053, ridLink },&lt;br /&gt;
    { 'BIBSYS', '[[w:BIBSYS|BIBSYS]]', 1015, bibsysLink },&lt;br /&gt;
    { 'BL', '[[w:British Library|BL]]', 5199, blSysnumLink },&lt;br /&gt;
    { 'ULAN', '[[w:Union List of Artist Names|ULAN]]', 245, ulanLink },&lt;br /&gt;
    { 'HDS', '[[w:Historical Dictionary of Switzerland|HDS]]', 902, hlsLink },&lt;br /&gt;
    { 'LIR', '[[w:Historical Dictionary of Switzerland#Lexicon_Istoric_Retic|LIR]]', 886, lirLink },&lt;br /&gt;
    { 'MBA', '[[w:MusicBrainz|MusicBrainz]]', 434, mbLink },&lt;br /&gt;
    { 'NLA', '[[w:National Library of Australia|NLA]]', 409, nlaLink },&lt;br /&gt;
    { 'NDL', '[[w:National Diet Library|NDL]]', 349, ndlLink },&lt;br /&gt;
    { 'NCL', '[[w:National Central Library|NCL]]', 1048, nclLink },&lt;br /&gt;
    { 'NKC', '[[w:National Library of the Czech Republic|NKC]]', 691, nkcLink },&lt;br /&gt;
    { 'CALIS', 'CALIS', 270, calisLink },&lt;br /&gt;
    { 'CiNii', '[[w:CiNii|CiNii]]', 271, ciniiLink },&lt;br /&gt;
    { 'SBN', '[[w:Istituto Centrale per il Catalogo Unico|SBN]]', 396, sbnLink },&lt;br /&gt;
    { 'CBDB', 'CBDB', 497, cbdbLink },&lt;br /&gt;
    { 'Leonore', '[[w:Legion of Honour|Léonore]]', 640, leonoreLink },&lt;br /&gt;
    { 'DBNL', '[[w:Digital Library for Dutch Literature|DBNL]]', 723, dbnlLink },&lt;br /&gt;
    { 'RSL', '[[w:Russian State Library|RSL]]', 947, rslLink },&lt;br /&gt;
    { 'PTBNP', '[[w:Biblioteca Nacional de Portugal|PTBNP]]', 1005, ptbnpLink },&lt;br /&gt;
    { 'NTA', 'NTA', 1006, ntaLink },&lt;br /&gt;
    { 'BAV', '[[w:Vatican Library|BAV]]', 1017, bavLink },&lt;br /&gt;
    { 'NLI', '[[w:National Library of Israel|NLI]]', 949, nliLink },&lt;br /&gt;
    { 'NLC', '[[w:National Library of China|NLC]]', 1213, nlcLink },&lt;br /&gt;
    { 'NUKAT', 'NUKAT', 1207, nukatLink },&lt;br /&gt;
    { 'Botanist', '[[w:International Plant Names Index|Botanist]]', 428, botanistLink },&lt;br /&gt;
    { 'NARAid', '[[w:National Archives and Records Administration|NARA]]', 1222, naraIdLink },&lt;br /&gt;
    { 'IBDB', '[[w:Internet Broadway Database|IBDB]]', 1220, ibdbLink },&lt;br /&gt;
    { 'ISFDB', '[[w:Internet Speculative Fiction Database|ISFDB]]', 1233, isfdbIdLink },&lt;br /&gt;
    { 'LibriVoxAuth', '[[w:LibriVox|LibriVox]]', 1899, libriVoxAuthorLink },&lt;br /&gt;
    { 'Gutenberg', '[[w:Project Gutenberg|Project Gutenberg]]', 1938, GutenbergLink },&lt;br /&gt;
    { 'SBD', '[[w:Syriac Biographical Dictionary|SBD]]', 6934, syrBiographicalLink },&lt;br /&gt;
    { 'Grave', '[[w:Find a Grave|Find a Grave]]', 535, findGraveLink },&lt;br /&gt;
    { 'MGP', '[[w:Mathematics Genealogy Project|MGP]]', 549, mgpLink },&lt;br /&gt;
    { 'RKD', '[[w:Netherlands Institute for Art History|RKD]]', 650, rkdLink },&lt;br /&gt;
    { 'BNE', '[[w:Biblioteca Nacional de España|BNE]]', 950, bneLink },&lt;br /&gt;
    { 'NLR', '[[w:National Library of Romania|NLR]]', 1003, nlrLink },&lt;br /&gt;
    { 'Sycomore', '[[w:National Assembly (France)|Sycomore]]', 1045, sycomoreLink },&lt;br /&gt;
    { 'CH', '[[w:Hierarchy of the Catholic Church|CH]]', 1047, chLink },&lt;br /&gt;
    { 'USCongress', '[[w:Biographical Directory of the United States Congress|US Congress]]', 1157, uscongressLink },&lt;br /&gt;
    { 'TLS', '[[w:Theaterlexikon der Schweiz|TLS]]', 1362, tlsLink },&lt;br /&gt;
    { 'SIKART', '[[w:SIKART|SIKART]]', 781, sikartLink },&lt;br /&gt;
    { 'KULTURNAV', 'KulturNav', 1248, kulturnavLink },&lt;br /&gt;
    { 'LCCNbook', '[[w:Library of Congress Control Number|LCCN]]', 1144, lccnBibliographicLink },&lt;br /&gt;
    { 'OCLC', '[[w:OCLC|OCLC]]', 243, oclcLink },&lt;br /&gt;
    { 'ISBN', '[[w:International Standard Book Number|ISBN]]', 212, isbnLink },&lt;br /&gt;
    { 'NDLbook', '[[w:National Diet Library|NDL]]', 1054, ndlBibliographicLink },&lt;br /&gt;
    { 'ISSN', '[[w:International Standard Serial Number|ISSN]]', 236, issnLink },&lt;br /&gt;
    { 'DOI', '[[w:Digital object identifier|DOI]]', 356, doiLink },&lt;br /&gt;
    { 'ERA', 'ERA', 1058, eraLink },&lt;br /&gt;
    { 'ISMN', '[[w:International Standard Music Number|ISMN]]', 1208, ismnLink },&lt;br /&gt;
    { 'SUDOCbook', '[[w:Système universitaire de documentation|SUDOC]]', 1025, sudocBibliographicLink },&lt;br /&gt;
    { 'ZDB', 'ZDB', 1042, zdbLink },&lt;br /&gt;
    { 'SWB', 'SWB', 1044, swbLink },&lt;br /&gt;
    { 'NLM', '[[w:United States National Library of Medicine|NLM]]', 1055, nlmLink },&lt;br /&gt;
    { 'SELIBRbook', '[[w:LIBRIS|SELIBR]]', 1182, selibrBibliographicLink },&lt;br /&gt;
    { 'ISFDBser', '[[w:Internet Speculative Fiction Database|ISFDB]]', 1235, isfdbSerLink },&lt;br /&gt;
    { 'ISFDBcon', '[[w:Internet Speculative Fiction Database|ISFDB]]', 1234, isfdbConLink },&lt;br /&gt;
    { 'OL', '[[w:Open Library|Open Library]]', 648, openLibLink },&lt;br /&gt;
    { 'ARCHIVE', '[[w:Internet Archive|Internet Archive]]', 724, archiveLink },&lt;br /&gt;
    { 'Gutenbergebook', '[[w:Project Gutenberg|Project Gutenberg]]', 2034, gutenbergebookLink },&lt;br /&gt;
    { 'DLI', '[[w:Digital Library of India|Digital Library of India]]', 2185, dliLink },&lt;br /&gt;
    { 'HathiTrust', '[[w:HathiTrust|HathiTrust]]', 1844, hathitrustLink },&lt;br /&gt;
    { 'Google', '[[w:Google Books|Google]]', 675, googleBooksLink },&lt;br /&gt;
    { 'Europeana', '[[w:Europeana|Europeana]]', 727, europeanaLink },&lt;br /&gt;
    { 'LT', '[[w:LibraryThing|LibraryThing]]', 1085, libraryThingLink },&lt;br /&gt;
    { 'Dewey', '[[w:Dewey Decimal Classification|Dewey]]', 1036, ddcLink },&lt;br /&gt;
    { 'NARAorg', '[[w:National Archives and Records Administration|NARA]]', 1223, naraOrgLink },&lt;br /&gt;
    { 'NARAgeo', '[[w:National Archives and Records Administration|NARA]]', 1224, naraGeoLink },&lt;br /&gt;
    { 'NARAsub', '[[w:National Archives and Records Administration|NARA]]', 1225, naraSubLink },&lt;br /&gt;
    { 'NARAtype', '[[w:National Archives and Records Administration|NARA]]', 1226, naraTypeLink },&lt;br /&gt;
    { 'ISFDBpub', '[[w:Internet Speculative Fiction Database|ISFDB]]', 1239, isfdbPubLink },&lt;br /&gt;
    { 'LEMBP', 'LEMBP', 920, lembpLink },&lt;br /&gt;
    { 'IMDB', '[[w:Internet Movie Database|IMDB]]', 345, imdbLink },&lt;br /&gt;
    { 'Freebase', '[[w:Freebase|Freebase]]', 646, freebaseLink },&lt;br /&gt;
    { 'PRDL', '[[w:Post-Reformation Digital Library|PRDL]]', 1463, PrdlLink },&lt;br /&gt;
    { 'NUPILL-A', 'NUPILL', 1473, NupillALink },&lt;br /&gt;
    { 'MacTutorB', '[[w:MacTutor History of Mathematics archive|MacTutor]]', 1563, MacTutorBLink },&lt;br /&gt;
    { 'ATCL', 'ATCL', 1564, AtclLink },&lt;br /&gt;
    { 'ELeM', 'ELeM', 1565, ElemLink },&lt;br /&gt;
    { 'Imslp', '[[w:International Music Score Library Project|IMSLP]]', 839, ImslpLink },&lt;br /&gt;
	{ 'Odnb', '[[w:Oxford Dictionary of National Biography|ODNB]]', 1415, OdnbLink },&lt;br /&gt;
    { 'Gec', '[[w:Gran Enciclopèdia Catalana|GEC]]', 1296, GecLink },	&lt;br /&gt;
    { 'WKS', '[[Wikisource:Authority control|English Wikisource]]', 0, wksLink },&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-- Check that the Wikidata item has this property--&amp;gt;value before adding it&lt;br /&gt;
local reqs = {}&lt;br /&gt;
reqs['MBA'] = {&lt;br /&gt;
    { 106, 177220 }, -- occupation -&amp;gt; singer&lt;br /&gt;
    { 31, 177220 }, -- instance of -&amp;gt; singer&lt;br /&gt;
    { 106, 13385019 }, -- occupation -&amp;gt; rapper&lt;br /&gt;
    { 31, 13385019 }, -- instance of -&amp;gt; rapper&lt;br /&gt;
    { 106, 639669 }, -- occupation -&amp;gt; musician&lt;br /&gt;
    { 31, 639669 }, -- instance of -&amp;gt; musician&lt;br /&gt;
    { 106, 36834 }, -- occupation -&amp;gt; composer&lt;br /&gt;
    { 31, 36834 }, -- instance of -&amp;gt; composer&lt;br /&gt;
    { 106, 488205 }, -- occupation -&amp;gt; singer-songwriter&lt;br /&gt;
    { 31, 488205 }, -- instance of -&amp;gt; singer-songwriter&lt;br /&gt;
    { 106, 183945 }, -- occupation -&amp;gt; record producer&lt;br /&gt;
    { 31, 183945 }, -- instance of -&amp;gt; record producer&lt;br /&gt;
    { 106, 10816969 }, -- occupation -&amp;gt; club DJ&lt;br /&gt;
    { 31, 10816969 }, -- instance of -&amp;gt; club DJ&lt;br /&gt;
    { 106, 130857 }, -- occupation -&amp;gt; DJ&lt;br /&gt;
    { 31, 130857 }, -- instance of -&amp;gt; DJ&lt;br /&gt;
    { 106, 158852 }, -- occupation -&amp;gt; conductor&lt;br /&gt;
    { 31, 158852 }, -- instance of -&amp;gt; conductor&lt;br /&gt;
    { 31, 215380 }, -- instance of -&amp;gt; band &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.authorityControl( frame )&lt;br /&gt;
    local parentArgs = frame:getParent().args&lt;br /&gt;
    local wksid = frame.args.wksid&lt;br /&gt;
    --Create rows&lt;br /&gt;
    local elements = {}&lt;br /&gt;
&lt;br /&gt;
    --redirect PND to GND&lt;br /&gt;
    if (parentArgs.GND == nil or parentArgs.GND == '') and parentArgs.PND ~= nil and parentArgs.PND ~= '' then&lt;br /&gt;
        parentArgs.GND = parentArgs.PND&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
	--en.wikisource backwards compatibility&lt;br /&gt;
	--redirect LCCNid to LCCN&lt;br /&gt;
    if (parentArgs.LCCN == nil or parentArgs.LCCN == '') and parentArgs.LCCNid ~= nil and parentArgs.LCCNid ~= '' then&lt;br /&gt;
        parentArgs.LCCN = parentArgs.LCCNid&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    --Wikidata fallback if requested&lt;br /&gt;
    local item = mw.wikibase.getEntityObject()&lt;br /&gt;
    if item ~= nil and item.claims ~= nil then&lt;br /&gt;
        for _, params in pairs( conf ) do&lt;br /&gt;
            if params[3] ~= 0 then&lt;br /&gt;
                local val = parentArgs[params[1]]&lt;br /&gt;
                if not val or val == '' then&lt;br /&gt;
                	local canUseWikidata = nil&lt;br /&gt;
                    if reqs[params[1]] ~= nil then&lt;br /&gt;
                        canUseWikidata = matchesWikidataRequirements( item, reqs[params[1]] )&lt;br /&gt;
                    else&lt;br /&gt;
                        canUseWikidata = true&lt;br /&gt;
                    end&lt;br /&gt;
                    if canUseWikidata then&lt;br /&gt;
                        local wikidataIds = getIdsFromWikidata( item, 'P' .. params[3] )&lt;br /&gt;
                        if wikidataIds[1] then&lt;br /&gt;
                            parentArgs[params[1]] = wikidataIds[1]&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    --Configured rows&lt;br /&gt;
    local rct = 0&lt;br /&gt;
    for k, params in pairs( conf ) do&lt;br /&gt;
        local val = parentArgs[params[1]]&lt;br /&gt;
        if val and val ~= '' then&lt;br /&gt;
            table.insert( elements, createRow( params[1], params[2] .. ':', val, params[4]( val ), true ) )&lt;br /&gt;
            rct = rct + 1&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    --Wikisource self reference&lt;br /&gt;
    if wksid and wksid ~= '' then&lt;br /&gt;
        table.insert( elements, createRow( 'wksid', '', wksid, '[[Wikisource:Authority control|English Wikisource]]: [//en.wikisource.org/w/index.php?curid=' .. wksid .. ' ' .. wksid .. ']', true ) )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    --WorldCat&lt;br /&gt;
    if parentArgs['WORLDCATID'] and parentArgs['WORLDCATID'] ~= '' then&lt;br /&gt;
        table.insert( elements, createRow( 'WORLDCATID', '', parentArgs['WORLDCATID'], '[http://www.worldcat.org/identities/' .. parentArgs['WORLDCATID'] .. ' WorldCat]', false ) ) --Validation?&lt;br /&gt;
    elseif parentArgs['LCCN'] and parentArgs['LCCN'] ~= '' then&lt;br /&gt;
        local lccnParts = splitLccn( parentArgs['LCCN'] )&lt;br /&gt;
        if lccnParts then&lt;br /&gt;
            table.insert( elements, createRow( 'LCCN', '', parentArgs['LCCN'], '[http://www.worldcat.org/identities/lccn-' .. lccnParts[1] .. lccnParts[2] .. '-' .. lccnParts[3] .. ' WorldCat]', false ) )&lt;br /&gt;
        end&lt;br /&gt;
    elseif parentArgs['VIAF'] and parentArgs['VIAF'] ~= '' then&lt;br /&gt;
    	table.insert( elements, createRow( 'VIAF', '', parentArgs['VIAF'], '[http://www.worldcat.org/identities/viaf-' .. parentArgs['VIAF'] .. ' WorldCat]', false ) )&lt;br /&gt;
    elseif parentArgs['OCLC'] and parentArgs['OCLC'] ~= '' then&lt;br /&gt;
    	table.insert( elements, createRow( 'OCLC', '', parentArgs['OCLC'], '[http://www.worldcat.org/oclc/' .. parentArgs['OCLC'] .. ' WorldCat]', false ) )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local Navbox = require('Module:Navbox')&lt;br /&gt;
    local elementscats = ''&lt;br /&gt;
    return Navbox._navbox( {&lt;br /&gt;
        name  = 'Authority control',&lt;br /&gt;
        bodyclass = 'hlist',&lt;br /&gt;
        wrapclass = 'acContainer',&lt;br /&gt;
        group1 = '[[Wikisource:Authority control|Authority control]]' .. elementscats,&lt;br /&gt;
        list1 = table.concat( elements )&lt;br /&gt;
    } )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>en&gt;Nizolan</name></author>
	</entry>
</feed>