<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.americangovsim.com/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://wiki.americangovsim.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AAuthority_control"/>
	<link rel="alternate" type="text/html" href="https://wiki.americangovsim.com/index.php?title=Module:Authority_control&amp;action=history"/>
	<updated>2026-04-21T23:58:34Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.0</generator>
	<entry>
		<id>https://wiki.americangovsim.com/index.php?title=Module:Authority_control&amp;diff=226&amp;oldid=prev</id>
		<title>PirateCody: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.americangovsim.com/index.php?title=Module:Authority_control&amp;diff=226&amp;oldid=prev"/>
		<updated>2018-04-03T18:11:47Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require(&amp;#039;Module:No globals&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local 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 &amp;#039;[[Category:Wikipedia articles with &amp;#039; .. id .. &amp;#039; identifiers]]&amp;#039;&lt;br /&gt;
	elseif namespace == 2 and not title.isSubpage then&lt;br /&gt;
		return &amp;#039;[[Category:User pages with &amp;#039; .. id .. &amp;#039; identifiers]]&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;[[Category:Miscellaneous pages with &amp;#039; .. id .. &amp;#039; identifiers]]&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function viafLink( id )&lt;br /&gt;
	if not string.match( id, &amp;#039;^%d+$&amp;#039; ) then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;[https://viaf.org/viaf/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039; .. getCatForId( &amp;#039;VIAF&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function kulturnavLink( id )&lt;br /&gt;
	return &amp;#039;[http://kulturnav.org/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function sikartLink( id )&lt;br /&gt;
	return &amp;#039;[http://www.sikart.ch/KuenstlerInnen.aspx?id=&amp;#039; .. id .. &amp;#039;&amp;amp;lng=en &amp;#039; .. id .. &amp;#039;]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function tlsLink( id )&lt;br /&gt;
	local id2 = id:gsub(&amp;#039; +&amp;#039;, &amp;#039;_&amp;#039;)&lt;br /&gt;
	return &amp;#039;[http://tls.theaterwissenschaft.ch/wiki/&amp;#039; .. id2 .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function ciniiLink( id )&lt;br /&gt;
	return &amp;#039;[http://ci.nii.ac.jp/author/&amp;#039; .. id .. &amp;#039;?l=en &amp;#039; .. id .. &amp;#039;]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function bneLink( id )&lt;br /&gt;
	return &amp;#039;[http://catalogo.bne.es/uhtbin/authoritybrowse.cgi?action=display&amp;amp;authority_id=&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function uscongressLink( id )&lt;br /&gt;
	return &amp;#039;[http://bioguide.congress.gov/scripts/biodisplay.pl?index=&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function narapersonLink( id )&lt;br /&gt;
	return &amp;#039;[https://research.archives.gov/person/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function naraorganizationLink( id )&lt;br /&gt;
	return &amp;#039;[https://research.archives.gov/organization/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function botanistLink( id )&lt;br /&gt;
	local id2 = id:gsub(&amp;#039; +&amp;#039;, &amp;#039;%%20&amp;#039;)&lt;br /&gt;
	return &amp;#039;[http://www.ipni.org/ipni/advAuthorSearch.do?find_abbreviation=&amp;#039; .. id2 .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function mgpLink( id )&lt;br /&gt;
	-- TODO Implement some sanity checking regex&lt;br /&gt;
	return &amp;#039;[http://www.genealogy.ams.org/id.php?id=&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function rslLink( id )&lt;br /&gt;
	-- TODO Implement some sanity checking regex&lt;br /&gt;
	return &amp;#039;[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=&amp;#039; .. id .. &amp;#039;&amp;amp;CON_LNG=ENG &amp;#039; .. id .. &amp;#039;]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function leonoreLink( id )&lt;br /&gt;
-- Identifiants allant de LH/1/1 à LH/2794/54 (légionnaires)&lt;br /&gt;
-- Identifiants allant de C/0/1 à C/0/84 (84 légionnaires célèbres)&lt;br /&gt;
-- Identifiants allant de 19800035/1/1 à 19800035/385/51670 (légionnaires décédés entre 1954 et 1977, et quelques dossiers de légionnaires décédés avant 1954)&lt;br /&gt;
	if not string.match( id, &amp;#039;^LH/%d%d?%d?%d?/%d%d?%d?$&amp;#039; ) and&lt;br /&gt;
	   not string.match( id, &amp;#039;^C/0/%d%d?$&amp;#039; ) and&lt;br /&gt;
	   not string.match( id, &amp;#039;^19800035/%d%d?%d?%d?/%d%d?%d?%d?%d?$&amp;#039; ) then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;[http://www.culture.gouv.fr/public/mistral/leonore_fr?ACTION=CHERCHER&amp;amp;FIELD_1=COTE&amp;amp;VALUE_1=&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function sbnLink( id )&lt;br /&gt;
	if not string.match( id, &amp;#039;^IT\\ICCU\\%d%d%d%d%d%d%d%d%d%d$&amp;#039; ) and not string.match( id, &amp;#039;^IT\\ICCU\\%u%u[%d%u]%u\\%d%d%d%d%d%d$&amp;#039; ) then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;[http://opac.sbn.it/opacsbn/opac/iccu/scheda_authority.jsp?bid=&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039; .. getCatForId( &amp;#039;SBN&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function nkcLink( id )&lt;br /&gt;
	return &amp;#039;[http://aleph.nkp.cz/F/?func=find-c&amp;amp;local_base=aut&amp;amp;ccl_term=ica=&amp;#039; .. id .. &amp;#039;&amp;amp;CON_LNG=ENG &amp;#039; .. id .. &amp;#039;]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function nclLink( id )&lt;br /&gt;
	if not string.match( id, &amp;#039;^%d+$&amp;#039; ) then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;[http://aleweb.ncl.edu.tw/F/?func=accref&amp;amp;acc_sequence=&amp;#039; .. id .. &amp;#039;&amp;amp;CON_LNG=ENG &amp;#039; .. id .. &amp;#039;]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function ndlLink( id )&lt;br /&gt;
	return &amp;#039;[https://id.ndl.go.jp/auth/ndlna/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function sudocLink( id )&lt;br /&gt;
	if not string.match( id, &amp;#039;^%d%d%d%d%d%d%d%d[%dxX]$&amp;#039; ) then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;[https://www.idref.fr/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function hlsLink( id )&lt;br /&gt;
	if not string.match( id, &amp;#039;^%d+$&amp;#039; ) then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;[http://www.hls-dhs-dss.ch/textes/f/F&amp;#039; .. id .. &amp;#039;.php &amp;#039; .. id .. &amp;#039;]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function lirLink( id )&lt;br /&gt;
	if not string.match( id, &amp;#039;^%d+$&amp;#039; ) then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;[http://www.e-lir.ch/e-LIR___Lexicon.&amp;#039; .. id .. &amp;#039;.450.0.html &amp;#039; .. id .. &amp;#039;]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function splitLccn( id )&lt;br /&gt;
	if id:match( &amp;#039;^%l%l?%l?%d%d%d%d%d%d%d%d%d?%d?$&amp;#039; ) then&lt;br /&gt;
		id = id:gsub( &amp;#039;^(%l+)(%d+)(%d%d%d%d%d%d)$&amp;#039;, &amp;#039;%1/%2/%3&amp;#039; )&lt;br /&gt;
	end&lt;br /&gt;
	if id:match( &amp;#039;^%l%l?%l?/%d%d%d?%d?/%d+$&amp;#039; ) then&lt;br /&gt;
		return mw.text.split( id, &amp;#039;/&amp;#039; )&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local 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;
local 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;
	local lccnType = parts[1] ~= &amp;#039;sh&amp;#039; and &amp;#039;names&amp;#039; or &amp;#039;subjects&amp;#039;&lt;br /&gt;
	id = parts[1] .. parts[2] .. append( parts[3], &amp;#039;0&amp;#039;, 6 )&lt;br /&gt;
	return &amp;#039;[http://id.loc.gov/authorities/&amp;#039; .. lccnType .. &amp;#039;/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039; .. getCatForId( &amp;#039;LCCN&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function mbLink( id )&lt;br /&gt;
	-- TODO Implement some sanity checking regex&lt;br /&gt;
	return &amp;#039;[https://musicbrainz.org/artist/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039; .. getCatForId( &amp;#039;MusicBrainz&amp;#039; )&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;
local 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;
--Validate ISNI (and ORCID) and retuns it as a 16 characters string or returns false if it&amp;#039;s invalid&lt;br /&gt;
--See http://support.orcid.org/knowledgebase/articles/116780-structure-of-the-orcid-identifier&lt;br /&gt;
local function validateIsni( id )&lt;br /&gt;
	id = id:gsub( &amp;#039;[ %-]&amp;#039;, &amp;#039;&amp;#039; ):upper()&lt;br /&gt;
	if not id:match( &amp;#039;^%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d[%dX]$&amp;#039; ) 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;
local 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 &amp;#039;[http://isni.org/isni/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id:sub( 1, 4 ) .. &amp;#039; &amp;#039; .. id:sub( 5, 8 ) .. &amp;#039; &amp;#039;  .. id:sub( 9, 12 ) .. &amp;#039; &amp;#039;  .. id:sub( 13, 16 ) .. &amp;#039;]&amp;#039; .. getCatForId( &amp;#039;ISNI&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local 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 ) .. &amp;#039;-&amp;#039; .. id:sub( 5, 8 ) .. &amp;#039;-&amp;#039;  .. id:sub( 9, 12 ) .. &amp;#039;-&amp;#039;  .. id:sub( 13, 16 )&lt;br /&gt;
	return &amp;#039;[https://orcid.org/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039; .. getCatForId( &amp;#039;ORCID&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function gndLink( id )&lt;br /&gt;
	return &amp;#039;[https://d-nb.info/gnd/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039; .. getCatForId( &amp;#039;GND&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function selibrLink( id )&lt;br /&gt;
	if not string.match( id, &amp;#039;^%d+$&amp;#039; ) then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;[https://libris.kb.se/auth/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039; .. getCatForId( &amp;#039;SELIBR&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function bnfLink( id )&lt;br /&gt;
	--Add cb prefix if it has been removed&lt;br /&gt;
	if not string.match( id, &amp;#039;^cb.+$&amp;#039; ) then&lt;br /&gt;
		id = &amp;#039;cb&amp;#039; .. id&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return &amp;#039;[http://catalogue.bnf.fr/ark:/12148/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;] [http://data.bnf.fr/ark:/12148/&amp;#039; .. id .. &amp;#039; (data)]&amp;#039; .. getCatForId( &amp;#039;BNF&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function bpnLink( id )&lt;br /&gt;
	if not string.match( id, &amp;#039;^%d+$&amp;#039; ) then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;[http://www.biografischportaal.nl/en/persoon/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039; .. getCatForId( &amp;#039;BPN&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function ridLink( id )&lt;br /&gt;
	return &amp;#039;[https://www.researcherid.com/rid/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039; .. getCatForId( &amp;#039;RID&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function bibsysLink( id )&lt;br /&gt;
	return &amp;#039;[https://authority.bibsys.no/authority/rest/authorities/html/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039; .. getCatForId( &amp;#039;BIBSYS&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function ulanLink( id )&lt;br /&gt;
	return &amp;#039;[https://www.getty.edu/vow/ULANFullDisplay?find=&amp;amp;role=&amp;amp;nation=&amp;amp;subjectid=&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039; .. getCatForId( &amp;#039;ULAN&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function nlaLink( id )&lt;br /&gt;
	return &amp;#039;[https://nla.gov.au/anbd.aut-an&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039; .. getCatForId( &amp;#039;NLA&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function rkdartistsLink( id )&lt;br /&gt;
	return &amp;#039;[https://rkd.nl/en/explore/artists/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039; .. getCatForId( &amp;#039;RKDartists&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function snacLink( id )&lt;br /&gt;
	return &amp;#039;[http://socialarchive.iath.virginia.edu/ark:/99166/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039; .. getCatForId( &amp;#039;SNAC-ID&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function dblpLink( id )&lt;br /&gt;
	return &amp;#039;[https://dblp.org/pid/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039; .. getCatForId( &amp;#039;DBLP&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function acmLink( id )&lt;br /&gt;
	return &amp;#039;[https://dl.acm.org/author_page.cfm?id=&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039; .. getCatForId( &amp;#039;ACM-DL&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function autoresuyLink( id )&lt;br /&gt;
	return &amp;#039;[http://autores.uy/autor/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039; ..  getCatForId( &amp;#039;autores.uy&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function picLink( id )&lt;br /&gt;
	return &amp;#039;[https://pic.nypl.org/constituents/&amp;#039; .. id .. &amp;#039; &amp;#039; .. id .. &amp;#039;]&amp;#039; .. getCatForId( &amp;#039;PIC&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getIdsFromWikidata( itemId, property )&lt;br /&gt;
	local ids = {}&lt;br /&gt;
	local statements = mw.wikibase.getBestStatements( itemId, property )&lt;br /&gt;
	if statements then&lt;br /&gt;
		for _, statement in ipairs( statements ) 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;
	end&lt;br /&gt;
	return ids&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function matchesWikidataRequirements( itemId, reqs )&lt;br /&gt;
	for _, group in ipairs( reqs ) do&lt;br /&gt;
		local property = &amp;#039;P&amp;#039; .. group[1]&lt;br /&gt;
		local qid = group[2]&lt;br /&gt;
		local statements = mw.wikibase.getBestStatements( itemId, property )&lt;br /&gt;
		if statements ~= nil then&lt;br /&gt;
			for _, statement in ipairs( statements ) do&lt;br /&gt;
				if statement.mainsnak.datavalue ~= nil then&lt;br /&gt;
					if statement.mainsnak.datavalue.value[&amp;#039;numeric-id&amp;#039;] == 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;
local function createRow( id, label, rawValue, link, withUid )&lt;br /&gt;
	if link then&lt;br /&gt;
		if withUid then&lt;br /&gt;
			return &amp;#039;*&amp;lt;span class=&amp;quot;nowrap&amp;quot;&amp;gt;&amp;#039; .. label .. &amp;#039; &amp;lt;span class=&amp;quot;uid&amp;quot;&amp;gt;&amp;#039; .. link .. &amp;#039;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;\n&amp;#039;&lt;br /&gt;
		else&lt;br /&gt;
			return &amp;#039;*&amp;lt;span class=&amp;quot;nowrap&amp;quot;&amp;gt;&amp;#039; .. label .. &amp;#039; &amp;#039; .. link .. &amp;#039;&amp;lt;/span&amp;gt;\n&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;* &amp;lt;span class=&amp;quot;error&amp;quot;&amp;gt;The &amp;#039; .. id .. &amp;#039; id &amp;#039; .. rawValue .. &amp;#039; is not valid.&amp;lt;/span&amp;gt;[[Category:Wikipedia articles with faulty authority control identifiers (&amp;#039; .. id .. &amp;#039;)]]\n&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--In this order: name of the parameter, label, propertyId in Wikidata, formatting function&lt;br /&gt;
local conf = {&lt;br /&gt;
	{ &amp;#039;VIAF&amp;#039;, &amp;#039;[[Virtual International Authority File|VIAF]]&amp;#039;, 214, viafLink },&lt;br /&gt;
	{ &amp;#039;LCCN&amp;#039;, &amp;#039;[[Library of Congress Control Number|LCCN]]&amp;#039;, 244, lccnLink },&lt;br /&gt;
	{ &amp;#039;ISNI&amp;#039;, &amp;#039;[[International Standard Name Identifier|ISNI]]&amp;#039;, 213, isniLink },&lt;br /&gt;
	{ &amp;#039;ORCID&amp;#039;, &amp;#039;[[ORCID]]&amp;#039;, 496, orcidLink },&lt;br /&gt;
	{ &amp;#039;GND&amp;#039;, &amp;#039;[[Integrated Authority File|GND]]&amp;#039;, 227, gndLink },&lt;br /&gt;
	{ &amp;#039;SELIBR&amp;#039;, &amp;#039;[[LIBRIS|SELIBR]]&amp;#039;, 906, selibrLink },&lt;br /&gt;
	{ &amp;#039;SUDOC&amp;#039;, &amp;#039;[[Système universitaire de documentation|SUDOC]]&amp;#039;, 269, sudocLink },&lt;br /&gt;
	{ &amp;#039;BNF&amp;#039;, &amp;#039;[[Bibliothèque nationale de France|BNF]]&amp;#039;, 268, bnfLink },&lt;br /&gt;
	{ &amp;#039;BPN&amp;#039;, &amp;#039;[[Biografisch Portaal|BPN]]&amp;#039;, 651, bpnLink },&lt;br /&gt;
	{ &amp;#039;RID&amp;#039;, &amp;#039;[[ResearcherID]]&amp;#039;, 1053, ridLink },&lt;br /&gt;
	{ &amp;#039;BIBSYS&amp;#039;, &amp;#039;[[BIBSYS]]&amp;#039;, 1015, bibsysLink },&lt;br /&gt;
	{ &amp;#039;ULAN&amp;#039;, &amp;#039;[[Union List of Artist Names|ULAN]]&amp;#039;, 245, ulanLink },&lt;br /&gt;
	{ &amp;#039;HDS&amp;#039;, &amp;#039;[[Historical Dictionary of Switzerland|HDS]]&amp;#039;, 902, hlsLink },&lt;br /&gt;
	{ &amp;#039;LIR&amp;#039;, &amp;#039;[[Historical Dictionary of Switzerland#Lexicon_Istoric_Retic|LIR]]&amp;#039;, 886, lirLink },&lt;br /&gt;
	{ &amp;#039;MBA&amp;#039;, &amp;#039;[[MusicBrainz]]&amp;#039;, 434, mbLink },&lt;br /&gt;
	{ &amp;#039;MGP&amp;#039;, &amp;#039;[[Mathematics Genealogy Project|MGP]]&amp;#039;, 549, mgpLink },&lt;br /&gt;
	{ &amp;#039;NLA&amp;#039;, &amp;#039;[[National Library of Australia|NLA]]&amp;#039;, 409, nlaLink },&lt;br /&gt;
	{ &amp;#039;NDL&amp;#039;, &amp;#039;[[National Diet Library|NDL]]&amp;#039;, 349, ndlLink },&lt;br /&gt;
	{ &amp;#039;NCL&amp;#039;, &amp;#039;[[National Central Library|NCL]]&amp;#039;, 1048, nclLink },&lt;br /&gt;
	{ &amp;#039;NKC&amp;#039;, &amp;#039;[[National Library of the Czech Republic|NKC]]&amp;#039;, 691, nkcLink },&lt;br /&gt;
	{ &amp;#039;Léonore&amp;#039;, &amp;#039;[[Base Léonore|Léonore]]&amp;#039;, 640, leonoreLink },&lt;br /&gt;
	{ &amp;#039;SBN&amp;#039;, &amp;#039;[[Istituto Centrale per il Catalogo Unico|ICCU]]&amp;#039;, 396, sbnLink },&lt;br /&gt;
	{ &amp;#039;RLS&amp;#039;, &amp;#039;[[Russian State Library|RLS]]&amp;#039;, 947, rslLink },&lt;br /&gt;
	{ &amp;#039;Botanist&amp;#039;, &amp;#039;[[Author citation (botany)|Botanist]]&amp;#039;, 428, botanistLink },&lt;br /&gt;
	{ &amp;#039;NARA-person&amp;#039;, &amp;#039;[[National Archives and Records Administration|NARA]]&amp;#039;, 1222, narapersonLink },&lt;br /&gt;
	{ &amp;#039;NARA-organization&amp;#039;, &amp;#039;[[National Archives and Records Administration|NARA]]&amp;#039;, 1223, naraorganizationLink },&lt;br /&gt;
	{ &amp;#039;USCongress&amp;#039;, &amp;#039;[[Biographical Directory of the United States Congress|US Congress]]&amp;#039;, 1157, uscongressLink },&lt;br /&gt;
	{ &amp;#039;BNE&amp;#039;, &amp;#039;[[Biblioteca Nacional de España|BNE]]&amp;#039;, 950, bneLink },&lt;br /&gt;
	{ &amp;#039;CINII&amp;#039;, &amp;#039;[[CiNii]]&amp;#039;, 271, ciniiLink },&lt;br /&gt;
	{ &amp;#039;TLS&amp;#039;, &amp;#039;[[Theaterlexikon der Schweiz|TLS]]&amp;#039;, 1362, tlsLink },&lt;br /&gt;
	{ &amp;#039;SIKART&amp;#039;, &amp;#039;[[SIKART]]&amp;#039;, 781, sikartLink },&lt;br /&gt;
	{ &amp;#039;KULTURNAV&amp;#039;, &amp;#039;[[KulturNav]]&amp;#039;, 1248, kulturnavLink },&lt;br /&gt;
	{ &amp;#039;RKDartists&amp;#039;, &amp;#039;[[Netherlands Institute for Art History#Online artist pages|RKD]]&amp;#039;, 650, rkdartistsLink },&lt;br /&gt;
	{ &amp;#039;SNAC-ID&amp;#039;, &amp;#039;[[SNAC]]&amp;#039;, 3430, snacLink },&lt;br /&gt;
	{ &amp;#039;DBLP&amp;#039;, &amp;#039;[[DBLP]]&amp;#039;, 2456, dblpLink },&lt;br /&gt;
	{ &amp;#039;ACM-DL&amp;#039;, &amp;#039;[[ACM Digital Library|ACM DL]]&amp;#039;, 864, acmLink },&lt;br /&gt;
	{ &amp;#039;autores.uy&amp;#039;, &amp;#039;[[autores.uy]]&amp;#039;, 2558, autoresuyLink },&lt;br /&gt;
	{ &amp;#039;PIC&amp;#039;, &amp;#039;[[:d:Q23892012|PIC]]&amp;#039;, 2750, picLink },&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;
&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;
	--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 == &amp;#039;&amp;#039;) and parentArgs.PND ~= nil and parentArgs.PND ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		parentArgs.GND = parentArgs.PND&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	--Wikidata fallback if requested&lt;br /&gt;
	local itemId = mw.wikibase.getEntityIdForCurrentPage()&lt;br /&gt;
	if itemId ~= nil then&lt;br /&gt;
		for _, params in ipairs( 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 == &amp;#039;&amp;#039; then&lt;br /&gt;
					local canUseWikidata = nil&lt;br /&gt;
					if reqs[params[1]] ~= nil then&lt;br /&gt;
						canUseWikidata = matchesWikidataRequirements( itemId, 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( itemId, &amp;#039;P&amp;#039; .. 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;
	--Worldcat&lt;br /&gt;
	if parentArgs[&amp;#039;WORLDCATID&amp;#039;] and parentArgs[&amp;#039;WORLDCATID&amp;#039;] ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		table.insert( elements, createRow( &amp;#039;WORLDCATID&amp;#039;, &amp;#039;&amp;#039;, parentArgs[&amp;#039;WORLDCATID&amp;#039;], &amp;#039;[https://www.worldcat.org/identities/&amp;#039; .. parentArgs[&amp;#039;WORLDCATID&amp;#039;] .. &amp;#039; WorldCat Identities]&amp;#039;, false ) ) --Validation?&lt;br /&gt;
	elseif parentArgs[&amp;#039;VIAF&amp;#039;] and string.match( parentArgs[&amp;#039;VIAF&amp;#039;], &amp;#039;^%d+$&amp;#039; ) then -- Hackishly copy the validation code; this should go away when we move to using P1793 and P1630&lt;br /&gt;
		table.insert( elements, createRow( &amp;#039;VIAF&amp;#039;, &amp;#039;&amp;#039;, parentArgs[&amp;#039;VIAF&amp;#039;], &amp;#039;[https://www.worldcat.org/identities/containsVIAFID/&amp;#039; .. parentArgs[&amp;#039;VIAF&amp;#039;] .. &amp;#039; WorldCat Identities]&amp;#039;, false ) )&lt;br /&gt;
	elseif parentArgs[&amp;#039;LCCN&amp;#039;] and parentArgs[&amp;#039;LCCN&amp;#039;] ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		local lccnParts = splitLccn( parentArgs[&amp;#039;LCCN&amp;#039;] )&lt;br /&gt;
		if lccnParts and lccnParts[1] ~= &amp;#039;sh&amp;#039; then&lt;br /&gt;
			table.insert( elements, createRow( &amp;#039;LCCN&amp;#039;, &amp;#039;&amp;#039;, parentArgs[&amp;#039;LCCN&amp;#039;], &amp;#039;[https://www.worldcat.org/identities/lccn-&amp;#039; .. lccnParts[1] .. lccnParts[2] .. &amp;#039;-&amp;#039; .. lccnParts[3] .. &amp;#039; WorldCat Identities]&amp;#039;, false ) )&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 _, params in ipairs( conf ) do&lt;br /&gt;
		local val = parentArgs[params[1]]&lt;br /&gt;
		if val and val ~= &amp;#039;&amp;#039; then&lt;br /&gt;
			table.insert( elements, createRow( params[1], params[2] .. &amp;#039;:&amp;#039;, val, params[4]( val ), true ) )&lt;br /&gt;
			rct = rct + 1&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local Navbox = require(&amp;#039;Module:Navbox&amp;#039;)&lt;br /&gt;
	local elementscats = &amp;#039;&amp;#039;&lt;br /&gt;
	if rct &amp;gt; 13 then&lt;br /&gt;
		elementscats  = &amp;#039;[[Category:AC with &amp;#039; .. rct .. &amp;#039; elements]]&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if #elements ~= 0 then&lt;br /&gt;
		return Navbox._navbox( {&lt;br /&gt;
			name  = &amp;#039;Authority control&amp;#039;,&lt;br /&gt;
			bodyclass = &amp;#039;hlist&amp;#039;,&lt;br /&gt;
			group1 = &amp;#039;[[Help:Authority control|Authority control]]&amp;#039; .. elementscats,&lt;br /&gt;
			list1 = table.concat( elements )&lt;br /&gt;
			} )&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>PirateCody</name></author>
	</entry>
</feed>