<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wikiyouth.eu/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://wikiyouth.eu/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AAuthority_control"/>
	<link rel="alternate" type="text/html" href="https://wikiyouth.eu/w/index.php?title=Module:Authority_control&amp;action=history"/>
	<updated>2026-04-15T04:09:09Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wikiyouth.eu/w/index.php?title=Module:Authority_control&amp;diff=35584&amp;oldid=prev</id>
		<title>Admin: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wikiyouth.eu/w/index.php?title=Module:Authority_control&amp;diff=35584&amp;oldid=prev"/>
		<updated>2025-04-09T08:42:57Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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 08:42, 9 April 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wiki_wikiyouth:diff:1.41:old-35583:rev-35584 --&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://wikiyouth.eu/w/index.php?title=Module:Authority_control&amp;diff=35583&amp;oldid=prev</id>
		<title>en&gt;Lucas Werkmeister: fulfilling edit request by User:David Osipov – update ORCID regexp (cf. Special:Diff/1873565689)</title>
		<link rel="alternate" type="text/html" href="https://wikiyouth.eu/w/index.php?title=Module:Authority_control&amp;diff=35583&amp;oldid=prev"/>
		<updated>2024-11-24T18:11:33Z</updated>

		<summary type="html">&lt;p&gt;fulfilling edit request by &lt;a href=&quot;/w/index.php?title=User:David_Osipov&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User:David Osipov (page does not exist)&quot;&gt;User:David Osipov&lt;/a&gt; – update ORCID regexp (cf. &lt;a href=&quot;/wiki/Special:Diff/1873565689&quot; title=&quot;Special:Diff/1873565689&quot;&gt;Special:Diff/1873565689&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[  &lt;br /&gt;
  __  __           _       _           _         _   _                _ _                           _             _ &lt;br /&gt;
 |  \/  | ___   __| |_   _| | ___ _   / \  _   _| |_| |__   ___  _ __(_) |_ _   _    ___ ___  _ __ | |_ _ __ ___ | |&lt;br /&gt;
 | |\/| |/ _ \ / _` | | | | |/ _ (_) / _ \| | | | __| &amp;#039;_ \ / _ \| &amp;#039;__| | __| | | |  / __/ _ \| &amp;#039;_ \| __| &amp;#039;__/ _ \| |&lt;br /&gt;
 | |  | | (_) | (_| | |_| | |  __/_ / ___ \ |_| | |_| | | | (_) | |  | | |_| |_| | | (_| (_) | | | | |_| | | (_) | |&lt;br /&gt;
 |_|  |_|\___/ \__,_|\__,_|_|\___(_)_/   \_\__,_|\__|_| |_|\___/|_|  |_|\__|\__, |  \___\___/|_| |_|\__|_|  \___/|_|&lt;br /&gt;
                                                                            |___/                                    &lt;br /&gt;
This module is intended to be the engine behind &amp;quot;Template:Authority control&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Please do not modify this code without applying the changes first at &amp;quot;Module:Authority control/sandbox&amp;quot; and testing &lt;br /&gt;
at &amp;quot;Module:Authority control/testcases&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Authors and maintainers:&lt;br /&gt;
* User:Jarekt - original version &lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local properties = require(&amp;#039;Module:Authority control/conf&amp;#039;)&lt;br /&gt;
local core       = require(&amp;#039;Module:Core&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
-- ==================================================&lt;br /&gt;
-- === Internal functions ===========================&lt;br /&gt;
-- ==================================================&lt;br /&gt;
&lt;br /&gt;
local function getSitelink(item, lang)&lt;br /&gt;
    -- get item&amp;#039;s siteling in specific language&lt;br /&gt;
	local langList = mw.language.getFallbacksFor(lang)&lt;br /&gt;
	table.insert(langList, 1, lang)&lt;br /&gt;
	for _, language in ipairs(langList) do &lt;br /&gt;
		local sitelink = mw.wikibase.sitelink( item, language .. &amp;#039;wiki&amp;#039; )&lt;br /&gt;
		if sitelink then &lt;br /&gt;
			return &amp;#039;w:&amp;#039;.. language ..&amp;#039;:&amp;#039;.. sitelink&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- ==================================================&lt;br /&gt;
local function getIdentifierNameLink( lang, item1, item2, label )&lt;br /&gt;
-- Identifier names, like VIAF, LCCN, ISNI, need to be linked to the articles about them if possible&lt;br /&gt;
-- Alternativly they can be linked to the articles for institutions that issue them&lt;br /&gt;
	local id_name_URL = nil&lt;br /&gt;
	-- 1) try wikipedia sitelink for the identifier in users language and in English&lt;br /&gt;
	if item1 and item1 ~=&amp;#039;&amp;#039; then&lt;br /&gt;
		id_name_URL = getSitelink(item1, lang)&lt;br /&gt;
	end&lt;br /&gt;
	-- 2) try wikipedia sitelink for the issuedBy property in users language and in English&lt;br /&gt;
	if id_name_URL==nil and item2 and item2 ~=&amp;#039;&amp;#039; then -- if no link than&lt;br /&gt;
		id_name_URL = getSitelink(item2, lang)&lt;br /&gt;
	end&lt;br /&gt;
	-- 3) if still no links than link to wikidata&lt;br /&gt;
	if id_name_URL then	&lt;br /&gt;
		return string.format(&amp;quot;[[%s|%s]]&amp;quot;, id_name_URL, label) -- link to wikipedia&lt;br /&gt;
	else    &lt;br /&gt;
		return string.format(&amp;quot;[[d:%s|%s]]&amp;quot;, item1, label) -- link to wikidata&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- ==================================================&lt;br /&gt;
-- Create link to a single identifier&lt;br /&gt;
-- INPUTS:&lt;br /&gt;
--  * val - value of the identifier&lt;br /&gt;
--  * P - property record, with URL_format and optional interwiki_format strings to create links&lt;br /&gt;
--  * params - additional parameters related to this type of identifiers. Single item from &amp;quot;conf&amp;quot;&lt;br /&gt;
--  * color - color of the link&lt;br /&gt;
local function getIdentifierValLink(val, P, params, color)&lt;br /&gt;
	if not val or val==&amp;#039;&amp;#039; then&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	-- check if identifier is in the right format&lt;br /&gt;
	local mismatchStr = &amp;#039;&amp;#039;&lt;br /&gt;
	local val_ = val:gsub( &amp;#039; &amp;#039;, &amp;#039;&amp;#039; ) -- remove spaces&lt;br /&gt;
	if (params.regexp and not val:match( params.regexp )) then&lt;br /&gt;
		mismatchStr  = string.format(&amp;quot;&amp;lt;span style=\&amp;quot;color:red\&amp;quot;&amp;gt;[does not match %s pattern]&amp;lt;/span&amp;gt;&amp;quot;, params.regexp)&lt;br /&gt;
	elseif (params.verify) then -- check if special &amp;quot;Verify&amp;quot; function is present&lt;br /&gt;
		mismatchStr = params.verify(val_) -- add error message if any&lt;br /&gt;
	end&lt;br /&gt;
	-- identifier_value_URL&lt;br /&gt;
	if color~=&amp;quot;blue&amp;quot; then&lt;br /&gt;
		val = string.format(&amp;#039;&amp;lt;span style=\&amp;quot;color:%s\&amp;quot;&amp;gt;%s&amp;lt;/span&amp;gt;&amp;#039;, color, val)&lt;br /&gt;
	end&lt;br /&gt;
	local val_link&lt;br /&gt;
	if P.interwiki_format and P.interwiki_format ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		val_link = string.format(&amp;quot;[[%s:%s|%s]]&amp;quot;, P.interwiki_format, val_, val)&lt;br /&gt;
	else&lt;br /&gt;
		local val_URL = P.URL_format:gsub(&amp;#039;$1&amp;#039;, val_)-- URL part of the link for the identifier value&lt;br /&gt;
		val_link = string.format(&amp;quot;[%s %s]&amp;quot;, val_URL, val)&lt;br /&gt;
	end&lt;br /&gt;
	return string.format(&amp;quot;&amp;lt;span class=\&amp;quot;plainlinks\&amp;quot;&amp;gt;%s&amp;lt;/span&amp;gt;%s&amp;quot;, val_link, mismatchStr) -- link to the identifier&amp;#039;s website&lt;br /&gt;
end &lt;br /&gt;
&lt;br /&gt;
-- ==================================================&lt;br /&gt;
-- Convert between 2 formats of LCCN: &amp;quot;n/79/63767&amp;quot; -&amp;gt; &amp;quot;n79063767&amp;quot;&lt;br /&gt;
-- &amp;quot;n/79/63767&amp;quot; format was used as input by {{Authority Control}} templates&lt;br /&gt;
-- &amp;quot;n79063767&amp;quot; format is used by wikidata&lt;br /&gt;
local function fixLCCN(id)&lt;br /&gt;
  if id then&lt;br /&gt;
		local a, b, c = string.match(id, &amp;quot;([%a%d]*)/([%a%d]*)/([%a%d]*)&amp;quot;)&lt;br /&gt;
		if c then&lt;br /&gt;
			local pad = 6 - string.len(c)&lt;br /&gt;
			if pad &amp;gt; 0 then&lt;br /&gt;
				c = string.rep(&amp;quot;0&amp;quot;, pad)..c&lt;br /&gt;
			end&lt;br /&gt;
			id = a..b..c&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return id&lt;br /&gt;
end -- fixLCCN&lt;br /&gt;
&lt;br /&gt;
-- ==================================================&lt;br /&gt;
-- Verify last &amp;quot;check&amp;quot; digit is correct. ISNI and several other &lt;br /&gt;
-- identifiers use last digit as a verification digit&lt;br /&gt;
local function verifyLastDigit( id )&lt;br /&gt;
    local total = 0&lt;br /&gt;
    for i = 1, #id-1 do&lt;br /&gt;
        local digit = id:byte( i ) - 48 --Get integer value&lt;br /&gt;
        total = (total + digit) * 2&lt;br /&gt;
    end&lt;br /&gt;
	&lt;br /&gt;
    --local remainder = total % 11&lt;br /&gt;
    local lastDigit = tostring((12 - total % 11) % 11)&lt;br /&gt;
    if lastDigit == &amp;#039;10&amp;#039; then&lt;br /&gt;
        lastDigit = &amp;quot;X&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
	&lt;br /&gt;
    if (lastDigit == string.sub( id, -1)) then&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;quot;&amp;lt;span style=\&amp;quot;color:red\&amp;quot;&amp;gt;[last digit should be &amp;quot; .. lastDigit .. &amp;quot;]&amp;lt;/span&amp;gt;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- ==================================================&lt;br /&gt;
-- === Settings =====================================&lt;br /&gt;
-- ==================================================&lt;br /&gt;
-- In order to add a new identifier associated with Wikidata property do the following &lt;br /&gt;
-- 1) go to [[Template:Authority control/IdentifierList]] and verify that the property number is on the list, if not than edit the page to add it&lt;br /&gt;
-- 2) copy code generated at [[Template:Authority control/IdentifierList]] to protected [[Module:Authority control/conf]]&lt;br /&gt;
-- 3) add the property to the &amp;quot;conf&amp;quot; list below&lt;br /&gt;
&lt;br /&gt;
-- load &amp;#039;Module:Authority control/conf&amp;#039; which holds hardwired data derived from Wikidata&amp;#039;s properties of &lt;br /&gt;
-- properties&lt;br /&gt;
&lt;br /&gt;
--conf  holds list of identifiers to be displayed&lt;br /&gt;
local conf = {&lt;br /&gt;
    -- people &lt;br /&gt;
	{label=&amp;#039;VIAF&amp;#039;        , property=&amp;#039;P214&amp;#039; , lang=&amp;#039;&amp;#039;  , regexp=&amp;#039;^%d+$&amp;#039; },&lt;br /&gt;
	{label=&amp;#039;ISNI&amp;#039;        , property=&amp;#039;P213&amp;#039; , lang=&amp;#039;&amp;#039;  , regexp=&amp;#039;^%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d[%dX]$&amp;#039;, verify=verifyLastDigit }, &lt;br /&gt;
	{label=&amp;#039;ORCID&amp;#039;       , property=&amp;#039;P496&amp;#039; , lang=&amp;#039;&amp;#039;  , regexp=&amp;#039;^%d%d%d%d%-%d%d%d%d%-%d%d%d%d%-%d%d%d[%dX]$&amp;#039; },&lt;br /&gt;
	{label=&amp;#039;ULAN&amp;#039;        , property=&amp;#039;P245&amp;#039; , lang=&amp;#039;&amp;#039;  , regexp=&amp;#039;^500%d%d%d%d%d%d$&amp;#039; }, -- &amp;#039;Union List of Artist Names&amp;#039; by Getty Research Institute&lt;br /&gt;
	{label=&amp;#039;ResearcherID&amp;#039;, property=&amp;#039;P1053&amp;#039;, lang=&amp;#039;&amp;#039;  , regexp=&amp;#039;^[A-Z]+%-%d%d%d%d%-[12][90]%d%d$&amp;#039; }, &lt;br /&gt;
	{label=&amp;#039;LCCN&amp;#039;        , property=&amp;#039;P244&amp;#039; , lang=&amp;#039;en&amp;#039;, regexp=&amp;#039;^[ns][broshj]?%d%d%d%d%d%d%d%d%d?%d?$&amp;#039; }, -- Library of Congress Authorities&lt;br /&gt;
	{label=&amp;#039;GND&amp;#039;         , property=&amp;#039;P227&amp;#039; , lang=&amp;#039;de&amp;#039;, regexp=&amp;#039;^[%dX%-]+$&amp;#039;},&lt;br /&gt;
	{label=&amp;#039;SELIBR&amp;#039;      , property=&amp;#039;P906&amp;#039; , lang=&amp;#039;se&amp;#039;, regexp=&amp;#039;^%d+$&amp;#039; }, -- National Library of Sweden&lt;br /&gt;
	{label=&amp;#039;SUDOC&amp;#039;       , property=&amp;#039;P269&amp;#039; , lang=&amp;#039;fr&amp;#039;, regexp=&amp;#039;^%d%d%d%d%d%d%d%d[%dxX]$&amp;#039; },    &lt;br /&gt;
	{label=&amp;#039;BNF&amp;#039;         , property=&amp;#039;P268&amp;#039; , lang=&amp;#039;fr&amp;#039;, regexp=&amp;#039;^%d+%w?$&amp;#039; }, -- Bibliothèque nationale de France&lt;br /&gt;
	{label=&amp;#039;BPN&amp;#039;         , property=&amp;#039;P651&amp;#039; , lang=&amp;#039;nl&amp;#039;, regexp=&amp;#039;^%d%d%d%d%d%d%d%d$&amp;#039; }, -- Biografisch Portaal number&lt;br /&gt;
	{label=&amp;#039;NAID&amp;#039;        , property=&amp;#039;P1225&amp;#039;, lang=&amp;#039;en&amp;#039;, regexp=&amp;#039;^%d+$&amp;#039; }, -- NARA ID (redirect for US National Archives Identifier (P1225))&lt;br /&gt;
	{label=&amp;#039;Museofile&amp;#039;   , property=&amp;#039;P539&amp;#039; , lang=&amp;#039;fr&amp;#039;, regexp=&amp;#039;^M%d%d%d%d%-?%d?%d?$&amp;#039; }, --Ministry of Culture (France)&lt;br /&gt;
	{label=&amp;#039;NDL&amp;#039;         , property=&amp;#039;P349&amp;#039; , lang=&amp;#039;ja&amp;#039;, regexp=&amp;#039;^0?%d%d%d%d%d%d%d%d$&amp;#039; }, -- National Diet Library (of Japan)&lt;br /&gt;
	{label=&amp;#039;NLA&amp;#039;         , property=&amp;#039;P409&amp;#039; , lang=&amp;#039;en&amp;#039;, regexp=&amp;#039;^[1-9]%d*$&amp;#039; }, -- National Library of Australia&lt;br /&gt;
	{label=&amp;#039;BIBSYS&amp;#039;      , property=&amp;#039;P1015&amp;#039;, lang=&amp;#039;no&amp;#039;, regexp=&amp;#039;^%d+$&amp;#039; }, -- Norwegian information system BIBSYS&lt;br /&gt;
	{label=&amp;#039;HDS&amp;#039;         , property=&amp;#039;P902&amp;#039; , lang=&amp;#039;de&amp;#039;, regexp=&amp;#039;^%d%d%d?%d?%d?%d?$&amp;#039; },  -- Historical Dictionary of Switzerland&lt;br /&gt;
	{label=&amp;#039;MusicBrainz&amp;#039; , property=&amp;#039;P434&amp;#039; , lang=&amp;#039;en&amp;#039;, regexp=&amp;#039;^[-%x]+$&amp;#039; }, &lt;br /&gt;
	{label=&amp;#039;MGP&amp;#039;         , property=&amp;#039;P549&amp;#039; , lang=&amp;#039;en&amp;#039;, regexp=&amp;#039;^%d%d?%d?%d?%d?%d?$&amp;#039; },  -- Mathematics Genealogy Project&lt;br /&gt;
	{label=&amp;#039;NCL&amp;#039;         , property=&amp;#039;P1048&amp;#039;, lang=&amp;#039;zh&amp;#039;, regexp=&amp;#039;^%d+$&amp;#039; },  --National Central Library (Taiwan)&lt;br /&gt;
	{label=&amp;#039;NKC&amp;#039;         , property=&amp;#039;P691&amp;#039; , lang=&amp;#039;cs&amp;#039;, regexp=&amp;#039;^%l%l%l?%l?%d%d%d?%d?%d?%d?%d?%d?%d?%d?%d?%d?%d?%d?$&amp;#039; },  --National Library of the Czech Republic&lt;br /&gt;
	{label=&amp;#039;Léonore&amp;#039;     , property=&amp;#039;P640&amp;#039; , lang=&amp;#039;fr&amp;#039;, regexp=&amp;#039;^[LHC%/%d]+$&amp;#039; }, &lt;br /&gt;
	{label=&amp;#039;SBN&amp;#039;         , property=&amp;#039;P396&amp;#039; , lang=&amp;#039;it&amp;#039;},  -- Istituto Centrale per il Catalogo Unico /  National Library Service (SBN) of Italy&lt;br /&gt;
	{label=&amp;#039;RSL&amp;#039;         , property=&amp;#039;P947&amp;#039; , lang=&amp;#039;ru&amp;#039;, regexp=&amp;#039;^%d%d%d%d%d%d%d%d%d$&amp;#039; },  --Russian State Library&lt;br /&gt;
	{label=&amp;#039;Botanist&amp;#039;    , property=&amp;#039;P428&amp;#039; , lang=&amp;#039;en&amp;#039; }, &lt;br /&gt;
	{label=&amp;#039;US Congress&amp;#039; , property=&amp;#039;P1157&amp;#039;, lang=&amp;#039;en&amp;#039;, regexp=&amp;#039;^%u00[01]%d%d%d&amp;#039; }, &lt;br /&gt;
	{label=&amp;#039;BNE&amp;#039;         , property=&amp;#039;P950&amp;#039; , lang=&amp;#039;es&amp;#039;, regexp=&amp;#039;&amp;#039; }, --Biblioteca Nacional de España&lt;br /&gt;
	{label=&amp;#039;CALIS&amp;#039;       , property=&amp;#039;P270&amp;#039; , lang=&amp;#039;zh&amp;#039;}, --China Academic Library and Information &lt;br /&gt;
	{label=&amp;#039;CiNii&amp;#039;       , property=&amp;#039;P271&amp;#039; , lang=&amp;#039;jp&amp;#039;, regexp=&amp;#039;^DA%d%d%d%d%d%d%d[%dX]$&amp;#039; }, &lt;br /&gt;
	{label=&amp;#039;TLS&amp;#039;         , property=&amp;#039;P1362&amp;#039;, lang=&amp;#039;de&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- Theaterlexikon der Schweiz&lt;br /&gt;
	{label=&amp;#039;SIKART&amp;#039;      , property=&amp;#039;P781&amp;#039; , lang=&amp;#039;de&amp;#039;, regexp=&amp;#039;^%d%d%d%d%d%d%d%d?%d?%d?$&amp;#039; }, -- Swiss&lt;br /&gt;
	{label=&amp;#039;NLP&amp;#039;         , property=&amp;#039;P1695&amp;#039;, lang=&amp;#039;pl&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- National Library of Poland&lt;br /&gt;
	{label=&amp;#039;WGA&amp;#039;         , property=&amp;#039;P1882&amp;#039;, lang=&amp;#039;en&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- Web Gallery of Art&lt;br /&gt;
	{label=&amp;#039;KulturNav&amp;#039;   , property=&amp;#039;P1248&amp;#039;, lang=&amp;#039;no&amp;#039;, regexp=&amp;#039;&amp;#039; }, &lt;br /&gt;
	{label=&amp;#039;RKD&amp;#039;         , property=&amp;#039;P650&amp;#039; , lang=&amp;#039;nl&amp;#039;, regexp=&amp;#039;^[1-9]%d%d?%d?%d?%d?$&amp;#039; }, --Netherlands Institute for Art History#Online artist pages&lt;br /&gt;
	{label=&amp;#039;autores.uy&amp;#039;  , property=&amp;#039;P2558&amp;#039;, lang=&amp;#039;es&amp;#039;, regexp=&amp;#039;^[1-9]%d?%d?%d?%d?$&amp;#039; },   --autores.uy&lt;br /&gt;
	{label=&amp;#039;J9U&amp;#039;         , property=&amp;#039;P8189&amp;#039;, lang=&amp;#039;he&amp;#039;, regexp=&amp;#039;&amp;#039; },  --National Library of Israel J9U ID&lt;br /&gt;
&lt;br /&gt;
	{label=&amp;#039;FIDE&amp;#039;        , property=&amp;#039;P1440&amp;#039;, lang=&amp;#039;en&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- FIDE database for chess players&lt;br /&gt;
	{label=&amp;#039;Chess Games&amp;#039; , property=&amp;#039;P1665&amp;#039;, lang=&amp;#039;en&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- Chess Games&lt;br /&gt;
&lt;br /&gt;
	{label=&amp;#039;ISSN&amp;#039;        , property=&amp;#039;P236&amp;#039;,  lang=&amp;#039;&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- P1629: International Standard Serial Number&lt;br /&gt;
	{label=&amp;#039;OSM&amp;#039;         , property=&amp;#039;P402&amp;#039;,  lang=&amp;#039;&amp;#039;, regexp=&amp;#039;&amp;#039; },  -- P1629: OpenStreetMap&lt;br /&gt;
	{label=&amp;#039;Joconde&amp;#039;     , property=&amp;#039;P347&amp;#039;,  lang=&amp;#039;fr&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- Joconde ID&lt;br /&gt;
	{label=&amp;#039;Rijksmonument&amp;#039;,property=&amp;#039;P359&amp;#039;,  lang=&amp;#039;nl&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- Rijksmonument ID&lt;br /&gt;
	{label=&amp;#039;IMO&amp;#039;         , property=&amp;#039;P458&amp;#039;,  lang=&amp;#039;&amp;#039;, regexp=&amp;#039;&amp;#039; }, --IMO ship number&lt;br /&gt;
	{label=&amp;#039;BNCF&amp;#039;        , property=&amp;#039;P508&amp;#039;,  lang=&amp;#039;it&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- BNCF Thesaurus ID&lt;br /&gt;
	{label=&amp;#039;MMSI&amp;#039;        , property=&amp;#039;P587&amp;#039;,  lang=&amp;#039;&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- P1629: Maritime Mobile Service Identity&lt;br /&gt;
	{label=&amp;#039;Open Library&amp;#039;, property=&amp;#039;P648&amp;#039;,  lang=&amp;#039;&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- P1629: Open Library&lt;br /&gt;
	{label=&amp;#039;NRHP&amp;#039;        , property=&amp;#039;P649&amp;#039;,  lang=&amp;#039;en&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- NRHP reference number&lt;br /&gt;
	{label=&amp;#039;DBNL&amp;#039;        , property=&amp;#039;P723&amp;#039;,  lang=&amp;#039;&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- DBNL author ID&lt;br /&gt;
	{label=&amp;#039;UNESCO&amp;#039;      , property=&amp;#039;P757&amp;#039;,  lang=&amp;#039;&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- World Heritage Site ID&lt;br /&gt;
	{label=&amp;#039;BIC&amp;#039;         , property=&amp;#039;P808&amp;#039;,  lang=&amp;#039;&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- Bien de Interés Cultural (BIC) code&lt;br /&gt;
	{label=&amp;#039;LIR&amp;#039;         , property=&amp;#039;P886&amp;#039;,  lang=&amp;#039;&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- LIR&lt;br /&gt;
	{label=&amp;#039;BNR&amp;#039;         , property=&amp;#039;P1003&amp;#039;, lang=&amp;#039;ro&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- NLR (Romania) ID&lt;br /&gt;
	{label=&amp;#039;Koninklijke&amp;#039; , property=&amp;#039;P1006&amp;#039;, lang=&amp;#039;nl&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- National Thesaurus for Author Names ID&lt;br /&gt;
	{label=&amp;#039;Louvre&amp;#039;      , property=&amp;#039;P9394&amp;#039;, lang=&amp;#039;&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- Louvre ID&lt;br /&gt;
	&lt;br /&gt;
	{label=&amp;#039;OCLC&amp;#039;        , property=&amp;#039;P243&amp;#039;,  lang=&amp;#039;&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- OCLC&lt;br /&gt;
	{label=&amp;#039;ISBN-13&amp;#039;     , property=&amp;#039;P212&amp;#039;,  lang=&amp;#039;&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- ISBN-13&lt;br /&gt;
	{label=&amp;#039;ISBN-10&amp;#039;     , property=&amp;#039;P957&amp;#039;,  lang=&amp;#039;&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- ISBN-10&lt;br /&gt;
	{label=&amp;#039;Historic England&amp;#039;, property=&amp;#039;P1216&amp;#039;, lang=&amp;#039;en&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- National Heritage List for England number&lt;br /&gt;
&lt;br /&gt;
	{label=&amp;#039;Oxford Dict.&amp;#039;, property=&amp;#039;P1415&amp;#039;, lang=&amp;#039;en&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- Oxford Dictionary of National Biography ID&lt;br /&gt;
	{label=&amp;#039;kulturnoe-nasledie&amp;#039;, property=&amp;#039;P1483&amp;#039;, lang=&amp;#039;ru&amp;#039;, regexp=&amp;#039;&amp;#039; },  -- kulturnoe-nasledie.ru ID&lt;br /&gt;
	{label=&amp;#039;Catalunya&amp;#039;   , property=&amp;#039;P1600&amp;#039;, lang=&amp;#039;ca&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- Inventari del Patrimoni Arquitectònic de Catalunya code&lt;br /&gt;
	{label=&amp;#039;COAM&amp;#039;        , property=&amp;#039;P2917&amp;#039;, lang=&amp;#039;es&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- COAM structure ID&lt;br /&gt;
	{label=&amp;#039;SIMBAD&amp;#039;      , property=&amp;#039;P3083&amp;#039;, lang=&amp;#039;fr&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- SIMBAD ID&lt;br /&gt;
	{label=&amp;#039;JCyL&amp;#039;        , property=&amp;#039;P3177&amp;#039;, lang=&amp;#039;es&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- Patrimonio Web JCyL ID&lt;br /&gt;
	{label=&amp;#039;Zaragoza&amp;#039;    , property=&amp;#039;P3178&amp;#039;, lang=&amp;#039;es&amp;#039;, regexp=&amp;#039;&amp;#039; },  -- Zaragoza monument ID&lt;br /&gt;
	{label=&amp;#039;BDI&amp;#039;         , property=&amp;#039;P3318&amp;#039;, lang=&amp;#039;es&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- Patrimonio Inmueble de Andalucía ID&lt;br /&gt;
	{label=&amp;#039;SIPCA&amp;#039;       , property=&amp;#039;P3580&amp;#039;, lang=&amp;#039;es&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- SIPCA code&lt;br /&gt;
	{label=&amp;#039;DOCOMOMO&amp;#039;    , property=&amp;#039;P3758&amp;#039;, lang=&amp;#039;&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- DOCOMOMO Ibérico ID&lt;br /&gt;
	{label=&amp;#039;Czech Monument&amp;#039;, property=&amp;#039;P4075&amp;#039;, lang=&amp;#039;cz&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- Czech Monument Catalogue Number&lt;br /&gt;
	{label=&amp;#039;MEG&amp;#039;         , property=&amp;#039;P4157&amp;#039;, lang=&amp;#039;ch&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- P1629: Musée d&amp;#039;ethnographie de Genève&lt;br /&gt;
	{label=&amp;#039;Enciclopédia Itaú Cultural&amp;#039; , property=&amp;#039;P4399&amp;#039;, lang=&amp;#039;pt_br&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- Enciclopédia Itaú Cultural ID&lt;br /&gt;
	{label=&amp;#039;Monumentos de São Paulo&amp;#039;    , property=&amp;#039;P4360&amp;#039;, lang=&amp;#039;pt_br&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- Monumentos de São Paulo ID&lt;br /&gt;
	{label=&amp;#039;Infopatrimônio&amp;#039;             , property=&amp;#039;P4372&amp;#039;, lang=&amp;#039;pt_br&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- Infopatrimônio ID&lt;br /&gt;
	{label=&amp;quot;Musée d&amp;#039;Orsay&amp;quot;              , property=&amp;#039;P4659&amp;#039;, lang=&amp;#039;fr&amp;#039;   , regexp=&amp;#039;&amp;#039; }, -- Musée d&amp;#039;Orsay artwork ID&lt;br /&gt;
	{label=&amp;#039;MuBE&amp;#039;                       , property=&amp;#039;P4721&amp;#039;, lang=&amp;#039;pt_br&amp;#039;, regexp=&amp;#039;&amp;#039; }, -- MuBE Virtual ID&lt;br /&gt;
	{label=&amp;#039;Hispania Nostra&amp;#039;            , property=&amp;#039;P4868&amp;#039;, lang=&amp;#039;es&amp;#039;   , regexp=&amp;#039;&amp;#039; }, -- Hispania Nostra Red List ID&lt;br /&gt;
	{label=&amp;#039;NLK&amp;#039;            , property=&amp;#039;P5034&amp;#039;, lang=&amp;#039;ko&amp;#039;   , regexp=&amp;#039;&amp;#039; }, -- National Library of Korea ID&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
-- ==================================================&lt;br /&gt;
-- === External functions ===========================&lt;br /&gt;
-- ==================================================&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.getAuthorityControlTag( lang )&lt;br /&gt;
-- get a localized interwiki link to article &amp;quot;Authority Control&amp;quot;&lt;br /&gt;
	local field_name = &amp;quot;[[w:en:Help:Authority control|Authority control]]&amp;quot; -- hardwire the default&lt;br /&gt;
	if lang~=&amp;#039;en&amp;#039; then&lt;br /&gt;
		field_name = core.getLabel(&amp;quot;Q36524&amp;quot;, lang)&lt;br /&gt;
	end&lt;br /&gt;
	return field_name&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- ==================================================&lt;br /&gt;
function p._authorityControl(entity, args, lang, length)&lt;br /&gt;
-- INPUTS:&lt;br /&gt;
--  * entity - wikidata entity if already created or nil. If provided than you should still provide args.Wikidata&lt;br /&gt;
--  * args   - structure with identifier fields: args.VIAF, args.LCCN, args.Wikidata, etc.&lt;br /&gt;
--  * lang   - language code&lt;br /&gt;
--  * length - maximum length of the identifier array, or number of identifiers to display&lt;br /&gt;
-- OUTPUTS:&lt;br /&gt;
--  * results - wikicode string equivalent to {{Authority control|...|bare=1 }} call&lt;br /&gt;
--  * cats    - wikicode with maintenance categories&lt;br /&gt;
&lt;br /&gt;
  -- count custom parameters (not pulled from Wikidata)&lt;br /&gt;
	local nCustomParam = 0 &lt;br /&gt;
	for _,params in ipairs( conf ) do&lt;br /&gt;
		if (args[params.label]~=nil) then&lt;br /&gt;
			nCustomParam = nCustomParam + 1&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Get entity - record of wikidata related to a single item&lt;br /&gt;
	local q = args.wikidata&lt;br /&gt;
	if not entity and q then&lt;br /&gt;
		entity = mw.wikibase.getEntity(q)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Check if this is category item&lt;br /&gt;
	local cats = &amp;#039;&amp;#039; -- categories (mismatching and missing)&lt;br /&gt;
	if entity and entity.claims and entity.claims.P31 then &lt;br /&gt;
		for _, statement in pairs( entity.claims.P31) do&lt;br /&gt;
			if (statement.mainsnak.snaktype == &amp;quot;value&amp;quot;) and (statement.mainsnak.datavalue.value.id == &amp;#039;Q4167836&amp;#039;)  then -- P31 == Wikimedia category &lt;br /&gt;
				cats = &amp;#039;[[Category:Wrong Wikidata ID in authority control data: category item]]&amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
			if (statement.mainsnak.snaktype == &amp;quot;value&amp;quot;) and (statement.mainsnak.datavalue.value.id == &amp;#039;Q4167410&amp;#039;)  then -- P31 == Wikimedia disambiguation page &lt;br /&gt;
				cats = &amp;#039;[[Category:Wrong Wikidata ID in authority control data: disambiguation item]]&amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	--compare provided arguments with Wikidata identifiers&lt;br /&gt;
	local data = {} -- structure similar to &amp;quot;args&amp;quot; but filled with wikidata data&lt;br /&gt;
	for _,params in ipairs( conf ) do&lt;br /&gt;
		local label = string.lower(params.label)&lt;br /&gt;
		data[label] = nil&lt;br /&gt;
		if entity and entity.claims and params.property and entity.claims[params.property] then -- if we have wikidata item and item has the property&lt;br /&gt;
			-- capture all Wikidata values for the identifier&lt;br /&gt;
			--for _, statement in pairs( entity.claims[params.property]) do&lt;br /&gt;
			for _, statement in pairs( entity:getBestStatements( params.property )) do&lt;br /&gt;
				if (statement.mainsnak.snaktype == &amp;quot;value&amp;quot;) then -- or if statement.mainsnak.datavalue then &lt;br /&gt;
					local v = statement.mainsnak.datavalue.value&lt;br /&gt;
					if data[label]==nil then&lt;br /&gt;
						data[label] = v       -- save the first value&lt;br /&gt;
					end&lt;br /&gt;
					if args[label] == v then  -- match between template and wikidata identifiers&lt;br /&gt;
						data[label] = &amp;#039;&amp;#039;      -- ignore identifier from wikidata&lt;br /&gt;
						break  &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;
	--Create string with all the identifiers listed&lt;br /&gt;
	local results1 = {} -- high priority list&lt;br /&gt;
	local results2 = {} -- low  priority list&lt;br /&gt;
	properties.P214.item = &amp;#039;Q54919&amp;#039;;   -- hardwire link to VIAF&lt;br /&gt;
	local today = &amp;#039;+&amp;#039; .. os.date(&amp;#039;!%F&amp;#039;) .. &amp;#039;T00:00:00Z/11&amp;#039;&lt;br /&gt;
	local TransStr = &amp;#039;https://quickstatements.toolforge.org/#/v1=%s|%s|%%22%s%%22|S143|Q565|S813|&amp;#039;.. today -- QuickStatementts URL&lt;br /&gt;
	TransStr = &amp;#039;&amp;lt;span class=\&amp;quot;plainlinks\&amp;quot; title=\&amp;quot;Click (+) to copy to wikidata\&amp;quot;&amp;gt;[&amp;#039;.. TransStr .. &amp;#039; (+)]&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
	for _,params in ipairs( conf ) do&lt;br /&gt;
		local label = string.lower(params.label)&lt;br /&gt;
		local val1 = args[label] -- identifier value provided to the template&lt;br /&gt;
		local val2 = data[label] -- identifier value pulled from wikidata&lt;br /&gt;
		if val1 or val2 then&lt;br /&gt;
			local P = properties[params.property] -- properties of wikidata identifier propertyc&lt;br /&gt;
			-- name_link - link for the identifier name&lt;br /&gt;
			local name_link = getIdentifierNameLink( lang, P.item, P.issuedBy, params.label )&lt;br /&gt;
			&lt;br /&gt;
			-- val_link - identifier value or values&lt;br /&gt;
			local transfer = &amp;#039;&amp;#039;&lt;br /&gt;
			local val3 = string.gsub(val1 or &amp;#039;&amp;#039;, &amp;#039; &amp;#039;, &amp;#039;&amp;#039; ) -- remove spaces&lt;br /&gt;
			local val_link&lt;br /&gt;
			if not val1 then&lt;br /&gt;
				val_link = getIdentifierValLink(val2, P, params, &amp;#039;blue&amp;#039;) -- wikidata only no local identifier&lt;br /&gt;
			elseif val2==&amp;#039;&amp;#039; then&lt;br /&gt;
				val_link = getIdentifierValLink(val1, P, params, &amp;#039;magenta&amp;#039;) -- match was found&lt;br /&gt;
			elseif val2 then&lt;br /&gt;
				val_link = getIdentifierValLink(val1, P, params, &amp;#039;darkgreen&amp;#039;) .. &amp;quot;/&amp;quot;..getIdentifierValLink(val2, P, params, &amp;#039;blue&amp;#039;)&lt;br /&gt;
				cats  = string.format(&amp;quot;%s[[Category:Pages using authority control with identifiers mismatching Wikidata]]\n&amp;quot;, cats)&lt;br /&gt;
				transfer  = string.format(TransStr, q, params.property, val3)&lt;br /&gt;
			elseif not val2 and entity then&lt;br /&gt;
				val_link = getIdentifierValLink(val1, P, params, &amp;#039;darkgreen&amp;#039;)&lt;br /&gt;
				cats  = string.format(&amp;quot;%s[[Category:Pages using authority control with identifiers missing from Wikidata]]\n&amp;quot;, cats)&lt;br /&gt;
				transfer  = string.format(TransStr, q, params.property, val3)&lt;br /&gt;
			else&lt;br /&gt;
				val_link = getIdentifierValLink(val1, P, params, &amp;#039;blue&amp;#039;) -- local identifier and no wikidata q-code&lt;br /&gt;
			end&lt;br /&gt;
&lt;br /&gt;
			-- combine them all&lt;br /&gt;
			local lineStr = string.format(&amp;quot;\n*%s:&amp;amp;thinsp;&amp;lt;span class=\&amp;quot;uid\&amp;quot;&amp;gt;%s&amp;lt;/span&amp;gt;%s&amp;quot;, name_link, val_link, transfer)&lt;br /&gt;
			if (params.lang==lang) or (params.lang==&amp;#039;&amp;#039;) then&lt;br /&gt;
				table.insert(results1, lineStr) -- add to high priority list&lt;br /&gt;
			else&lt;br /&gt;
				table.insert(results2, lineStr) -- add to low priority list&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end -- for all sources&lt;br /&gt;
	&lt;br /&gt;
	-- merge high and low priority lists, trim them if needed and convert to string &lt;br /&gt;
	--table.insert(results1, &amp;quot;\n*End list 1&amp;quot;) -- for debuging&lt;br /&gt;
	--table.insert(results2, &amp;quot;\n*End list 2&amp;quot;)&lt;br /&gt;
	for _,v in pairs(results2) do table.insert(results1, v) end&lt;br /&gt;
	local results = table.concat(results1, &amp;quot;&amp;quot;, 1, math.min(#results1, length or #results1)) &lt;br /&gt;
	&lt;br /&gt;
	-- Add Link to wikidata &lt;br /&gt;
	if q then&lt;br /&gt;
		results = string.format(&amp;quot;\n*[[File:Wikidata-logo.svg|20px|wikidata:%s|link=wikidata:%s]]: [[d:%s|%s]]%s&amp;quot;,q,q,q,q,results)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Add link to Worldcat&lt;br /&gt;
	if (args.worldcatid==nil and (args.lccn or data.lccn))  then&lt;br /&gt;
		args.worldcatid = &amp;#039;lccn-&amp;#039; .. (args.lccn or data.lccn)&lt;br /&gt;
	end&lt;br /&gt;
	if args.worldcatid  then&lt;br /&gt;
		results = string.format(&amp;quot;%s\n*&amp;lt;span class=\&amp;quot;uid\&amp;quot;&amp;gt;[//www.worldcat.org/identities/%s WorldCat]&amp;lt;/span&amp;gt;&amp;quot;, results, args.worldcatid)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Add maintenance categories&lt;br /&gt;
	if q == nil then&lt;br /&gt;
		cats = string.format(&amp;quot;%s[[Category:Pages using authority control without Wikidata link]]\n&amp;quot;, cats)&lt;br /&gt;
	end&lt;br /&gt;
	if nCustomParam&amp;gt;0 then&lt;br /&gt;
		if cats==&amp;#039;&amp;#039; and entity ~= nil then&lt;br /&gt;
			cats = string.format(&amp;quot;%s[[Category:Pages using authority control with all identifiers matching Wikidata]]\n&amp;quot;, cats)&lt;br /&gt;
		end&lt;br /&gt;
		if string.find(results, &amp;quot;&amp;lt;span style=\&amp;quot;color:red\&amp;quot;&amp;gt;&amp;quot;) then &lt;br /&gt;
			cats = string.format(&amp;quot;%s[[Category:Pages using authority control with badly formated identifier]]\n&amp;quot;, cats)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- return results&lt;br /&gt;
	if results~=&amp;#039;&amp;#039; then -- if there are any results than wrap them in &amp;lt;div&amp;gt; tag&lt;br /&gt;
		results  = string.format(&amp;#039;&amp;lt;div class=&amp;quot;hlist&amp;quot;&amp;gt;%s\n&amp;lt;/div&amp;gt;&amp;#039;, results)&lt;br /&gt;
	end&lt;br /&gt;
	return results, cats&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- ===========================================================================&lt;br /&gt;
-- === Version of the function to be called from template namespace&lt;br /&gt;
-- ===========================================================================&lt;br /&gt;
function p.authorityControl(frame)&lt;br /&gt;
	-- prepare arguments&lt;br /&gt;
	local args = core.getArgs(frame)&lt;br /&gt;
	local bare = core.yesno(args.bare,false)         &lt;br /&gt;
	&lt;br /&gt;
	-- Convert template arguments to the same format as used on wikidata&lt;br /&gt;
	if args.bnf then&lt;br /&gt;
		args.bnf = string.sub(args.bnf, 3) -- trim first 2 characters&lt;br /&gt;
	end&lt;br /&gt;
--	if args.isni then -- group in sets of 4&lt;br /&gt;
--		args.isni = string.sub(args.isni, 1, 4)..&amp;quot; &amp;quot;..string.sub(args.isni, 5, 8)&lt;br /&gt;
--		     ..&amp;quot; &amp;quot;..string.sub(args.isni, 9,12)..&amp;quot; &amp;quot;..string.sub(args.isni,13,16)&lt;br /&gt;
--	end&lt;br /&gt;
	if args.isbn then&lt;br /&gt;
		local isbn = isbn.gsub( &amp;#039; &amp;#039;, &amp;#039;&amp;#039; )&lt;br /&gt;
		if #isbn==10 then&lt;br /&gt;
			args[&amp;#039;isbn-10&amp;#039;] = args.isbn&lt;br /&gt;
		elseif #isbn==13 then&lt;br /&gt;
			args[&amp;#039;isbn-13&amp;#039;] = args.isbn&lt;br /&gt;
		end&lt;br /&gt;
		args.isbn = nil&lt;br /&gt;
	end&lt;br /&gt;
	args.gnd  = args.gnd or args.pnd --redirect PND to GND&lt;br /&gt;
	args.lccn = fixLCCN(args.lccn)&lt;br /&gt;
	args.wikidata = args.wikidata or args.q or nil&lt;br /&gt;
	&lt;br /&gt;
	-- call the inner &amp;quot;core&amp;quot; function&lt;br /&gt;
	local results, cats = p._authorityControl(nil, args, args.lang, args.length)&lt;br /&gt;
	local namespace = mw.title.getCurrentTitle().namespace&lt;br /&gt;
	local LUT = {[2]=&amp;#039;user&amp;#039;, [6]=&amp;#039;file&amp;#039;, [10]=&amp;#039;template&amp;#039;, [828]=&amp;#039;module&amp;#039;}&lt;br /&gt;
	if (LUT[namespace] or math.fmod(namespace,2)==1) then&lt;br /&gt;
		-- lets not add categories to some namespaces, or talk pages and concentrate&lt;br /&gt;
		-- on templates and categories instead&lt;br /&gt;
		cats = &amp;#039;&amp;#039; &lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	--package results as a infobox if not &amp;quot;bare&amp;quot;&lt;br /&gt;
	if not bare then&lt;br /&gt;
		-- Get field name for authority control&lt;br /&gt;
		local field_name = p.getAuthorityControlTag(args.lang)&lt;br /&gt;
&lt;br /&gt;
		-- build table&lt;br /&gt;
		results = string.format(&amp;#039;&amp;lt;tr&amp;gt;&amp;lt;td class=&amp;quot;type fileinfo-paramfield&amp;quot;&amp;gt;%s&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;\n%s\n&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;#039;, field_name, results)&lt;br /&gt;
		local dir   = mw.language.new( args.lang ):getDir()    -- get text direction&lt;br /&gt;
		local style = &amp;#039;class=&amp;quot;toccolours layouttemplate commons-file-information-table&amp;quot; style=&amp;quot;width: 100%%;&amp;quot; dir=&amp;quot;%s&amp;quot; lang=&amp;quot;%s&amp;quot;&amp;#039; &lt;br /&gt;
		style = string.format(style, dir, args.lang)&lt;br /&gt;
		results = string.format(&amp;#039;&amp;lt;table %s&amp;gt;\n%s\n&amp;lt;/table&amp;gt;\n&amp;#039;, style, results)&lt;br /&gt;
	else&lt;br /&gt;
		results = string.format(&amp;#039;\n%s\n&amp;#039;, results)&lt;br /&gt;
	end&lt;br /&gt;
	return results..cats&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>en&gt;Lucas Werkmeister</name></author>
	</entry>
</feed>