Διαφορά μεταξύ των αναθεωρήσεων του «Module:Authority control»

καμία σύνοψη επεξεργασίας
(Νέα σελίδα: require('Module:No globals') local function getCatForId( id ) local title = mw.title.getCurrentTitle() local namespace = title.namespace if namespace == 0 then...)
 
local namespace = title.namespace
if namespace == 0 then
return '[[Category:ΣελίδεςΛήμματα ΒικιθήκηςΒικιπαίδειας με αναγνωριστικά ' .. id .. ']]'
elseif namespace == 2 and not title.isSubpage then
return '[[Category:Σελίδες χρηστών με αναγνωριστικά ' .. id .. ']]'
local function nlaLink( id )
return '[//nla.gov.au/anbd.aut-an' .. id .. ' ' .. id .. ']' .. getCatForId( 'NLA' )
end
 
local function rkdartistsLink( id )
return '[https://rkd.nl/en/explore/artists/' .. id .. ' ' .. id .. ']' .. getCatForId( 'RKDartists' )
end
 
end
for _, statement in pairs( item.claims[property] ) do
table.insert( ids, if statement.mainsnak.datavalue.value )then
table.insert( ids, statement.mainsnak.datavalue.value )
end
end
return ids
--In this order: name of the parameter, label, propertyId in Wikidata, formatting function
local conf = {
{ 'VIAF', '[[:w:Virtual International Authority File|VIAF]]', 214, viafLink },
{ 'LCCN', '[[:w:Library of Congress Control Number|LCCN]]', 244, lccnLink },
{ 'ISNI', '[[International Standard Name Identifier|ISNI]]', 213, isniLink },
{ 'ORCID', '[[ORCID]]', 496, orcidLink },
{ 'SELIBR', '[[LIBRIS|SELIBR]]', 906, selibrLink },
{ 'SUDOC', '[[Système universitaire de documentation|SUDOC]]', 269, sudocLink },
{ 'BNF', '[[:w:Bibliothèque nationale de France|BNF]]', 268, bnfLink },
{ 'BPN', '[[Biografisch Portaal|BPN]]', 651, bpnLink },
{ 'RID', '[[ResearcherID]]', 01053, ridLink },
{ 'BIBSYS', '[[BIBSYS]]', 1015, bibsysLink },
{ 'ULAN', '[[Union List of Artist Names|ULAN]]', 245, ulanLink },
{ 'HDS', '[[Historical Dictionary of Switzerland|HDS]]', 902, hlsLink },
{ 'LIR', '[[Historical Dictionary of Switzerland#Lexicon_Istoric_Retic|LIR]]', 886, lirLink },
{ 'MBA', '[[:w:MusicBrainz]]', 434, mbLink },
{ 'MGP', '[[Mathematics Genealogy Project|MGP]]', 549, mgpLink },
{ 'NLA', '[[National Library of Australia|NLA]]', 409, nlaLink },
{ 'NCL', '[[National Central Library|NCL]]', 1048, nclLink },
{ 'NKC', '[[National Library of the Czech Republic|NKC]]', 691, nkcLink },
{ 'Léonore', '[[:fr:Base Léonore|Léonore]]', 640, leonoreLink },
{ 'SBN', '[[Istituto Centrale per il Catalogo Unico|ICCU]]', 396, sbnLink },
{ 'RLS', '[[Russian State Library|RLS]]', 947, rslLink },
{ 'SIKART', '[[SIKART]]', 781, sikartLink },
{ 'KULTURNAV', '[[KulturNav]]', 1248, kulturnavLink },
{ 'RKDartists', '[[Ολλανδικό Ινστιτούτο Ιστορίας της Τέχνης|RKD]]', 650, rkdartistsLink },
}
 
-- Check that the Wikidata item has this property-->value before adding it
local reqs = {}
reqs['MBA'] = {
{ 106, 177220 }, -- occupation -> singer
{ 31, 177220 }, -- instance of -> singer
{ 106, 13385019 }, -- occupation -> rapper
{ 31, 13385019 }, -- instance of -> rapper
{ 106, 639669 }, -- occupation -> musician
{ 31, 639669 }, -- instance of -> musician
{ 106, 36834 }, -- occupation -> composer
{ 31, 36834 }, -- instance of -> composer
{ 106, 488205 }, -- occupation -> singer-songwriter
{ 31, 488205 }, -- instance of -> singer-songwriter
{ 106, 183945 }, -- occupation -> record producer
{ 31, 183945 }, -- instance of -> record producer
{ 106, 10816969 }, -- occupation -> club DJ
{ 31, 10816969 }, -- instance of -> club DJ
{ 106, 130857 }, -- occupation -> DJ
{ 31, 130857 }, -- instance of -> DJ
{ 106, 158852 }, -- occupation -> conductor
{ 31, 158852 }, -- instance of -> conductor
{ 31, 215380 }, -- instance of -> band
{ 31, 5741069 }, -- instance of -> rock band
}
 
local p = {}
 
--Wikidata fallback if requested
local item = mw.wikibase.getEntitygetEntityObject()
if item ~= nil and item.claims ~= nil then
for _, params in pairs( conf ) do
end
if canUseWikidata then
local wikidataIds = getIdsFromWikidata( item, 'pP' .. params[3] )
if wikidataIds[1] then
parentArgs[params[1]] = wikidataIds[1]
local Navbox = require('Module:Navbox')
local elementscats = ''
if rct > 1613 then
elementscats = '[[Category:AC with ' .. rct .. ' elements]]'
end
 
if #elements ~= 0 then
 
return Navbox._navbox( {
name = 'Authority control',
bodyclass = 'hlist',
group1 = 'Σύνδεσμοι σε [[Κατάλογος καθιερωμένων όρων|καταλόγους καθιερωμένων όρων]]' .. elementscats,
list1 = table.concat( elements )
} )
else
return ""
end
end
 
230

επεξεργασίες