モジュール:Authority control/config

提供:ManyoWiki

このモジュールについての説明文ページを モジュール:Authority control/config/doc に作成できます

require('strict')
local p = {}

--[[==========================================================================]]
--[[                      Property formatting functions                       ]]
--[[==========================================================================]]
function p.botanistV(id)
	return mw.ustring.match(id,"^[%u%l%d%. '-]+$")
end

function p.bnfLink(id,label)
	if not id:match( '^c?b?%d%d%d%d%d%d%d%d[0-9bcdfghjkmnpqrstvwxz]$' ) then
		return false
	end
	if not id:match( '^cb.+$' ) then --add cb prefix if it has been removed
		id = 'cb'..id
	end
	return '[https://catalogue.bnf.fr/ark:/12148/'..id..' '..(label or 'フランス')..'] [https://data.bnf.fr/ark:/12148/'..id..' (データ)]'
end

function p.dbiV(id)
	local part1, part2;
	if id:find ('_res', 1, true) then
		part1, part2 = id:match ('([^_]+)(_res.+)');						-- split at constant '_res'; part 2 nil when no constant '_res'
	else
		part1 = id;															-- part2 not in target
	end
	if part1:find ('[^%-%l]') then											-- if <part1> has anything but lowercase letters and hyphens
		return false;														-- invalid so return false
	else																	-- here when <part1> has only lowercase letters and hyphens
		if part1:match ('^%-') or part1:match ('%-$') then					-- first and last characters in <part1> must be lowercase letters
			return false;													-- invalid so return false
		end
	end
	if part2 then
		if not part2:match ('^_res%-%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$') then
			return false;													-- invalid so return false
		end
	end
	return id
end

--Validate ISNI (and ORCID) and retuns it as a 16 characters string or returns false if it's invalid
--See http://support.orcid.org/knowledgebase/articles/116780-structure-of-the-orcid-identifier
function p.validateIsni(id)
	--P213 (ISNI) format regex: [0-9]{4} [0-9]{4} [0-9]{4} [0-9]{3}[0-9X] (e.g. 0000-0000-6653-4145)
	--P496 (ORCID) format regex: 0000-000(1-[5-9]|2-[0-9]|3-[0-4])\d{3}-\d{3}[\dX] (e.g. 0000-0002-7398-5483)
	id = id:gsub( '[ %-]', '' ):upper()
	if not id:match( '^%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d[%dX]$' ) then
		return false
	end
	local total = 0
	for i = 1, 15 do
		local digit = id:byte( i ) - 48 --Get integer value
		total = (total + digit) * 2
	end
	local remainder = total % 11
	local result = (12 - remainder) % 11
	local checkdigit
	if result == 10 then
		checkdigit = 'X'
	else
		checkdigit=tostring( result )
	end
	if checkdigit ~= string.char( id:byte( 16 ) ) then
		return false
	end
	return id
end

local function splitLccn(id)
	--P244's format regex: (n|nb|nr|no|ns|sh)([4-9][0-9]|00|20[0-1][0-9])[0-9]{6} (e.g. n78039510)
	if id:match( '^%l%l?%l?%d%d%d%d%d%d%d%d%d?%d?$' ) then
		id = id:gsub( '^(%l+)(%d+)(%d%d%d%d%d%d)$', '%1/%2/%3' )
	end
	if id:match( '^%l%l?%l?/%d%d%d?%d?/%d+$' ) then
		return mw.text.split( id, '/' )
	end
	return false
end

function p.lccnV(id)
	local function append(str, c, length)
		while str:len() < length do
			str = c..str
		end
		return str
	end
	local parts = splitLccn(id) --e.g. n78039510
	if not parts then
		return false
	end
	local lccnType = parts[1] ~= 'sh' and 'names' or 'subjects'
	return lccnType .. '/' .. parts[1] .. parts[2] .. append( parts[3], '0', 6 )
end

function p.WorldCatLCCN(id)
	local lccnParts = splitLccn(id)
	if lccnParts and lccnParts[1] ~= 'sh' then
		return lccnParts[1]..lccnParts[2]..'-'..lccnParts[3]
	else
		return false
	end
end

				
function p.orcidV(id)
	id = p.validateIsni(id)
	if not id then
		return false
	end
	return id:sub( 1, 4 )..'-'..id:sub( 5, 8 )..'-'..id:sub( 9, 12 )..'-'..id:sub( 13, 16 )
end

function p.tlsV(id)
	id = id:gsub(' +', '_')
	local idlen = mw.ustring.len(id)
	if idlen < 4 or idlen > 90 then
		return false
	end
	local regex = '^%u'..string.rep("[%w_',%.%-%(%)%*%/–&]", idlen - 1)..'$'
	if not mw.ustring.match(id,regex ) then
		return false
	end
	return id
end

function p.uscgLink(id)
	local id2 = id:match( '^[1-7]%-%d%d?%d?%d?%d?$' ) or id:match( '^[1-7]%-%d%d?%d?%d?%d?%.%d*[1-9]$' )
	if id2 then
		return '[https://www.navcen.uscg.gov/pdf/lightlists/LightList%20V'..mw.ustring.sub(id2,1,1)..'.pdf '..id2..']'
	else
		return false
	end
end

function p.vcbaV(id)
	if not id:match( '^%d%d%d\/[1-9]%d?%d?%d?%d?%d?$' ) then
		return false
	end
	return id:gsub('\/', '_')
end

function p.worldcatidV(id)
	if not id:match( '^viaf%-%d+$' ) and
	   not id:match( '^lccn%-n[a-z]?[0-9%-]+$' ) and
	   not id:match( '^n[cps]%-.+$' ) then
		return false
	end
	return mw.uri.encode(id, 'PATH')
end

function p.zbmathV(id)
	local ps = {'%l[%l%-]*', '%.%l[%l%-]*', '%.%d*'}
	return id:match( '^'..ps[1]..'$' ) -- prefix with no capture options
	   or id:match( '^'..ps[1]..ps[2]..'$' ) -- prefix with first capture option
	   or id:match( '^'..ps[1]..ps[3]..'$' ) -- prefix with second capture option
	   or id:match( '^'..ps[1]..ps[2]..ps[3]..'$' ) -- prefix and both capture options
end

p.config = {
	{ 'AAG',
		property = 3372,
		section = 3,
		example = '1',
		link = 'https://www.aucklandartgallery.com/explore-art-and-ideas/artist/$1/',
		label = 'オークランド',
		pattern = '^%d+$',
		regex = '\d+'
	},
	{ 'ACM-DL',
		property = 864,
		section = 6,
		example = '12345678901',
		pattern = '^%d%d%d%d%d%d%d%d%d%d%d$',
		link = 'https://dl.acm.org/profile/$1',
		label = '計算機協会',
		idlink = 'ACM DL (識別子)',
		regex = '\d{11}'
	},
	{ 'ADB',
		property = 1907,
		section = 5,
		example = 'barton-sir-edmund-toby-71',
		patterns = {'^[a-z][-a-z]+-[1-3]%d%d?%d?%d?$', '^[a-z][-a-z]+-[1-9]%d?%d?%d?$'},
		link = 'http://adb.anu.edu.au/biography/$1',
		label = 'オーストラリア',
	},
	{ 'admiralty',
		property = 3562,
		patterns = {'^[A-Q]%d%d%d%d$', '^[A-Q]%d%d%d%d%.%d+$'},
		section = 7,
		example = 'D1204.1',
		prefix = '[[Admiralty (識別子)|Admiralty]]'
	},
	{ 'AGSA',
		property = 6804,
		section = 3,
		example = '3625',
		pattern = '^[1-9]%d*$',
		link = 'https://www.agsa.sa.gov.au/collection-publications/collection/creators/_/$1/',
		label = '南オーストラリア',
		regex = '[1-9]\d*'
	},
	{ 'ARLHS',
		property = 2980,
		section = 7,
		example = 'LAT023',
		pattern = '^[A-Z][A-Z][A-Z]%d%d%d%d?[A-Z]?$',
		link = 'http://wlol.arlhs.com/lighthouse/$1.html',
		label = 'ARLHS',
		regex = '[A-Z]{3}\d{3,4}[A-Z]?',
	},
	{ 'autores.uy',
		property = 2558,
		section = 5,
		example = '12345',
		pattern = '^[1-9]%d?%d?%d?%d?$',
		link = 'https://autores.uy/autor/$1',
		label = 'ウルグアイ',
		regex = '[1-9]\d{0,4}',
	},
	{ 'AWR',
		property = 4186,
		section = 5,
		example = 'PR00768b',
		patterns = {'^[A-Z][A-Z][A-Z]%d%d%d%d[a-z]$', '^[A-Z][A-Z]%d%d%d%d%d[a-z]$'},
		link = 'http://www.womenaustralia.info/biogs/$1.htm',
		regex = '[A-Z]{3}\d{4})|([A-Z]{2}\d{5}',
		label = 'Australian Women\'s Register',
	},
	{ 'BIBSYS',
		property = 1015,
		section = 2,
		example = '1234567890123',
		patterns = {'^[1-9]%d?%d?%d?%d?%d?%d?%d?%d?$', '^[1-9]%d%d%d%d%d%d%d%d%d%d%d%d$'},
		valid = p.bibsysV,
		link = 'https://authority.bibsys.no/authority/rest/authorities/html/$1',
		label = 'ノルウェー',
	},
	{ 'Bildindex', 
		property = 2092,
		section = 4,
		example = '1',
		pattern = '^%d+$',
		link = 'https://www.bildindex.de/document/obj$1',
		label = 'Bildindex (Germany)',
		regex = '\d+'
	},
	{ 'BNC',
		property = 1890,
		section = 2,
		example = '123456789',
		pattern = '^%d%d%d%d%d%d%d%d%d$',
		link = 'http://www.bncatalogo.cl/F?func=direct&local_base=red10&doc_number=$1',
		label = 'チリ',
		regex = '\d{9}'
	},
	{ 'BNE', 
		property = 950,
		section = 2,
		example = 'XX1234567',
		patterns = {'^[XF][XF]%d%d%d%d%d?%d?%d?$', '^a%d%d%d%d%d?%d?%d?$', '^bi[mcsv][aoei]%d%d%d%d%d%d%d%d%d%d$', '^Mi[sm][eoa]%d%d%d%d%d%d%d%d%d%d$'},
		link = 'http://catalogo.bne.es/uhtbin/authoritybrowse.cgi?action=display&authority_id=$1',
		label = 'スペイン',
		regex = '(XX|FF|a)\d{4,7}|(bima|bimo|bica|bis[eo]|bivi|Mise|Mimo|Mima)\d{10}'
	},
	{ 'BNF',
		property = 268,
		section = 2,
		example = '123456789',
		regex = '\d{8}[0-9bcdfghjkmnpqrstvwxz]',
		link2 = p.bnfLink,
	},
	{ 'BNMM',
		property = 3788,
		section = 2,
		example = '000024044',
		pattern = '^%d%d%d%d%d%d%d%d%d$',
		link = 'https://catalogo.bn.gov.ar/F/?func=direct&local_base=BNA10&doc_number=$1',
		label = 'アルゼンチン',
		regex = '\d{9}'
	},
	{ 'Botanist',
		property = 428,
		section = 6,
		example = 'L.',
		valid = p.botanistV,
		link = 'https://www.ipni.org/ipni/advAuthorSearch.do?find_abbreviation=$1',
		label = 'International Plant Names Index',
		regex = "('t )?(d')?(de )?(la )?(van (der )?)?(Ma?c)?(De)?(Di)?\p{Lu}?C?['\p{Ll}]*([-'. ]*(van )?(y )?(d[ae][nr]?[- ])?(Ma?c)?[\p{Lu}bht]?C?['\p{Ll}]*)*\.? ?f?\.?"
	},
	{ 'BPN',
		property = 651,
		section = 5,
		example = '12345678',
		patterns = {'^%d%d%d%d%d%d%d%d$', '^0?%d%d%d%d%d%d%d$', '^0?0?%d%d%d%d%d%d$'},
		link = 'http://www.biografischportaal.nl/en/persoon/$1',
		label = 'オランダ',
		regex = '\d{6,8}'
	},
	{ 'CANTICN',
		property = 9984,
		section = 2,
		example = '981058515460906706',
		pattern = '^981[0-1]%d%d%d%d%d%d%d%d%d06706$',
		link = 'https://cantic.bnc.cat/registre/$1',
		label = 'カタルーニャ',
		regex = '981(0|1)\d{9}06706'
	},
	{ 'CANTIC',
		property = 1273,
		section = 2,
		example = 'a12345678',
		pattern = '^a%d%d%d%d%d%d%d[%dx]$',
		link = 'http://cantic.bnc.cat/registres/CUCId/$1',
		label = 'カタルーニャ',
		regex = 'a\d{7}[0-9x]',
		suppressedbyproperty = {9984}--don't show CANTIC if CANTICN is present, since they both go to the Library of Catalonia and the library has deprecated CANTIC IDs in favor of CANTICN IDs
	},
	{ 'CCG',
		property = 3920,
		section = 7,
		example = 'A1761',
		patterns = {'^[NAIP]?[1-9]%d*$', '^[NAIP]?[1-9]%d*%.%d+$'},
		prefix = '[[CCG (識別子)|CCG]]',
		regex = '([NAIP])?[1-9]\d*(\.\d+)?'
	},
	{ 'CINII',
		property = 271,
		section = 6,
		example = 'DA12345678',
		pattern = '^DA%d%d%d%d%d%d%d[%dX]$',
		idlink = 'CiNii (識別子)',
		link = 'https://ci.nii.ac.jp/author/$1?l=ja',
		label = 'CiNii(日本)',
		regex = 'DA\d{7}[\dX]'
	},
	{ 'CWGC',
		property = 1908,
		section = 8,
		example = '1234567',
		pattern = '^[1-9]%d*$',
		link = 'https://www.cwgc.org/find-war-dead/casualty/$1/',
		label = 'コモンウェルス戦争墓地委員会',
		regex = '[1-9]\d*'
	},
	{ 'DAAO',
		property = 1707,
		section = 4,
		example = 'rolf-harris',
		pattern = '^[a-z%-]+%d*$',
		link = 'https://www.daao.org.au/bio/$1',
		label = 'オーストラリアのアーティスト',
		regex = '[a-z\-]+\d*'
	},
	{ 'DBI',
		property = 1986,
		section = 5,
		example = 'dante-alighieri',
		valid = p.dbiV,
		link = 'https://www.treccani.it/enciclopedia/$1_(Dizionario-Biografico)',
		label = 'イタリアの人物',
		regex = '[a-z]+(\-[a-z]+)*(_res\-[0-9a-f]{8}(\-[0-9a-f]{4}){3}\-[0-9a-f]{12})?'
	},
	{ 'DBLP',
		property = 2456,
		section = 6,
		example = '89/4185-p',
		patterns = {'^%d%d%d?%/%d+-?[%d]*[%a]*-?[%d]*$', '^[%a]+%/[%w]*-?[%d]*$'},
		link = 'https://dblp.org/pid/$1',
		label = 'DBLP(コンピュータ科学)',
		regex = '\d{2,3}\/\d+(-\d+)?[a-zA-Z-]*(-\d+)?|[a-z]\/[0-9A-Za-z]*(-\d+)?'
	},
	{ 'DIB',
		property = 6829,
		section = 5,
		example = '001953',
		pattern = '^0[01]%d%d%d%d%.?[A-D]?$',
		link = 'https://dib.cambridge.org/viewReadPage.do?articleId=$1',
		label = 'アイルランド',
		regex = '0[01]\d{4}(\.[A-D])?'
	},
	{ 'DSI',
		property = 2349,
		section = 4,
		example = '1538',
		pattern = '^[1-9]%d*$',
		link = 'http://www.uni-stuttgart.de/hi/gnt/dsi2/index.php?table_name=dsi&function=details&where_field=id&where_value=$1',
		label = '科学画家',
		regex = '[1-9]\d*'
	},
	{ 'DTBIO',
		property = 7902,
		section = 5,
		example = '118554700',
		pattern = '^1[0-9]%d%d%d%d%d%d%d?[0-9X]$',
		link = 'https://www.deutsche-biographie.de/pnd$1.html?language=en',
		label = 'ドイツ',
		regex = '1[0-9]{7,8}[0-9X]'
	},
	{ 'EMU',
		property = 4613,
		section = 2,
		example = '15409',
		pattern = '^%d%d?%d?%d?%d?%d?$',
		link = 'http://esu.com.ua/search_articles.php?id=$1',
		label = 'ウクライナ',
		regex = '\d{1,6}'
	},
	{ 'FAST',
		property = 2163, 
		section = 8,
		example = '1916996',
		pattern = '^[1-9]%d?%d?%d?%d?%d?%d?%d?$',
		link = 'http://id.worldcat.org/fast/$1/',
		label = 'Faceted Application of Subject Terminology',
		regex = '[1-9]\d{0,7}'
	},
	{ 'FNZA',
		property = 6792,
		section = 4,
		example = '9785',
		pattern = '^[1-9]%d*$',
		link = 'https://findnzartists.org.nz/artist/$1/',
		label = 'ニュージーランドのアーティスト',
		regex = '[1-9]\d*'
	},
	{ 'GND',
		property = 227,
		section = 2,
		example = '4079154-3',
		patterns = {'^1[012]?%d%d%d%d%d%d%d[0-9X]$', '^[47]%d%d%d%d%d%d%-%d$', '^[1-9]%d?%d?%d?%d?%d?%d?%d?%-[0-9X]$', '^3%d%d%d%d%d%d%d[0-9X]$'},
		link = 'https://d-nb.info/gnd/$1',
		label = 'ドイツ',
		regex = '1[012]?\d{7}[0-9X]|[47]\d{6}-\d|[1-9]\d{0,7}-[0-9X]|3\d{7}[0-9X]'
	},
	{ 'Google Scholar',
		property = 1960,
		section = 6,
		example = 'QPdLuj8AAAAJ',
		pattern = '^[%-_%d%l%u][%-_%d%l%u][%-_%d%l%u][%-_%d%l%u][%-_%d%l%u][%-_%d%l%u][%-_%d%l%u][%-_%d%l%u][%-_%d%l%u][%-_%d%l%u][%-_%d%l%u][%-_%d%l%u]$',
		link = 'https://scholar.google.com/citations?user=$1',
		label = 'Google Scholar',
		regex = '[-_0-9A-Za-z]{12}'
	},
	{ 'HDS',
		property = 902,
		section = 8,
		example = '050123',
		pattern = '^%d%d%d%d%d%d$',
		label = 'スイス歴史辞典',
		link = 'https://hls-dhs-dss.ch/fr/articles/$1',
		regex = '\d{6}'
	},
	{ 'IAAF',
		property = 1146,
		section = 8,
		example = '123',
		pattern = '^%d+$',
		link = 'https://www.iaaf.org/athletes/_/$1',
		label = 'ワールドアスレティックス',
		regex = '[0-9][0-9]*'
	},
	{ 'ICCU',
		property = 396,
		section = 2,
		example = 'CFIV000163',
		pattern = '^%u%u[%u0-3]V%d%d%d%d%d%d$',
		link = 'https://opac.sbn.it/nome/$1',
		label = 'イタリア',
		regex = '\D{2}[A-Z0-3]V\d{6}'
	},
	{ 'ICIA',
		property = 1736,
		section = 4,
		example = '1',
		pattern = '^%d+$',
		link = 'https://www.imj.org.il/artcenter/newsite/en/?artist=$1',
		label = 'ICIA(イスラエル)',
		regex = '\d+'
	},
	{ 'IEU',
		property = 9070,
		section = 8,
		example = 'N\\A\\NationalAcademyofArtandArchitecture',
		pattern = '^[A-Z]\\[A-Z]\\%w+$',
		link = 'http://www.encyclopediaofukraine.com/display.asp?linkpath=pages\\$1',
		label = 'ウクライナ・インターネット百科事典',
		regex = '[A-Z]\\[A-Z]\\[A-Za-z0-9]+'
	},
	{ 'ISNI',
		property = 213,
		section = 1,
		example = '0000-0000-6653-4145',
		prefix = '[[ISNI (識別子)|ISNI]]',
		valid = p.validateIsni,
		link = 'https://isni.org/isni/$1',
		regex = '[0-9]{4} [0-9]{4} [0-9]{4} [0-9]{3}[0-9X]'
	},
	{ 'J9U',
		property = 8189,
		section = 2,
		example = '987007305652505171',
		pattern = '^9870[0-1]%d%d%d%d%d%d%d%d05171$',
		link = 'http://uli.nli.org.il/F/?func=find-b&local_base=NLX10&find_code=UID&request=$1',
		label = 'イスラエル',
		regex = '9870(0|1)\d{8}05171'
	},
	{ 'Joconde',
		property = 347,
		section = 4,
		example = '12345678901',
		pattern = '^'..string.rep('[%-0-9A-Za-z]', 11)..'$',
		link = 'https://www.pop.culture.gouv.fr/notice/joconde/$1',
		label = 'Joconde(フランス)',
		regex = '[\-0-9A-Za-z]{11}'
	},
	{ 'KULTURNAV',
		property = 1248,
		section = 4,
		example = '12345678-1234-1234-1234-1234567890AB',
		idlink = ':en:KulturNav (identifier)',
		pattern = '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$',
		link = 'http://kulturnav.org/$1',
		label = 'KulturNav(ノルウェー)',
		regex = '[0-9a-f]{8}\-[0-9a-f]{4}\-[0-9a-f]{4}\-[0-9a-f]{4}\-[0-9a-f]{12}'
	},
	{ 'LCCN',
		property = 244,
		section = 2,
		example = 'n78039510',
		valid = p.lccnV,
		link = 'https://id.loc.gov/authorities/$1',
		label = 'アメリカ',
	},
	{ 'LIR',
		property = 886,
		section = 8,
		example = '1',
		pattern = '^%d+$',
		link = 'http://www.e-lir.ch/e-LIR___Lexicon.$1.450.0.html',
		label = 'Lexicon Istoric Retic(スイス)',
		regex = '\d+'
	},
	{ 'LNB',
		property = 1368,
		section = 2,
		example = '123456789',
		pattern = '^%d%d%d%d%d%d%d%d%d$',
		link = 'https://kopkatalogs.lv/F?func=direct&local_base=lnc10&doc_number=$1&P_CON_LNG=ENG',
		label = 'ラトビア',
		regex = '\d{9}'
	},
	{ 'Marina Militare',
		property = 3863,
		section = 7,
		example = '3856',
		pattern = '^[1-9]%d*$',
		link = 'http://www.marina.difesa.it/cosa-facciamo/per-la-difesa-sicurezza/fari/Pagine/$1.aspx',
		label = 'イタリア',
		regex = '[1-9]\d*'
	},
	{ 'MarineTraffic',
		property = 3601,
		section = 7,
		example = '1000004707',
		pattern = '^%d%d%d%d%d%d%d%d%d%d$',
		link = 'https://www.marinetraffic.com/en/ais/details/lights/$1',
		label = 'マリントラフィック',
		regex = '\d{10}'
	},
	{ 'MATHSN',
		property = 4955,
		section = 6,
		example = '175270',
		pattern = '^[1-9]%d%d%d%d%d?%d?$',
		link = 'https://mathscinet.ams.org/mathscinet/MRAuthorID/$1',
		label = 'MathSciNet',
		regex = '[1-9]\d{4,6}'
	},
	{ 'MBA',
		property = 434,
		section = 8,
		example = '12345678-1234-1234-1234-1234567890AB',
		category = 'MusicBrainz',
		pattern = '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$',
		link = 'https://musicbrainz.org/artist/$1',
		prefix = '[[MBA (識別子)|MusicBrainz]]',
		label = 'アーティスト',
		regex = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'
	},
	{ 'MBAREA',
		property = 982,
		section = 8,
		example = '12345678-1234-1234-1234-1234567890AB',
		category = 'MusicBrainz地域',
		pattern = '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$',
		prefix = '[[MBAREA (識別子)|MusicBrainz]]',
		link = 'https://musicbrainz.org/area/$1',
		label = '地域',
		regex = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'
	},
	{ 'MBI',
		property = 1330,
		section = 8,
		example = '12345678-1234-1234-1234-1234567890AB',
		category = 'MusicBrainz楽器',
		pattern = '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$',
		link = 'https://musicbrainz.org/instrument/$1',
		label = '楽器',
		prefix = '[[MBI (識別子)|MusicBrainz]]',
		regex = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'
	},
	{ 'MBL',
		property = 966,
		section = 8,
		example = '12345678-1234-1234-1234-1234567890AB',
		category = 'MusicBrainzレーベル',
		pattern = '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$',
		prefix = '[[MBL (識別子)|MusicBrainz]]',
		label = 'レーベル',
		link = 'https://musicbrainz.org/label/$1',
		regex = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'
	},
	{ 'MBP',
		property = 1004,
		section = 8,
		example = '12345678-1234-1234-1234-1234567890AB',
		category = 'MusicBrainz場所',
		pattern = '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$',
		link = 'https://musicbrainz.org/place/$1',
		label = '場所',
		prefix = '[[MBP (識別子)|MusicBrainz]]',
		regex = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'
	},
	{ 'MBRG',
		property = 436,
		section = 8,
		example = '12345678-1234-1234-1234-1234567890AB',
		category = 'MusicBrainzリリース・グループ',
		pattern = '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$',
		link = 'https://musicbrainz.org/release-group/$1',
		label = 'リリース・グループ',
		prefix = '[[MBRG (識別子)|MusicBrainz]]',
		regex = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'
	},
	{ 'MBS',
		property = 1407,
		section = 8,
		example = '12345678-1234-1234-1234-1234567890AB',
		category = 'MusicBrainzシリーズ',
		pattern = '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$',
		link = 'https://musicbrainz.org/series/$1',
		label = 'シリーズ',
		prefix = '[[MBS (識別子)|MusicBrainz]]',
		regex = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'
	},
	{ 'MBW',
		property = 435,
		section = 8,
		example = '12345678-1234-1234-1234-1234567890AB',
		category = 'MusicBrainz作品',
		pattern = '^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$',
		link = 'https://musicbrainz.org/work/$1',
		label = '作品',
		prefix = '[[MBW (識別子)|MusicBrainz]]',
		regex = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'
	},
	{ 'MGP',
		property = 549,
		section = 6,
		example = '123456',
		pattern = '^%d%d?%d?%d?%d?%d?$',
		link = 'https://www.mathgenealogy.org/id.php?id=$1',
		label = 'Mathematics Genealogy Project',
		regex = '\d{1,6}'
	},
	{ 'NARA',
		property = 1225,
		section = 8,
		example = '12345678',
		pattern = '^[1-9]%d?%d?%d?%d?%d?%d?%d?%d?$',
		link = 'https://catalog.archives.gov/id/$1',
		label = '公文書館(アメリカ)',
		regex = '^([1-9]\d{0,8})$'
	},
	{ 'NCL',
		property = 1048,
		section = 2,
		example = '1081436',
		pattern = '^%d+$',
		link = 'http://aleweb.ncl.edu.tw/F/?func=accref&acc_sequence=$1&CON_LNG=ENG',
		label = '台湾',
		regex = '\d+'
	},
	{ 'NDL',
		property = 349,
		section = 2,
		example = '012345678',
		link = 'https://id.ndl.go.jp/auth/ndlna/$1',
		patterns = {'^a1%d?%d%d%d%d%d%d%d%d', '^s?%d?%d%d%d%d%d%d%d%d'},
		label = '日本',
		regex = '(a1|s)?[0-9]?\d{8}',
	},
	{ 'NGA',
		property = 3563,
		section = 7,
		example = '114-7721.2',
		pattern = '^11[0-6]%-%d+%.?%d*$',
		link = 'https://wikidata-externalid-url.toolforge.org/?url=https%3A%2F%2Fmsi.nga.mil%2FqueryResults%3Fpublications%2Fngalol%2Flights-buoys%3Fvolume%3D%251%26featureNumber%3D%252%26includeRemovals%3Dfalse%26output%3Dhtml&exp=(%5Cd%7B3%7D)-(.*)&id=$1',
		label = 'NGA',
		regex = '11[0-6]-\d+(\.\d+)?'
	},
	{ 'NGV',
		property = 2041,
		section = 3,
		example = '12354',
		pattern = '^%d+$',
		link = 'https://www.ngv.vic.gov.au/explore/collection/artist/$1/',
		label = 'ヴィクトリア',
		regex = '\d+'
	},
	{ 'NKC',
		property = 691,
		section = 2,
		example = 'abcd12345678901234',
		pattern = '^[a-z][a-z][a-z]?[a-z]?%d%d%d?%d?%d?%d?%d?%d?%d?%d?%d?%d?%d?%d?$',
		regex = '[a-z]{2,4}[0-9]{2,14}',
		link = 'https://aleph.nkp.cz/F/?func=find-c&local_base=aut&ccl_term=ica=$1&CON_LNG=ENG',
		label = 'チェコ',
	},
	{ 'NLA',
		property = 409,
		section = 2,
		example = '123456789012',
		pattern = '^[1-9]%d?%d?%d?%d?%d?%d?%d?%d?%d?%d?%d?$',
		regex = '[1-9][0-9]{0,11}',
		link = 'https://nla.gov.au/anbd.aut-an$1',
		label = 'オーストラリア',
	},
	{ 'NLG',
		property = 3348,
		section = 2,
		example = '12345678',
		regex = '[1-9]\d*',
		pattern = '^[1-9]%d*$',
		link = 'https://data.nlg.gr/resource/authority/record$1',
		label = 'ギリシャ',
	},
	{ 'NLK',
		property = 5034,
		section = 2,
		example = 'KAB197000000',
		regex = '(KAB|KAC|KSH)([0-9]{4}|[0-9]{4}[a-zA-Z])[0-9]{4,6}',
		link = 'https://lod.nl.go.kr/resource/$1',
		label = '韓国',
		patterns = {'^KAB%d%d%d%d%a?%d%d%d%d%d?%d?$', '^KAC%d%d%d%d%a?%d%d%d%d%d?%d?$', '^KSH%d%d%d%d%a?%d%d%d%d%d?%d?$'},
	},
	{ 'NLR',
		property = 1003,
		section = 2,
		example = '123456789',
		pattern = '^%d%d%d%d%d%d%d%d%d$',
		link = 'http://aleph.bibnat.ro:8991/F/?func=direct&local_base=NLR10&doc_number=$1',
		label = 'ルーマニア',
		regex = '\d{9}'
	},
	{ 'NSK',
		property = 1375,
		section = 2,
		example = '123456789',
		pattern = '^%d%d%d%d%d%d%d%d%d$',
		link = 'http://katalog.nsk.hr/F/?func=direct&doc_number=$1&local_base=nsk10',
		label = 'クロアチア',
		regex = '\d{9}'
	},
	{ 'NTA',
		property = 1006,
		section = 2,
		example = '12345678X',
		pattern = '^%d%d%d%d%d%d%d%d[%dX]$',
		link = 'http://data.bibliotheken.nl/id/thes/p$1',
		label = 'オランダ',
		regex = '\d{8}[\dX]'
	},
	{ 'ORCID',
		property = 496,
		section = 1,
		example = '0000-0002-7398-5483',
		prefix = '[[ORCID (識別子)|ORCID]]',
		valid=p.orcidV,
		link = 'https://orcid.org/$1',
	},
	{ 'PIC',
		property = 2750,
		section = 4,
		example = '1',
		pattern = '^[1-9]%d*$',
		link = 'https://pic.nypl.org/constituents/$1',
		label = 'Photographers\' Identities',
		regex = '[1-9]\d*'
	},
	{ 'PLWABN',
		property = 7293,
		section = 2,
		example = '9812345678905606',
		pattern = '^981%d%d%d%d%d%d%d%d05606*$',
		link = 'http://mak.bn.org.pl/cgi-bin/KHW/makwww.exe?BM=1&NU=1&IM=4&WI=$1',
		label = 'ポーランド',
		regex = '981[0-9]{8}05606'
	},
	{ 'NLP',
		property = 1695,
		section = 2,
		example = '9810123456789012345',
		patterns  = {'^9810%d+$', '^A%d%d%d%d%d%d%d[%dX]$'},
		link = 'https://tools.wmflabs.org/wikidata-externalid-url?p=1695&id=$1',
		label = 'ポーランド',
		regex = '9810[0-9]\d* or A[0-9]{7}[0-9X]',
		suppressedbyproperty = {7293}
	},
	{ 'Publons',
		property = 3829,
		section = 6,
		example = '2776255',
		pattern = '^%d+$',
		link = 'https://publons.com/author/$1/',
		label = 'Publons(研究者)',
		regex = '\d+'
	},
	{ 'RID',
		property = 1053,
		section = 6,
		example = 'A-1234-1934',
		patterns = {'^[A-Z][A-Z]?[A-Z]?%-%d%d%d%d%-19%d%d$', '^[A-Z][A-Z]?[A-Z]?%-%d%d%d%d%-20%d%d$'},
		link = 'https://www.researcherid.com/rid/$1',
		label = 'ResearcherID',
		regex = '[A-Z]{1,3}-\d{4}-(19|20)\d\d'
	},
	{ 'RISM',
		property = 5504,
		section = 8,
		example = 'pe30006410',
		prefix = '[[:en:RISM (identifier)|RISM(フランス)]]',
		patterns = {'^pe[1-9]%d*$', '^ks[1-9]%d*$', '^[1-9]%d*$'},
		link = 'https://opac.rism.info/search?id=$1',
		regex = '(pe|ks)?\[1-9]d*'
	},
	{ 'RERO',
		property = 3065,
		section = 8,
		example = '02-A012345678',
		prefix = '[[:en:RERO (identifier)|RERO(スイス)]]',
		pattern = '^0[1-2]%-[A-Z%d][A-Z%d]?[A-Z%d]?[A-Z%d]?[A-Z%d]?[A-Z%d]?[A-Z%d]?[A-Z%d]?[A-Z%d]?[A-Z%d]?$',
		link = 'http://data.rero.ch/$1',
		regex = '0[1-2]-[A-Z0-9]{1,10}'
	},
	{ 'RKDartists',
		property = 650,
		section = 4,
		example = '123456',
		pattern = '^[1-9]%d?%d?%d?%d?%d?$',
		link = 'https://rkd.nl/en/explore/artists/$1',
		label = 'RKDアーティスト(オランダ)',
		regex = '[1-9]\d{0,5}'
	},
	{ 'RKDID',
		property = 350,
		section = 4,
		example = '123456',
		pattern = '^[1-9]%d?%d?%d?%d?%d?$',
		link = 'https://rkd.nl/nl/explore/images/$1',
		label = 'RKD ID(オランダ)',
		regex = '[1-9]\d{0,5}'
	},
	{ 'RSL',
		property = 947,
		section = 2,
		example = '123456789',
		pattern = '^%d%d?%d?%d?%d?%d?%d?%d?%d?$',
		link = 'http://aleph.rsl.ru/F?func=find-b&find_code=SYS&adjacent=Y&local_base=RSL11&request=$1&CON_LNG=ENG',
		label = 'ロシア',
		regex = '\d{1,9}'
	},
	{ 'Scopus',
		property = 1153,
		section = 6,
		example = '7005487412',
		pattern = '^[1-9]%d%d%d%d%d%d%d%d%d%d?$',
		link = 'https://www.scopus.com/authid/detail.uri?authorId=$1',
		label = 'Scopus著者',
		regex = '[1-9]\d{9,10}'
	},
	{ 'SELIBR',
		property = 906,
		section = 2,
		example = '123456',
		pattern = '^[1-9]%d%d%d%d%d?$',
		link = 'https://libris.kb.se/auth/$1',
		label = 'スウェーデン',
		regex = '[1-9]\d{4,5}'
	},
	{ 'SIKART',
		property = 781,
		section = 4,
		example = '123456789',
		pattern = '^%d%d%d%d%d%d%d%d?%d?$',
		link = 'http://www.sikart.ch/KuenstlerInnen.aspx?id=$1&lng=en',
		label = 'SIKART(スイス)',
		regex = '\d{7,9}'
	},
	{ 'SNAC-ID',
		property = 3430,
		section = 8,
		example = 'A',
		pattern = '^%d*[A-Za-z][0-9A-Za-z]*$',
		link = 'https://snaccooperative.org/ark:/99166/$1',
		label = 'Social Networks and Archival Context',
		regex = '\d*[A-Za-z][0-9A-Za-z]*'
	},
	{ 'SUDOC',
		property = 269,
		section = 8,
		example = '026927608',
		prefix = '[[SUDOC (識別子)|SUDOC(フランス)]]',
		pattern = '^%d%d%d%d%d%d%d%d[%dxX]$',
		link = 'https://www.idref.fr/$1',
		regex = '(\d{8}[\dX]|)'
	},
	{ 'TA98',
		property = 1323,
		section = 6,
		example = 'A12.3.45.678',
		pattern = '^A%d%d%.%d%.%d%d%.%d%d%d[FM]?$',
		link = 'http://tools.wmflabs.org/wikidata-externalid-url/?p=1323&url_prefix=https:%2F%2Fwww.unifr.ch%2Fifaa%2FPublic%2FEntryPage%2FTA98%20Tree%2FEntity%20TA98%20EN%2F&url_suffix=%20Entity%20TA98%20EN.htm&id=$1',
		label = 'Terminologia Anatomica',
		regex = 'A\d{2}\.\d\.\d{2}\.\d{3}[FM]?'
	},
	{ 'TDVİA',
		property = 7314,
		section = 8,
		example = 'asim-b-behdele',
		pattern = '^[%d%l/-]+$',
		link = 'https://islamansiklopedisi.org.tr/$1',
		label = 'İslâm Ansiklopedisi',
		regex = '[0-9a-z/-]+'
	},
	{ 'TePapa',
		property = 3544,
		section = 3,
		example = '1',
		pattern = '^%d+$',
		link = 'https://collections.tepapa.govt.nz/agent/$1',
		label = 'Te Papa(ニュージーランド)',
		regex = '\d+' },
	{ 'TLS',
		property = 1362,
		section = 8,
		example = 'Abcd',
		regex="\p{Lu}[\p{L}\d_',\.\-\(\)\*\/–&]{3,89}",
		valid=p.tlsV,
		link = 'http://tls.theaterwissenschaft.ch/wiki/$1',
		label = 'Theaterlexikon(スイス)',
	},
	{ 'Trove',
		property = 1315,
		section = 8,
		example = '12345678',
		prefix = '[[:en:Trove (identifier)|Trove(オーストラリア)]]',
		pattern = '^[1-9]%d%d%d%d%d%d?%d?$',
		link = 'https://trove.nla.gov.au/people/$1',
		regex = '[1-9]\d{5,7}'
	},
	{ 'UKPARL',
		property = 6213,
		section = 8,
		example = 'AQUupyiR',
		pattern = '^[a-zA-Z%d][a-zA-Z%d][a-zA-Z%d][a-zA-Z%d][a-zA-Z%d][a-zA-Z%d][a-zA-Z%d][a-zA-Z%d]$',
		link = 'https://id.parliament.uk/$1',
		label = '英議会',
		regex = '[a-zA-Z\d]{8}'
	},
	{ 'ULAN',
		property = 245,
		section = 4,
		example = '500123456',
		pattern = '^500%d%d%d%d%d%d$',
		link = 'https://www.getty.edu/vow/ULANFullDisplay?find=&role=&nation=&subjectid=$1',
		label = 'アーティスト名(ゲティ)',
		regex = '500\d{6}'
	},
	{ 'USCG',
		property = 3723,
		section = 7,
		example = '6-0695',
		prefix = '[[USCG (識別子)|USCG]]',
		link2=p.uscgLink,
		regex = '[1-7]-\d{1,5}(.[1-9])?'
	},
	{ 'USCongress',
		property = 1157,
		section = 8,
		example = 'A000123',
		idlink = ':en:US Congress (identifier)',
		pattern = '^[A-Z]00[01]%d%d%d$',
		link = 'http://bioguide.congress.gov/scripts/biodisplay.pl?index=$1',
		label = '米議会',
		regex = '[A-Z]00[01]\d{3}'
	},
	{ 'VcBA',
		property = 8034,
		section = 2,
		example = '494/9793',
		valid = p.vcbaV,
		link = 'https://opac.vatlib.it/auth/detail/$1',
		label = 'バチカン',
		regex = '\d{3}\/[1-9]\d{0,5}'
	},
	{ 'VIAF',
		property = 214,
		section = 1,
		example = '123456789',
		prefix = '[[VIAF (識別子)|VIAF]]',
		patterns = {'^[1-9]%d%d?%d?%d?%d?%d?%d?%d?$', '^[1-9]%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d?%d?%d?$'},
		regex = '[1-9]\d(\d{0,7}|\d{17,20}',
		link = 'https://viaf.org/viaf/$1',
	},
	{ 'WORLDCATID',
		property = 7859,
		section = 1,
		example = 'lccn-n78-95332',
		idlink = 'WorldCat Identities (識別子)',
		valid = p.worldcatidV,
		link = 'https://www.worldcat.org/identities/$1/',
		label = 'WorldCat',
		regex = 'viaf-\d+|lccn-n[a-z]?[0-9\-]+|n[cps]-.+'
	},
	{ 'VIAF', --WorldCat (via VIAF)
		property = 214,
		section = 1,
		example = '123456789',
		patterns = {'^[1-9]%d%d?%d?%d?%d?%d?%d?%d?$', '^[1-9]%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d?%d?%d?$'},
		link = 'https://www.worldcat.org/identities/containsVIAFID/$1',
		label = 'WorldCat(VIAF経由)',
		suppressedbyproperty = {7859},
		category = 'WorldCat-VIAF',
		errorcat = 'VIAF',
		ignoreerrors = true
	},
	--{ 'LCCN', --WorldCat (via Library of Congress)
		--property = 244,
		--section = 1,
		--example = 'n78039510',
		--valid = p.WorldCatLCCN,
		--link = 'https://www.worldcat.org/identities/lccn-$1',
		--label = 'WorldCat(アメリカ国会図書館経由)',
		--suppressedbyproperty = {7859,214},
		--category = 'WorldCat-LCCN',
		--errorcat = 'LCCN',
		--ignoreerrors = true
	--},
	{ 'ZBMATH',
		property = 1556,
		section = 6,
		example = 'turing.alan-m',
		valid = p.zbmathV,
		link = 'https://zbmath.org/authors/?q=ai:$1',
		label = 'zbMATH',
		regex = '[a-z][a-z\-]*(\.[a-z][a-z\-]*)?(\.[0-9]*)?'
	},
}

-- Legitimate aliases to p.conf, for convenience
-- Format: { 'alias', 'parameter name in p.conf' }
p.aliases = {
	{ 'DNB', 'GND' }, --Deutsche Nationalbibliothek -> Gemeinsame Normdatei
	{ 'MusicBrainz', 'MBA' },
	{ 'MusicBrainz artist', 'MBA' },
	{ 'MusicBrainz label', 'MBL' },
	{ 'MusicBrainz release group', 'MBRG' },
	{ 'MusicBrainz work', 'MBW' },
	{ 'SBN', 'ICCU' }, --SBN alias to be deprecated at a later stage
	{ 'TDVIA', 'TDVİA' }, --alias name without diacritics
	{ 'tdvia', 'TDVİA' }, --lowercase variant without diacritics
}
-- Deprecated aliases to p.conf; tracked in [[Category:Articles with deprecated authority control identifiers]]
-- Format: { 'deprecated parameter name', 'replacement parameter name in p.conf' }
p.deprecated = {
	{ 'GKD', 'GND' },
	{ 'PND', 'GND' },
	{ 'RLS', 'RSL' },
	{ 'SWD', 'GND' },
	{ 'NARA-organization', 'NARA' },
	{ 'NARA-person', 'NARA' },
}
p.sectionNames = {
	'全般',					-- 1
	'国立図書館',			-- 2
	'美術館と博物館',		-- 3
	'美術研究組織',			-- 4
	'人名辞典',				-- 5
	'科学データベース',		-- 6
	'灯台',					-- 7
	'その他'				-- 8
}
return p