Modul:Authority control/bakpasir: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
Tidak ada ringkasan suntingan
Uzume (bicara | kontrib)
 
(10 revisi perantara oleh satu pengguna lainnya tidak ditampilkan)
Baris 1:
require('Module:No globalsstrict')
 
local p = {}
Baris 33:
 
function p.createRow( id, rawValues, link, links, withUid, specialCat, prefix)
local catName = 'Artikel Wikipedia dengan kesalahan penanda '..(specialCat or id)..' identifiers'
if links then -- all links[] use withUid = false; no check needed
local row = ''
if prefix then
row = row .. '*' .. prefix
end
for i, l in ipairs( links ) do
Baris 63:
--[[==========================================================================]]
 
-- If a link has a suitable entry in the global inter-wiki prefix table at [[:m:Interwiki_map]],
-- please consider routing through this prefix rather than as external link URL.
-- This will ease future maintenance as necessary updates to the link can be centrally carried out there rather than by updating this module.
-- The "external link" icon would disappear for such entries.
 
function p.aagLink( id, label)
Baris 82 ⟶ 85:
 
function p.adbLink( id, label )
--P1907's format regex: [a-z][-a-z]+-([1-23]\d|[1-9])\d{0,3} (e.g. barton-sir-edmund-toby-71)
if not id:match( '^[a-z][-a-z]+-[1-23]%d%d?%d?%d?$' ) and
not id:match( '^[a-z][-a-z]+-[1-9]%d?%d?%d?$' ) then
return false
Baris 161 ⟶ 164:
id = 'cb'..id
end
return '[https://catalogue.bnf.fr/ark:/12148/'..id..' ' .. (label or 'Prancis')..'] [https://data.bnf.fr/ark:/12148/'..id..' (data)]'..p.getCatForId( 'BNF' )
end
 
Baris 206 ⟶ 209:
end
return '[https://www.cwgc.org/find-war-dead/casualty/'..id..'/ '..(label or 'Commonwealth War Graves Commission')..']'..p.getCatForId( 'CWGC' )
end
 
function p.emuLink( id, label )
--P4613's format regex: \d{1,6} (e.g. 15409 (or 015409))
if not id:match( '^%d%d?%d?%d?%d?%d?$' ) then
return false
end
return '[http://esu.com.ua/search_articles.php?id='..id..' '..(label or 'Ukraina')..']'..p.getCatForId( 'EMU' )
end
 
Baris 334 ⟶ 345:
return false
end
return '[http://kulturnav.org/'..id..' '..(label or 'KulturNav (NorwegiaNorway)')..']'..p.getCatForId( 'KULTURNAV' ) --no https as of 9/2019
end
 
Baris 364 ⟶ 375:
 
function p.leonoreLink( id, label )
--P640's format regex: LH//\d{1,4}/\d{1,3}|19800035/\d{1,4}/\d{1,5}(Bis|Ter)?|C/0/\d{1,2} (e.g. LH//2064/18)
if not id:match( '^LH//%d%d?%d?%d?/%d%d?%d?$' ) and --IDs from LH//1/1 to LH//2794/54 (legionaries)
not id:match( '^19800035/%d%d?%d?%d?/%d%d?%d?%d?%d?$' ) and --IDs from 19800035/1/1 to 19800035/385/51670 (legionnaires who died 1954-1977 & some who died < 1954)
not id:match( '^C19800035/0%d%d?%d?%d?/%d%d?%d?%d?%d?Bis$' ) then and --IDs from C/0/1 to C/0/84 (84 famous legionaries)?
not id:match( '^19800035/%d%d?%d?%d?/%d%d?%d?%d?%d?Ter$' ) and --IDs from ?
not id:match( '^C/0/%d%d?$' ) then --IDs from C/0/1 to C/0/84 (84 famous legionaries)
return false
end
Baris 374 ⟶ 387:
 
function p.maLink( id, label )
--P6366's format regex: [1-9]\d{43,9} (e.g. 1498221862)
if not id:match( '^[1-9]%d%d%d%d?%d?%d?%d?%d?%d?$' ) then
return false
end
Baris 391 ⟶ 404:
return '['..url..' '..label..']'..cat
else
return '[[MBA (identifier)|MusicBrainz]] [' .. url .. ' artist]' .. cat
end
end
Baris 405 ⟶ 418:
return '['..url..' '..label..']'..cat
else
return '[[MBAREA (identifier)|MusicBrainz]] [' .. url .. ' area]' .. cat
end
end
Baris 419 ⟶ 432:
return '['..url..' '..label..']'..cat
else
return '[[MBI (identifier)|MusicBrainz]] [' .. url .. ' instrument]' .. cat
end
end
Baris 433 ⟶ 446:
return '['..url..' '..label..']'..cat
else
return '[[MBL (identifier)|MusicBrainz]] [' .. url .. ' label]' .. cat
end
end
Baris 447 ⟶ 460:
return '['..url..' '..label..']'..cat
else
return '[[MBP (identifier)|MusicBrainz]] [' .. url .. ' place]' .. cat
end
end
Baris 461 ⟶ 474:
return '['..url..' '..label..']'..cat
else
return '[[MBRG (identifier)|MusicBrainz]] [' .. url .. ' release group]' .. cat
end
end
Baris 475 ⟶ 488:
return '['..url..' '..label..']'..cat
else
return '[[MBS (identifier)|MusicBrainz]] [' .. url .. ' series]' .. cat
end
end
Baris 490 ⟶ 503:
return '['..url..' '..label..']'..cat
else
return '[[MBW (identifier)|MusicBrainz]] [' .. url .. ' work]' .. cat
end
end
Baris 737 ⟶ 750:
return false
end
returnlocal longurl = '[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='
return longurl..id..' '..(label or 'Terminologia Anatomica')..']'..p.getCatForId( 'TA98' )
end
 
Baris 747 ⟶ 761:
return '[https://islamansiklopedisi.org.tr/'..id..' '..(label or 'Encyclopedia of Islam')..']'..p.getCatForId( 'TDVİA' )
end
 
 
function p.tepapaLink( id, label )
Baris 760 ⟶ 775:
--P1362's format regex: \p{Lu}[\p{L}\d_',\.\-\(\)\*/–]{3,59} (e.g. Abcd)
local class = "[%a%d_',%.%-%(%)%*/–]"
local regex = "'^%u"'..string.rep(class, 3)..string.rep(class.."'?"', 56).."'$"'
if not mw.ustring.match( id, regex ) then
return false
Baris 814 ⟶ 829:
return false
end
-- If the "VIAF" entry at [[:m:Interwiki map]] would resolve to "https://viaf.org/viaf/$1" (rather than "http://viaf.org/viaf/$1", as it currently still does),
-- then the code below could change from '[https://viaf.org/viaf/'..id..' '..id..']' to '[[:VIAF:'..id..'|'..id..']]'.
return '[https://viaf.org/viaf/'..id..' '..(label or 'VIAF')..']'..p.getCatForId( 'VIAF' )
end
Baris 822 ⟶ 838:
function p.append(str, c, length)
while str:len() < length do
str = c .. str
end
return str
Baris 837 ⟶ 853:
local result = (12 - remainder) % 11
if result == 10 then
return "'X"'
end
return tostring( result )
Baris 890 ⟶ 906:
'! rowspan=2 | Parameter\n'..
'! rowspan=2 | Bagian\n'..
'! rowspan=2 | DitampikanDitampilkan sebagai\n'..
'! rowspan=2; data-sort-type=number | PropertiAtribut Wikidata\n'..
'! colspan=4 | Kategori pelacak dan jumlah halaman\n'..
'|-\n'..
'! [[:Kategori:Artikel Wikipedia dengan informasi pengawasan otoritas|'.. 'Artikel]]\n'..
'! [[:Kategori:Halaman pengguna dengan informasi pengawasan otoritas|'.. 'Halaman pengguna]]\n'..
'! [[:Kategori:Halaman dengan informasi pengawasan otoritas|'.. 'Halaman lain]]\n'..
'! [[:Kategori:Artikel Wikipedia dengan informasi pengawasan otoritas bermasalah|'.. 'ID bermasalah]]\n'..
'|-\n'
local lang = mw.getContentLanguage()
local a, u, m, f, P = 0, 0, 0, 0, 0 --cumulative sums
for _, conf in pairs( p.conf ) do
local param, pid, section = conf[1], conf[2], conf[4]
local appearsAs
if param == "'WORLDCATID"' then
-- WorldCat is special
appearsAs = "'[https://www.worldcat.org/identities/lccn-n78039510 WorldCat]"'
elseif conf.prefix then
appearsAs = conf.prefix
Baris 911 ⟶ 928:
appearsAs = conf[3](conf[5])
end
local link = conf.link or param .. ' (identifier)'
local category = conf.category or param
local args = { id = 'f', pid }
local wpl = frame:expandTemplate{ title = 'Wikidata property link', args = args }
--cats
local articleCat = 'Artikel Wikipedia dengan penanda '..category..' '
local userCat = 'Halaman pengguna dengan penanda '..category..' '
local miscCat = 'Halaman dengan penanda '..category..' '
local faultyCat = 'Artikel Wikipedia dengan dengan penanda '..category..' bermasalah'
--counts
Baris 925 ⟶ 942:
local miscCount = lang:formatNum( mw.site.stats.pagesInCategory(miscCat, 'pages') )
local faultyCount = lang:formatNum( mw.site.stats.pagesInCategory(faultyCat, 'pages') )
--calcs
P = P + 1 --property count
a = a + lang:parseFormattedNumber(articleCount)
u = u + lang:parseFormattedNumber(userCount)
m = m + lang:parseFormattedNumber(miscCount)
f = f + lang:parseFormattedNumber(faultyCount)
--concat
wikiTable = wikiTable..'\n'..
Baris 942 ⟶ 964:
local wcd = { 'WorldCat-LCCN', 'WorldCat-VIAF' }
for _, w in pairs(wcd) do
local articleCat = 'ArtikelArticles Wikipedia dengan penandawith '..w..' identifiers'
local articleCount = lang:formatNum( mw.site.stats.pagesInCategory(articleCat, 'pages') )
local appearsAs
if w == "'WorldCat-LCCN"' then
appearsAs = "'[https://www.worldcat.org/identities/lccn-n79-113947 WorldCat (via Library of Congress)]"'
else
appearsAs = "'[https://www.worldcat.org/identities/containsVIAFID/12345789 WorldCat (via VIAF)]"'
end
a = a + lang:parseFormattedNumber(articleCount)
wikiTable = wikiTable..'\n'..
'|-\n'..
Baris 956 ⟶ 979:
'||'..appearsAs..
'||data-sort-value='..w..'|'..'—'..
'||style="text-align: right;"|[[:Kategori:'..articleCat..'|'..articleCount..']]'..
'||style="text-align: right;"|—'..
'||style="text-align: right;"|—'..
Baris 962 ⟶ 985:
end
--append sums
return require("Module:Suppress categories").main(wikiTable)..'\n|}'
wikiTable = wikiTable..'\n'..
'|-\n'..
'! style="text-align: right;" colspan=3|Total'..
'||style="text-align: right;"|'..lang:formatNum(P)..
'||style="text-align: right;"|'..lang:formatNum(a)..
'||style="text-align: right;"|'..lang:formatNum(u)..
'||style="text-align: right;"|'..lang:formatNum(m)..
'||style="text-align: right;"|'..lang:formatNum(f)
return require("'Module:Suppress categories"').main(wikiTable)..'\n|}'
end
 
Baris 969 ⟶ 1.002:
--[[==========================================================================]]
 
-- IfPlease a specificuse "<parameter> (identifier) redirect" exists for an identifier, please route through this particular redirectredirects rather than linking directly to the target page. This reduces clutter in "What links here" and improves reverse lookup of articles where a manifestation of this particular identifier is used.
-- This reduces clutter in "What links here" on both the redirect and the target,
-- and improves reverse lookup of articles where a manifestation of each identifier is used.
 
-- Parameterp.conf table basic format: { 'parameter name', propertyId # in Wikidata, formatting/validation function, section, example ID for documentation }
 
-- p.conf table optional named parameters:
-- Parameter format: { 'parameter name', propertyId # in Wikidata, formatting/validation function, section, example ID for documentation }
-- Optional named parameterslink: `link` to override the link in the documentation (defaults to "<parameter +> (identifer)"),
-- category: to override the ID in category names (defaults to "... with <parameter> identifiers"),
-- prefix: to include a prefix (usually a wikilink explaining what the identifier is) before the external link itself
p.conf = {
{ 'AAG', 3372, p.aagLink, "'Galeri seni dan museum"', "'1"' },
{ 'ACM-DL', 864, p.acmLink, "'Basis data ilmiah"', "'12345678901"', link =" 'ACM DL (identifier)"' },
{ 'ADB', 1907, p.adbLink,"'Kamus biografi"', "'barton-sir-edmund-toby-71"' },
{ 'AGSA', 6804, p.agsaLink, "'Galeri seni dan museum"', "'3625"' },
{ 'autores.uy', 2558, p.autoresuyLink, "'Kamus biografi"', "'12345"' },
{ 'AWR', 41824186, p.awrLink, "'Kamus biografi"', "'PR00768b"' },
{ 'BIBSYS', 1015, p.bibsysLink, "'Perpustakaan nasional"', "'1234567890123"' },
{ 'Bildindex', 2092, p.bildLink, "'Lembaga penelitian seni"', "'1"' },
{ 'BNC', 1890, p.bncLink, "'Perpustakaan nasional"', "'123456789"' },
{ 'BNE', 950, p.bneLink, "'Perpustakaan nasional"', "'XX1234567"' },
{ 'BNF', 268, p.bnfLink, "'Perpustakaan nasional"', "'123456789"' },
{ 'Botanist', 428, p.botanistLink , "'Basis data ilmiah"', "'L."' },
{ 'BPN', 651, p.bpnLink , "'Kamus biografi"', "'12345678"' },
{ 'CANTIC', 1273, p.canticLink, "'Perpustakaan nasional"', "'a12345678"' },
{ 'CINII', 271, p.ciniiLink, "'Basis data ilmiah"', "'DA12345678"', link = "'CiNii (identifier)"' },
{ 'CWGC', 1908, p.cwgcLink, "'Lain-lain"', "'1234567"' },
{ 'DAAO', 1707, p.daaoLink, "'Lembaga penelitian seni"', "'rolf-harris"' },
{ 'DBLP', 2456, p.dblpLink, "'Basis data ilmiah"', "'123/123"' },
{ 'DIB', 6829, p.dibLink, "'Kamus biografi"', "'a1234"' },
{ 'DSI', 2349, p.dsiLink, "'Lembaga penelitian seni"', "'1538"' },
{ 'FASTEMU', 21634613, p.fastLinkemuLink, "Lain-lain"'Perpustakaan nasional', "1"'15409' },
{ 'FNZAFAST', 67922163, p.fnzaLinkfastLink, "Lembaga penelitian seni"'Lain-lain', "12"'1' },
{ 'GNDFNZA', 2276792, p.gndLinkfnzaLink, "Umum"'Lembaga penelitian seni', "4079154-3"'12' },
{ 'HDSGND', 902227, p.hdsLinkgndLink, "Lain-lain"'Umum', "050123"'4079154-3' },
{ 'IAAFHDS', 1146902, p.iaafLinkhdsLink, "'Lain-lain"', "123"'050123' },
{ 'IAAF', 1146, p.iaafLink, 'Lain-lain', '123' },
{ 'ICCU', 396, p.iccuLink, "'Perpustakaan nasional"', "'IT\\ICCU\\CFIV\\000163"' }, --formerly SBN
{ 'ICIA', 1736, p.iciaLink, "'Lembaga penelitian seni"', "'1"' },
{ 'IEU', 9070, p.ieuLink, "'Lain-lain"', "'N\\A\\NationalAcademyofArtandArchitecture"' },
{ 'ISNI', 213, p.isniLink, "'Umum"', "'0000-0000-6653-4145"', prefix = '[[ISNI (identifier)|ISNI]]' },
{ 'Joconde', 347, p.jocondeLink, "'Lembaga penelitian seni"', "'12345678901"' },
{ 'KULTURNAV', 1248, p.kulturnavLink, "'Lembaga penelitian seni"', "'12345678-1234-1234-1234-1234567890AB"', link =" 'KulturNav (identifier)"' },
{ 'LCCN', 244, p.lccnLink, "'Perpustakaan nasional"', "'n78039510"' },
{ 'LIR', 886, p.lirLink, "'Lain-lain"', "'1"' },
{ 'LNB', 1368, p.lnbLink, "'Perpustakaan nasional"', "'123456789"' },
{ 'Léonore', 640, p.leonoreLink, "'Lain-lain"', "'LH//1/1"', prefix = "'[[Léonore (identifier)|Léonore (Prancis)]]"' },
{ 'MA', 6366, p.maLink, "'Lain-lain"', "'123456789"' },
{ 'MBA', 434, p.mbaLink, "'Lain-lain"', "'12345678-1234-1234-1234-1234567890AB"', category = 'MusicBrainz' }, --special cat name
{ 'MBAREA', 982, p.mbareaLink, "'Lain-lain"', "'12345678-1234-1234-1234-1234567890AB"', category = 'MusicBrainz area' }, --special cat name
{ 'MBI', 1330, p.mbiLink, "'Lain-lain"', "'12345678-1234-1234-1234-1234567890AB"', category = 'MusicBrainz instrument' }, --special cat name
{ 'MBL', 966, p.mblLink, "'Lain-lain"', "'12345678-1234-1234-1234-1234567890AB"', category = 'MusicBrainz label' }, --special cat name
{ 'MBP', 1004, p.mbpLink, "'Lain-lain"', "'12345678-1234-1234-1234-1234567890AB"', category = 'MusicBrainz place' }, --special cat name
{ 'MBRG', 436, p.mbrgLink, "'Lain-lain"', "'12345678-1234-1234-1234-1234567890AB"', category = 'MusicBrainz release group' }, --special cat name
{ 'MBS', 1407, p.mbsLink, "'Lain-lain"', "'12345678-1234-1234-1234-1234567890AB"', category = 'MusicBrainz series' }, --special cat name
{ 'MBW', 435, p.mbwLink, "'Lain-lain"', "'12345678-1234-1234-1234-1234567890AB"', category = 'MusicBrainz work' }, --special cat name
{ 'MGP', 549, p.mgpLink, "'Basis data ilmiah"', "'123456"' },
{ 'NARA', 1225, p.naraLink, "'Lain-lain"', "'12345678"' },
{ 'NCL', 1048, p.nclLink, "'Perpustakaan nasional"', "'1081436"' },
{ 'NDL', 349, p.ndlLink, "'Perpustakaan nasional"', "'012345678"' },
{ 'NGV', 2041, p.ngvLink, "'Galeri seni dan museum"', "'12354"' },
{ 'NKC', 691, p.nkcLink, "'Perpustakaan nasional"', "'abcd12345678901234"' },
{ 'NLA', 409, p.nlaLink, "'Perpustakaan nasional"', "'123456789012"' },
{ 'NLG', 3348, p.nlgLink, "'Perpustakaan nasional"', "'12345678"' },
{ 'NLI', 949, p.nliLink, "'Perpustakaan nasional"', "'123456789"' },
{ 'NLK', 5034, p.nlkLink, "'Perpustakaan nasional"', "'KAB197000000"' },
{ 'NLP', 1695, p.nlpLink, "'Perpustakaan nasional"', "'9810123456789012345"' },
{ 'NLR', 1003, p.nlrLink, "'Perpustakaan nasional"', "'123456789"' },
{ 'NSK', 1375, p.nskLink, "'Perpustakaan nasional"', "'123456789"' },
{ 'NTA', 1006, p.ntaLink, "'Perpustakaan nasional"', "'12345678X"' },
{ 'ORCID', 496, p.orcidLink, "'Umum"', "'0000-0002-7398-5483"', prefix = '[[ORCID (identifier)|ORCID]]' },
{ 'PIC', 2750, p.picLink, "'Lembaga penelitian seni"', "'1"' },
{ 'PLWABN', 7293, p.plwabnLink, "'Perpustakaan nasional"', "'9812345678905606"' },
{ 'Publons', 3829, p.publonsLink, "'Basis data ilmiah"', "'2776255"' },
{ 'RID', 1053, p.ridLink, "'Basis data ilmiah"', "'A-1234-1934"' },
{ 'RISM', 5504, p.rismLink, "'Lain-lain"', "'pe1"', prefix = '[[RISM (identifier)|RISM (Prancis)]]' },
{ 'RERO', 3065, p.reroLink, "'Lain-lain"', "'02-A012345678"', prefix = '[[RERO (identifier)|RERO (Swiss)]]' },
{ 'RKDartists', 650, p.rkdartistsLink, "'Lembaga penelitian seni"', "'123456"' },
{ 'RKDID', 350, p.rkdidLink, "'Lembaga penelitian seni"', "'123456"' },
{ 'RSL', 947, p.rslLink, "'Perpustakaan nasional"', "'123456789"' },
{ 'SELIBR', 906, p.selibrLink, "'Perpustakaan nasional"', "'123456"' },
{ 'SIKART', 781, p.sikartLink, "'Lembaga penelitian seni"', '123456789' },
{ 'SNAC-ID', 3430, p.snacLink, "'Lain-lain"', "'A"' },
{ 'SUDOC', 269, p.sudocLink, "'Lain-lain"', "'026927608"', prefix = '[[SUDOC (identifier)|SUDOC (Prancis)]]' },
{ 'S2AuthorId', 4012, p.s2authoridLink, "'Basis data ilmiah"', "'1796130"', category = 'Semantic Scholar author' }, --special cat name
{ 'TA98', 1323, p.ta98Link, "'Basis data ilmiah"', "'A12.3.45.678"' },
{ 'TDVİA', 7314, p.tdviaLink, "'Lain-lain"', "'asim-b-behdele"' },
{ 'TePapa', 3544, p.tepapaLink, "'Galeri seni dan museum"', "'1"' },
{ 'TLS', 1362, p.tlsLink, "'Lain-lain"', "'Abcd"' },
{ 'Trove', 1315, p.troveLink, "'Lain-lain"', "'12345678"', prefix = '[[Trove (identifier)|Trove (Australia)]]' }, --formerly NLA-person
{ 'UKPARL', 6213, p.ukparlLink, "'Lain-lain"', "'AQUupyiR"' },
{ 'ULAN', 245, p.ulanLink, "'Lembaga penelitian seni"', "'500123456"' },
{ 'USCongress', 1157, p.uscongressLink, "'Lain-lain"', "'A000123"', link = "Kongres'US ASCongress (identifier)"' },
{ 'VcBA', 8034, p.vcbaLink, "'Perpustakaan nasional"', "'494/9793"' },
{ 'VIAF', 214, p.viafLink, "'Umum"', "'123456789"', prefix = "'[[VIAF (identifier)|VIAF]]"' },
{ 'WORLDCATID', 7859, nil, "'Umum"', nil, link = "'WorldCat Identities (identifier)"' },
}
 
Baris 1.079 ⟶ 1.115:
}
 
-- Deprecated aliases to p.conf; tracked in [[CategoryKategori:Wikipedia articlesArticles 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' },
Baris 1.095 ⟶ 1.131:
 
function p.authorityControl( frame )
local resolveEntity = require( "'Module:ResolveEntityId"' )
local parentArgs = frame:getParent().args --WD IDs added here later
local iParentArgs = 0 --count original/manual parent args only later
local worldcatCat = ''
local elementsCat = ''
local multipleIdCat = ''
local suppressedIdCat = ''
local suppressedIdCatArts = ''
local deprecatedIdCat = ''
local differentOnWDCat = ''
local sameOnWDCat = ''
local stateCat = ''
--Redirectredirect aliases to proper parameter names
for _, a in pairs( p.aliases ) do
local alias, param = a[1], a[2]
Baris 1.113 ⟶ 1.152:
end
--Redirectredirect deprecated parameters to proper parameter names, and assign tracking cat
for _, d in pairs( p.deprecated ) do
local dep, param = d[1], d[2]
Baris 1.119 ⟶ 1.158:
parentArgs[param] = parentArgs[dep]
if namespace == 0 then
deprecatedIdCat = '[[Kategori:ArtikelArticles Wikipediawith dengandeprecated penandaauthority pengawasancontrol otoritas usangidentifiers|'..dep..']]'
end
end
end
--Useuse QID= parameter for testing/example purposes only
local itemId = nil
if namespace ~= 0 then
Baris 1.138 ⟶ 1.177:
--Wikidata fallback if available
if itemId then
local suppressedIdCount = 0
local iMatches = 0
for _, params in ipairs( p.conf ) do
Baris 1.146 ⟶ 1.186:
if wikidataIds[1] then
if val == '' and (namespace == 0 or testcases) then
suppressedIdCount = suppressedIdCount + 1
suppressedIdCat = '[[Kategori:Artikel Wikipedia dengan penanda pengawasan otoritas yang disembunyikan|'..params[1]..']]'
else
Baris 1.167 ⟶ 1.208:
if iMatches > 0 and iMatches == iParentArgs then
sameOnWDCat = '[[Kategori:Halaman yang menggunakan pengawasan otoritas dengan semua parameter cocok dengan Wikidata]]'
end
if parentArgs['arts'] == 'arts' and suppressedIdCount > 0 then
if rctnamespace == 0 or rct >= 25testcases then
local s = 's'
if suppressedIdCount == 1 then s = '' end
local sCat = 'ACArt with '..suppressedIdCount..' suppressed element'..s
elementsCat suppressedIdCatArts = '[[Kategori:'..eCatsCat..']]'..p.redCatLink(eCatsCat)
end
end
end
--Configuredconfigure rows
local rct = 0
local sectionOrder = {"'Umum"',"'Perpustakaan nasional"',"'Galeri seni dan museum"',
"'Lembaga penelitian seni"',"'Kamus biografi"',"'Basis data ilmiah"',
"'Lain-lain"'}
local sections = {
["'Umum"'] = {},
["'Perpustakaan nasional"'] = {},
["'Galeri seni dan museum"'] = {},
["'Lembaga penelitian seni"'] = {},
["'Kamus biografi"'] = {},
["'Basis data ilmiah"'] = {},
["'Lain-lain"'] = {}
}
-- Dondon't show NLP isif PLWABN is present, since they both go to the National Library of PolandiaPoland
-- and the library has deprecated NLP IDs in favor of PLWABN IDs
if parentArgs.PLWABN or parentArgs.plwabn then
parentArgs.NLP = ''
Baris 1.195 ⟶ 1.245:
table.insert( tval, val )
if params.prefix then
table.insert( tlinks, params[3]( val, "'1"' ) )
else
table.insert( tlinks, params[3]( val ) )
end
end
--collect Lain-lainother unique vals (IDs) from WD, if present
if itemId and tval[1] then
local nextIdVal = 2
Baris 1.224 ⟶ 1.274:
end
end
 
end
Baris 1.230 ⟶ 1.280:
local worldcatId = parentArgs['worldcatid'] or parentArgs['WORLDCATID']
if worldcatId and worldcatId ~= '' then --if WORLDCATID present & unsuppressed
table.insert( sections["'Umum"'], p.createRow( 'WORLDCATID', worldcatId, '[https://www.worldcat.org/identities/'..mw.uri.encode(worldcatId, 'PATH')..' WorldCat]', nil, false ) ) --Validation?
worldcatCat = p.getCatForId( 'WORLDCATID' )
rct = rct + 1
Baris 1.237 ⟶ 1.287:
local lccnId = parentArgs['lccn'] or parentArgs['LCCN']
if viafId and viafId ~= '' and p.viafLink( viafId ) then --VIAF must be present, unsuppressed, & validated
table.insert( sections["'Umum"'], p.createRow( 'VIAF', viafId, '[https://www.worldcat.org/identities/containsVIAFID/'..viafId..' WorldCat (via VIAF)]', nil, false ) )
if namespace == 0 then
worldcatCat = '[[Kategori:Artikel Wikipedia dengan penanda WorldCat-VIAF]]'
Baris 1.246 ⟶ 1.296:
if lccnParts and lccnParts[1] ~= 'sh' then
local lccnIdFmtd = lccnParts[1]..lccnParts[2]..'-'..lccnParts[3]
table.insert( sections["'Umum"'], p.createRow( 'LCCN', lccnId, '[https://www.worldcat.org/identities/lccn-'..lccnIdFmtd..' WorldCat (via Library of Congress)]', nil, false ) )
if namespace == 0 then
worldcatCat = '[[Kategori:Artikel Wikipedia dengan penanda WorldCat-LCCN]]'
Baris 1.257 ⟶ 1.307:
end
--configure Navbox
local Navbox = require('Module:Navbox')
local elementsCat = ''
if rct == 0 or rct >= 25 then
local eCat = 'AC dengan '..rct..' elemen'
elementsCat = '[[Kategori:'..eCat..']]'..p.redCatLink(eCat)
end
local outString = ''
if rct > 0 then
local Navbox = require('Module:Navbox')
local sectionID = 1
local args = { pid = 'identifiers' } -- #target the list of identifiers
Baris 1.271 ⟶ 1.316:
local pencil = frame:expandTemplate{ title = 'EditAtWikidata', args = args}
local navboxArgs = {
name = 'PengawasanAuthority otoritascontrol',
navboxclass = 'authority-control',
bodyclass = 'hlist',
Baris 1.279 ⟶ 1.324:
for _, sectName in ipairs(sectionOrder) do
if #sections[sectName] ~= 0 then
navboxArgs["'group" '.. sectionID] = sectName
navboxArgs["'list" '.. sectionID] = table.concat(sections[sectName])
sectionID = sectionID + 1
end
end
if navboxArgs.group2 then
navboxArgs.title = "'[[Bantuan:Pengawasan otoritas|Pengawasan otoritas]]" '.. pencil
else
local sect = navboxArgs.group1
if sect == "'Umum"' or sect == "'Lain-lain"' then
-- Just say "Authority control" with no label if only Umumgeneral or only Lain-lainother IDs are present
-- since "Umumgeneral" is redundant and "Lain-lainother" is silly when there's nothing to contrast it with
navboxArgs.group1 = "'[[Bantuan:Pengawasan otoritas|Pengawasan otoritas]]" '.. pencil
else
navboxArgs.group1 = "'[[Bantuan:Pengawasan otoritas|Pengawasan otoritas: " '.. sect .. "']] " '.. pencil
end
end
Baris 1.299 ⟶ 1.344:
end
--auxCats
local auxCats = worldcatCat .. elementsCat .. multipleIdCat .. suppressedIdCat ..
if rct == 0 or rct >= 25 then
deprecatedIdCat .. differentOnWDCat .. sameOnWDCat
if namespace == 0 or testcases then
local eCat = 'AC dengan '..rct..' elemen'
elementsCat = '[[Kategori:'..eCat..']]'..p.redCatLink(eCat)
end
end
if parentArgs.state then
if namespace == 0 or testcases then
local sCat
if parentArgs.state == 'collapsed' then sCat = 'AC yang menggunakan parameter state: collapsed'
elseif parentArgs.state == 'expanded' then sCat = 'AC yang menggunakan parameter state: expanded'
elseif parentArgs.state == 'autocollapse' then sCat = 'AC yang menggunakan parameter state: autocollapse'
else sCat = 'AC yang menggunakan parameter state: other'
end
stateCat = '[[Kategori:'..sCat..']]'..p.redCatLink(sCat)
end
end
local auxCats = worldcatCat .. elementsCat .. multipleIdCat .. suppressedIdCat .. suppressedIdCatArts..
deprecatedIdCat .. differentOnWDCat .. sameOnWDCat..stateCat
if testcases then
auxCats = mw.ustring.gsub(auxCats, '(%[%[)(Category)', '%1:%2') --for easier checking
end
outString = outString .. auxCats
--out
outString = outString .. auxCats
if namespace ~= 0 then
outString = mw.ustring.gsub(outString, '(%[%[)(Category:Artikel Wikipedia)', '%1:%2') --by definition