<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://bourbon.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AAuthority_control%2Fdocumentation</id>
	<title>Module:Authority control/documentation - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://bourbon.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AAuthority_control%2Fdocumentation"/>
	<link rel="alternate" type="text/html" href="https://bourbon.wiki/index.php?title=Module:Authority_control/documentation&amp;action=history"/>
	<updated>2026-04-30T13:31:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://bourbon.wiki/index.php?title=Module:Authority_control/documentation&amp;diff=830&amp;oldid=prev</id>
		<title>Jorge: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://bourbon.wiki/index.php?title=Module:Authority_control/documentation&amp;diff=830&amp;oldid=prev"/>
		<updated>2024-08-31T23:33:43Z</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 23:33, 31 August 2024&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 mediawikidb:diff:1.41:old-829:rev-830 --&gt;
&lt;/table&gt;</summary>
		<author><name>Jorge</name></author>
	</entry>
	<entry>
		<id>https://bourbon.wiki/index.php?title=Module:Authority_control/documentation&amp;diff=829&amp;oldid=prev</id>
		<title>wikipedia&gt;MSGJ: reapply edit, forgot to sync the sandbox...</title>
		<link rel="alternate" type="text/html" href="https://bourbon.wiki/index.php?title=Module:Authority_control/documentation&amp;diff=829&amp;oldid=prev"/>
		<updated>2024-08-31T20:01:09Z</updated>

		<summary type="html">&lt;p&gt;reapply edit, forgot to sync the sandbox...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require(&amp;#039;strict&amp;#039;)&lt;br /&gt;
local p = {}&lt;br /&gt;
local frame = mw.getCurrentFrame()&lt;br /&gt;
local config_file = frame.args.config and frame.args.config~=&amp;#039;&amp;#039; and (&amp;#039;/&amp;#039; .. frame.args.config) or &amp;#039;&amp;#039;&lt;br /&gt;
local config = mw.loadData(&amp;#039;Module:Authority control/config&amp;#039; .. config_file)&lt;br /&gt;
local title = mw.title.getCurrentTitle()&lt;br /&gt;
local namespace = title.namespace&lt;br /&gt;
local testcases = title.subpageText == config.i18n.testcases&lt;br /&gt;
local makelink = require(config.i18n.ACmodule).makelink&lt;br /&gt;
local lang = mw.getContentLanguage()&lt;br /&gt;
&lt;br /&gt;
local function needsAttention(sortkey)&lt;br /&gt;
	return &amp;#039;[[&amp;#039; .. config.i18n.category .. &amp;#039;:&amp;#039; .. config.i18n.attentioncat .. &amp;#039;|&amp;#039; .. sortkey .. title.text .. &amp;#039;]]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function addCat(cat, sortkey)&lt;br /&gt;
	if cat and cat ~= &amp;#039;&amp;#039; and (namespace == 0 or namespace == 14 or testcases) then&lt;br /&gt;
		local category, redlinkcat = &amp;#039;&amp;#039;, &amp;#039;&amp;#039;&lt;br /&gt;
		if testcases == false and mw.title.new(cat, 14).exists == false then&lt;br /&gt;
			redlinkcat = needsAttention(&amp;#039;N&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		category = &amp;#039;[[&amp;#039; .. config.i18n.category .. &amp;#039;:&amp;#039; .. cat&lt;br /&gt;
		if sortkey then&lt;br /&gt;
			category = category .. &amp;#039;|&amp;#039; .. sortkey .. title.text&lt;br /&gt;
		end&lt;br /&gt;
		category = category .. &amp;#039;]]&amp;#039; .. redlinkcat&lt;br /&gt;
		return category&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local getstatement = function(id, propid, qualid)&lt;br /&gt;
	local statement = mw.wikibase.getBestStatements(&amp;#039;P&amp;#039; .. id, &amp;#039;P&amp;#039; .. propid)&lt;br /&gt;
	local value&lt;br /&gt;
	if statement and statement[1] and statement[1].mainsnak.datavalue.value.id then&lt;br /&gt;
		value = statement[1].mainsnak.datavalue.value.id&lt;br /&gt;
		local qual&lt;br /&gt;
		if qualid and statement[1].qualifiers[&amp;#039;P&amp;#039; .. qualid][1].datavalue.value then&lt;br /&gt;
			qual = statement[1].qualifiers[&amp;#039;P&amp;#039; .. qualid][1].datavalue.value&lt;br /&gt;
		end&lt;br /&gt;
		return value, qual&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
local getname = function(property)&lt;br /&gt;
	local name&lt;br /&gt;
	for _, propnameqid in ipairs(config.property_items) do&lt;br /&gt;
		name = getstatement(property, propnameqid)&lt;br /&gt;
		if name then break end&lt;br /&gt;
	end&lt;br /&gt;
	if name then&lt;br /&gt;
		return frame:expandTemplate{&lt;br /&gt;
			title = &amp;#039;Wikidata fallback link&amp;#039;,&lt;br /&gt;
			args = {name}&lt;br /&gt;
		}&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Creates a human-readable standalone wikitable version of conf, and tracking categories with page counts, for use in the documentation&lt;br /&gt;
function p.docConfTable()&lt;br /&gt;
	local doc = &amp;#039;&amp;#039;&lt;br /&gt;
	local row = function(conf)&lt;br /&gt;
		local example_qid = getstatement(conf.property, 1855)&lt;br /&gt;
		local example = example_qid and frame:expandTemplate{&lt;br /&gt;
			title = &amp;#039;Hlist&amp;#039;,&lt;br /&gt;
			args = {tostring(&lt;br /&gt;
				mw.html.create(&amp;#039;ul&amp;#039;)&lt;br /&gt;
				:node(makelink(conf, example_qid))&lt;br /&gt;
			)}&lt;br /&gt;
		} or &amp;#039;&amp;#039;&lt;br /&gt;
		local out&lt;br /&gt;
		if conf.remark then&lt;br /&gt;
			out = &amp;#039;&amp;lt;tr&amp;gt;&amp;lt;th rowspan=2 data-sort-value=&amp;#039; .. conf.property .. &amp;#039;&amp;gt;&amp;#039;&lt;br /&gt;
		else&lt;br /&gt;
			out = &amp;#039;&amp;lt;tr&amp;gt;&amp;lt;th data-sort-value=&amp;#039; .. conf.property .. &amp;#039;&amp;gt;&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		out = out .. frame:expandTemplate{&lt;br /&gt;
				title = &amp;#039;Wikidata property link&amp;#039;,&lt;br /&gt;
				args = {conf.property}&lt;br /&gt;
			} .. &amp;#039;&amp;lt;/th&amp;gt;&amp;#039;&lt;br /&gt;
			.. &amp;#039;&amp;lt;td&amp;gt;&amp;#039; .. getname(conf.property) .. &amp;#039;&amp;lt;/td&amp;gt;&amp;#039;&lt;br /&gt;
			.. &amp;#039;&amp;lt;td style=&amp;quot;text-align: center&amp;quot;&amp;gt;&amp;#039; .. config.sections[conf.section].name .. &amp;#039;&amp;lt;/td&amp;gt;&amp;#039;&lt;br /&gt;
			.. &amp;#039;&amp;lt;td&amp;gt;&amp;#039; .. example .. &amp;#039;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;#039;&lt;br /&gt;
		if conf.remark then&lt;br /&gt;
			out = out .. &amp;#039;&amp;lt;tr class=&amp;quot;expand-child&amp;quot;&amp;gt;&amp;lt;td colspan=&amp;quot;3&amp;quot;&amp;gt;&amp;#039;&lt;br /&gt;
				.. &amp;quot;&amp;#039;&amp;#039;&amp;#039;Remarks:&amp;#039;&amp;#039;&amp;#039; &amp;quot; .. frame:preprocess{text = conf.remark}&lt;br /&gt;
				.. &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		return out&lt;br /&gt;
	end&lt;br /&gt;
	local doc = &amp;#039;&amp;lt;table class=&amp;quot;wikitable sortable&amp;quot;&amp;gt;&amp;#039; ..&lt;br /&gt;
	  &amp;#039;&amp;lt;tr&amp;gt;&amp;lt;th data-sort-type=number&amp;gt;&amp;#039; .. config.i18n.WDproperty .. &amp;#039;&amp;lt;/th&amp;gt;&amp;#039;&lt;br /&gt;
		.. &amp;#039;&amp;lt;th&amp;gt;&amp;#039; .. lang:ucfirst(config.i18n.identifier) .. &amp;#039;&amp;lt;/th&amp;gt;&amp;#039;&lt;br /&gt;
		.. &amp;#039;&amp;lt;th&amp;gt;&amp;#039; .. config.i18n.Section .. &amp;#039;&amp;lt;/th&amp;gt;&amp;#039;&lt;br /&gt;
		.. &amp;#039;&amp;lt;th&amp;gt;&amp;#039; .. config.i18n.Appears_as .. &amp;#039;&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&amp;#039;&lt;br /&gt;
	for _, conf in pairs(config.config) do&lt;br /&gt;
		doc = doc .. row(conf)&lt;br /&gt;
	end&lt;br /&gt;
	doc = doc .. &amp;#039;&amp;lt;/table&amp;gt;&amp;#039;&lt;br /&gt;
	return doc&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.whitelisttable()&lt;br /&gt;
	local Table = &amp;#039;&amp;lt;table class=&amp;quot;wikitable sortable&amp;quot;&amp;gt;&amp;#039;..&lt;br /&gt;
	  &amp;#039;&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;&amp;#039; .. config.i18n.Code .. &amp;#039;&amp;lt;/th&amp;gt;&amp;#039;..&lt;br /&gt;
	  &amp;#039;&amp;lt;th&amp;gt;&amp;#039; .. config.i18n.Topic .. &amp;#039;&amp;lt;/th&amp;gt;&amp;#039;..&lt;br /&gt;
	  &amp;#039;&amp;lt;th&amp;gt;&amp;#039; .. lang:ucfirst(config.i18n.identifiers) .. &amp;#039;&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&amp;#039;&lt;br /&gt;
	for code, wlist in pairs(config.whitelists) do&lt;br /&gt;
		Table = Table .. &amp;#039;&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;&amp;#039; .. code .. &amp;#039;&amp;lt;/th&amp;gt;&amp;#039;..&lt;br /&gt;
			&amp;#039;&amp;lt;td&amp;gt;[[&amp;#039; .. mw.wikibase.getSitelink(&amp;#039;Q&amp;#039; .. wlist.topic) .. &amp;#039;]]&amp;lt;/td&amp;gt;&amp;#039;&lt;br /&gt;
		local plist = {}&lt;br /&gt;
		for _, property in pairs(wlist.properties) do&lt;br /&gt;
			table.insert(plist, frame:expandTemplate{title=&amp;#039;Wikidata property link&amp;#039;, args={&amp;#039;P&amp;#039; .. property}})&lt;br /&gt;
		end&lt;br /&gt;
		Table = Table .. &amp;#039;&amp;lt;td&amp;gt;&amp;#039; .. table.concat(plist,&amp;#039;, &amp;#039;) .. &amp;#039;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	Table = Table .. &amp;#039;&amp;lt;/table&amp;gt;&amp;#039;&lt;br /&gt;
	return Table&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.sectiontable()&lt;br /&gt;
	local Table = &amp;#039;&amp;lt;table class=&amp;quot;wikitable sortable&amp;quot;&amp;gt;&amp;#039;..&lt;br /&gt;
	  &amp;#039;&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;&amp;#039; .. config.i18n.Section .. &amp;#039;&amp;lt;/th&amp;gt;&amp;#039; ..&lt;br /&gt;
	  &amp;#039;&amp;lt;th&amp;gt;&amp;#039; .. config.i18n.Description .. &amp;#039;&amp;lt;/th&amp;gt;&amp;#039;..&lt;br /&gt;
	  &amp;#039;&amp;lt;th&amp;gt;&amp;#039; .. lang:ucfirst(config.i18n.identifiers) .. &amp;#039;&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&amp;#039;&lt;br /&gt;
	for number,section in ipairs(config.sections) do&lt;br /&gt;
		Table = Table .. &amp;#039;&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;&amp;#039; .. number .. &amp;#039;&amp;lt;/th&amp;gt;&amp;#039; ..	&amp;#039;&amp;lt;td&amp;gt;&amp;#039; .. section.name .. &amp;#039;&amp;lt;/td&amp;gt;&amp;#039;&lt;br /&gt;
		local plist = {}&lt;br /&gt;
		for _,id in pairs(config.config) do&lt;br /&gt;
			if id.section == number then&lt;br /&gt;
				table.insert(plist, frame:expandTemplate{&lt;br /&gt;
					title=config.i18n.linktemplate,&lt;br /&gt;
					args={&amp;#039;P&amp;#039; .. id.property}&lt;br /&gt;
				})&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		Table = Table .. &amp;#039;&amp;lt;td&amp;gt;&amp;#039; .. table.concat(plist,&amp;#039;, &amp;#039;) .. &amp;#039;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	Table = Table .. &amp;#039;&amp;lt;/table&amp;gt;&amp;#039;&lt;br /&gt;
	return Table&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Main/External Call for Pages with authority control identifiers&lt;br /&gt;
function p.autoDetect()&lt;br /&gt;
	local function whichTOC() -- standardize TOC behavior via {{CatAutoTOC}}&lt;br /&gt;
		return frame:expandTemplate{ title = &amp;#039;CatAutoTOC&amp;#039;, args = { align = &amp;#039;center&amp;#039; } }&lt;br /&gt;
	end&lt;br /&gt;
	local function wpa(id, faulty)&lt;br /&gt;
		local outString = &amp;#039;&amp;#039;&lt;br /&gt;
		for _, conf in pairs(config.config) do&lt;br /&gt;
			if conf.category==id then&lt;br /&gt;
				outString = frame:expandTemplate{&lt;br /&gt;
					title = &amp;#039;Category explanation&amp;#039;,&lt;br /&gt;
					args = {&amp;#039;articles with &amp;#039; .. getname(conf.property) .. &amp;#039; identifiers.&amp;#039;..&amp;#039; Please do not add [[Wikipedia:Categorization#Subcategorization|subcategories]].\nPages in this category should only be added by [[Module:Authority control]].&amp;#039;}&lt;br /&gt;
				} .. frame:expandTemplate{&lt;br /&gt;
					title = &amp;#039;Cat more&amp;#039;,&lt;br /&gt;
					args = {&amp;#039;Wikipedia:Authority control&amp;#039;, &amp;#039;:d:Property:P&amp;#039;..conf.property}&lt;br /&gt;
				} .. frame:expandTemplate{&lt;br /&gt;
					title = &amp;#039;Possibly empty category&amp;#039;&lt;br /&gt;
				} .. frame:expandTemplate{&lt;br /&gt;
					title = &amp;#039;Wikipedia category&amp;#039;,&lt;br /&gt;
					args = {hidden = &amp;#039;yes&amp;#039;, tracking = &amp;#039;yes&amp;#039; }&lt;br /&gt;
				} .. frame:expandTemplate{&lt;br /&gt;
					title = &amp;#039;Polluted category&amp;#039;&lt;br /&gt;
				} .. whichTOC()&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if faulty then&lt;br /&gt;
			outString = outString .. addCat(config.i18n.faultcat,id) .. addCat(string.format(config.i18n.cat, id))&lt;br /&gt;
		else&lt;br /&gt;
			outString = outString .. addCat(config.i18n.maincat,id)&lt;br /&gt;
		end&lt;br /&gt;
		return outString&lt;br /&gt;
	end&lt;br /&gt;
	if namespace == 14 then --cat space&lt;br /&gt;
		local wpfaultyID = mw.ustring.match(title.text, &amp;#039;Articles with faulty (.+) identifiers&amp;#039;)&lt;br /&gt;
		local wpID = mw.ustring.match(title.text, &amp;#039;Articles with (.+) identifiers&amp;#039;)&lt;br /&gt;
		if wpfaultyID then&lt;br /&gt;
			return wpa(wpfaultyID, true)-- must be before wpID check, in case they both match&lt;br /&gt;
		elseif wpID then&lt;br /&gt;
			return wpa(wpID, false)&lt;br /&gt;
		else&lt;br /&gt;
			return needsAttention(&amp;#039;U&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.idproposal()&lt;br /&gt;
	local property = frame.args.property or &amp;#039;&amp;#039;&lt;br /&gt;
	local out = &amp;#039;&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Wikidata property: &amp;#039; .. frame:expandTemplate{title=&amp;#039;Wikidata property link&amp;#039;, args={&amp;#039;P&amp;#039; .. property}} .. &amp;#039;&amp;lt;/li&amp;gt;&amp;#039;&lt;br /&gt;
	out = out .. &amp;#039;&amp;lt;li&amp;gt;Section: &amp;#039;&lt;br /&gt;
	local section = frame.args.section or &amp;#039;&amp;#039;&lt;br /&gt;
	if section~=&amp;#039;&amp;#039; then&lt;br /&gt;
		out = out .. config.sections[section].name .. &amp;#039; (&amp;#039; .. section .. &amp;#039;)&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		out = out .. &amp;#039;Not specified&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	out = out .. &amp;#039;&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;Link: &amp;#039;&lt;br /&gt;
	local link = frame.args.link or &amp;#039;&amp;#039;&lt;br /&gt;
	if link==&amp;#039;&amp;#039; then&lt;br /&gt;
		link = mw.wikibase.getBestStatements(&amp;#039;P&amp;#039; .. property, &amp;#039;P1630&amp;#039;) or &amp;#039;&amp;#039;&lt;br /&gt;
		link = link[1].mainsnak.datavalue.value&lt;br /&gt;
	end	&lt;br /&gt;
	if link~=&amp;#039;&amp;#039; then&lt;br /&gt;
		out = out .. &amp;#039;&amp;lt;code&amp;gt;&amp;#039; .. link .. &amp;#039;&amp;lt;/code&amp;gt;&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		out = out .. &amp;#039;Not specified&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	out = out .. &amp;#039;&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;Label: &amp;#039;&lt;br /&gt;
	local label = frame.args.label or &amp;#039;&amp;#039;&lt;br /&gt;
	if label~=&amp;#039;&amp;#039; then&lt;br /&gt;
		out = out .. label&lt;br /&gt;
	else&lt;br /&gt;
		out = out .. &amp;#039;Not specified&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	out = out .. &amp;#039;&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;Example: &amp;#039;&lt;br /&gt;
	local example = mw.wikibase.getBestStatements(&amp;#039;P&amp;#039;..property,&amp;#039;P1855&amp;#039;) or &amp;#039;&amp;#039;&lt;br /&gt;
	if example then&lt;br /&gt;
		example = example[1].qualifiers[&amp;#039;P&amp;#039;..property][1].datavalue.value&lt;br /&gt;
		example = frame:expandTemplate{title = &amp;#039;Hlist&amp;#039;, args = {makelink({[1]=&amp;#039;&amp;#039;, link=link, label=label}, example)}}&lt;br /&gt;
		out = out .. example&lt;br /&gt;
	else&lt;br /&gt;
		out = out .. &amp;#039;Not available&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	out = out .. &amp;#039;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;#039;&lt;br /&gt;
	return out&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>wikipedia&gt;MSGJ</name></author>
	</entry>
</feed>