Módulo:Control de autoridades
[ máis información | ver o historial | | | ver as instrucións ]
Este módulo toma datos dunha ou máis propiedades do Wikidata
|
Módulo que contén o código empregado polo modelo {{Control de autoridades}}
[ máis información | ver o historial | | | ver as instrucións ]
Esta documentación está transcluída desde Módulo:Control de autoridades/uso. Os editores poden probar cambios no mesmo en Módulo:Control de autoridades/probas.
Por favor, engade as categorías na subpáxina de documentación e os interwikis no Wikidata. Ver as subpáxinas deste módulo.
Por favor, engade as categorías na subpáxina de documentación e os interwikis no Wikidata. Ver as subpáxinas deste módulo.
require('Módulo:No globals')
local function getCatForId( id )
local title = mw.title.getCurrentTitle()
local namespace = title.namespace
if namespace == 0 or namespace == 102 then
return '[[Categoría:Wikisource:Artigos con identificadores ' .. id .. ']]'
--elseif namespace == 102 and not title.isSubpage then
-- return '[[Categoría:Wikisource:Páxinas de autores con identificadores ' .. id .. ']]'
--else
-- return '[[Categoría:Wikisource:Páxinas diversas con identificadores ' .. id .. ']]'
end
end
local function viafLink( id )
if not string.match( id, '^%d+$' ) then
return false
end
return '[http://viaf.org/viaf/' .. id .. ' ' .. id .. ']' .. getCatForId( 'VIAF' )
end
local function kulturnavLink( id )
return '[http://kulturnav.org/language/en/' .. id .. ' id]' .. getCatForId( 'KULTURNAV' )
end
local function sikartLink( id )
return '[http://www.sikart.ch/KuenstlerInnen.aspx?id=' .. id .. '&lng=en ' .. id .. ']' ..getCatForId( 'SIKART' )
end
local function tlsLink( id )
local id2 = mw.ustring.gsub(id, '%s', function(s) return mw.uri.encode(s, 'WIKI') end)
return '[http://tls.theaterwissenschaft.ch/wiki/' .. id2 .. ' ' .. id .. ']' ..getCatForId( 'TLS' )
end
local function ciniiLink( id )
return '[http://ci.nii.ac.jp/author/' .. id .. '?l=en ' .. id .. ']' ..getCatForId( 'CINII' )
end
local function olLink ( id )
return '[https://openlibrary.org/works/' .. id .. ' ' .. id .. ']' .. getCatForId( 'OL' )
end
local function bneLink( id )
return '[http://catalogo.bne.es/uhtbin/authoritybrowse.cgi?action=display&authority_id=' .. id .. ' ' .. id .. '] [http://datos.bne.es/persona/' ..id.. '.html (datos)]' ..getCatForId( 'BNE' )
end
local function uscongressLink( id )
return '[http://bioguide.congress.gov/scripts/biodisplay.pl?index=' .. id .. ' ' .. id .. ']' ..getCatForId( 'USCongress' )
end
local function narapersonLink( id )
return '[https://research.archives.gov/person/' .. id .. ' ' .. id .. ']' ..getCatForId( 'NARA' )
end
--local function naraorganizationLink( id )
-- return '[https://research.archives.gov/organization/' .. id .. ' ' .. id .. ']' ..getCatForId( 'NARA-org' )
--end
local function botanistLink( id )
local id2 = mw.ustring.gsub(id, '%s', function(s) return mw.uri.encode(s, 'PATH') end)
return '[http://www.ipni.org/ipni/advAuthorSearch.do?find_abbreviation=' .. id2 .. ' ' .. id .. ']' ..getCatForId( 'Botanist' )
end
local function plantlistLink( id )
return '[http://www.theplantlist.org/tpl1.1/record/' .. id .. ' ' .. id .. ']' .. getCatForId( 'PlantList' )
end
local function tropicosLink( id )
return '[http://www.tropicos.org/Name/' .. id .. ' ' .. id .. ']' .. getCatForId( 'Tropicos' )
end
local function mgpLink( id )
-- TODO Implement some sanity checking regex
return '[http://www.genealogy.ams.org/id.php?id=' .. id .. ' ' .. id .. ']' .. getCatForId( 'MGP' )
end
local function rslLink( id )
-- TODO Implement some sanity checking regex
return '[http://aleph.rsl.ru/F?func=find-b&find_code=SYS&adjacent=Y&local_base=RSL11&request=' .. id .. '&CON_LNG=ENG ' .. id .. ']' .. getCatForId( 'RSL' )
end
local function leonoreLink( id )
-- Identifiants allant de LH/1/1 à LH/2794/54 (légionnaires)
-- Identifiants allant de C/0/1 à C/0/84 (84 légionnaires célèbres)
-- Identifiants allant de 19800035/1/1 à 19800035/385/51670 (légionnaires décédés entre 1954 et 1977, et quelques dossiers de légionnaires décédés avant 1954)
if not string.match( id, '^LH/%d%d?%d?%d?/%d%d?%d?$' ) and
not string.match( id, '^C/0/%d%d?$' ) and
not string.match( id, '^19800035/%d%d?%d?%d?/%d%d?%d?%d?%d?$' ) then
return false
end
return '[//www.culture.gouv.fr/public/mistral/leonore_fr?ACTION=CHERCHER&FIELD_1=COTE&VALUE_1=' .. id .. ' ' .. id .. ']' ..getCatForId( 'Léonore' )
end
local function iccuLink( id )
if not string.match( id, '^IT\\ICCU\\%d%d%d%d%d%d%d%d%d%d$' ) and not string.match( id, '^IT\\ICCU\\%u%u[%d%u]%u\\%d%d%d%d%d%d$' ) then
return false
end
return '[http://opac.sbn.it/opacsbn/opac/iccu/scheda_authority.jsp?bid=' .. id .. ' ' .. id .. ']' .. getCatForId( 'ICCU' )
end
local function nkcLink( id )
return '[http://aleph.nkp.cz/F/?func=find-c&local_base=aut&ccl_term=ica=' .. id .. '&CON_LNG=ENG ' .. id .. ']' ..getCatForId( 'NKC' )
end
local function nclLink( id )
if not string.match( id, '^%d+$' ) then
return false
end
return '[http://aleweb.ncl.edu.tw/F/?func=accref&acc_sequence=' .. id .. '&CON_LNG=ENG ' .. id .. ']' ..getCatForId( 'NCL' )
end
local function ndlLink( id )
return '[http://id.ndl.go.jp/auth/ndlna/' .. id .. ' ' .. id .. ']' .. getCatForId( 'NDL' )
end
local function sudocLink( id )
if not string.match( id, '^%d%d%d%d%d%d%d%d[%dxX]$' ) then
return false
end
return '[http://www.idref.fr/' .. id .. ' ' .. id .. ']' .. getCatForId( 'SUDOC' )
end
local function canticLink( id )
return '[http://cantic.bnc.cat/registres/CUCId/' .. id .. ' ' .. id .. ']' .. getCatForId( 'CANTIC' )
end
local function hdsLink( id )
if not string.match( id, '^%d+$' ) then
return false
end
return '[http://www.hls-dhs-dss.ch/textes/f/F' .. id .. '.php ' .. id .. ']' .. getCatForId( 'HDS' )
end
local function lirLink( id )
if not string.match( id, '^%d+$' ) then
return false
end
return '[http://www.e-lir.ch/e-LIR___Lexicon.' .. id .. '.450.0.html ' .. id .. ']' ..getCatForId( 'LIR' )
end
local function splitLccn( id )
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
local function append(str, c, length)
while str:len() < length do
str = c .. str
end
return str
end
local function lccnLink( id )
local parts = splitLccn( id )
if not parts then
return false
end
local lccnType = parts[1] ~= 'sh' and 'names' or 'subjects'
id = parts[1] .. parts[2] .. append( parts[3], '0', 6 )
return '[http://id.loc.gov/authorities/' .. lccnType .. '/' .. id .. ' ' .. id .. ']' .. getCatForId( 'LCCN' )
end
local function mbLink( id )
-- TODO Implement some sanity checking regex
return '[//musicbrainz.org/artist/' .. id .. ' ' .. id .. ']' .. getCatForId( 'MusicBrainz' )
end
--Returns the ISNI check digit isni must be a string where the 15 first elements are digits
local function getIsniCheckDigit( isni )
local total = 0
for i = 1, 15 do
local digit = isni:byte( i ) - 48 --Get integer value
total = (total + digit) * 2
end
local remainder = total % 11
local result = (12 - remainder) % 11
if result == 10 then
return "X"
end
return tostring( result )
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
local function validateIsni( id )
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
if getIsniCheckDigit( id ) ~= string.char( id:byte( 16 ) ) then
return false
end
return id
end
local function isniLink( id )
id = validateIsni( id )
if not id then
return false
end
return '[http://isni.org/isni/' .. id .. ' ' .. id:sub( 1, 4 ) .. ' ' .. id:sub( 5, 8 ) .. ' ' .. id:sub( 9, 12 ) .. ' ' .. id:sub( 13, 16 ) .. ']' .. getCatForId( 'ISNI' )
end
local function orcidLink( id )
id = validateIsni( id )
if not id then
return false
end
id = id:sub( 1, 4 ) .. '-' .. id:sub( 5, 8 ) .. '-' .. id:sub( 9, 12 ) .. '-' .. id:sub( 13, 16 )
return '[http://orcid.org/' .. id .. ' ' .. id .. ']' .. getCatForId( 'ORCID' )
end
local function scopusLink( id )
return '[https://www.scopus.com/authid/detail.url?authorId=' .. id .. ' ' ..id.. ']' .. getCatForId('Scopus')
end
local function scholarLink( id )
return '[https://scholar.google.com/citations?user=' .. id .. ' ' ..id.. ']' .. getCatForId('Scholar')
end
local function gndLink( id )
return '[http://d-nb.info/gnd/' .. id .. ' ' .. id .. ']' .. getCatForId( 'GND' )
end
local function selibrLink( id )
if not string.match( id, '^%d+$' ) then
return false
end
return '[//libris.kb.se/auth/' .. id .. ' ' .. id .. ']' .. getCatForId( 'SELIBR' )
end
local function bnfLink( id )
--Add cb prefix if it has been removed
if not string.match( id, '^cb.+$' ) then
id = 'cb' .. id
end
return '[http://catalogue.bnf.fr/ark:/12148/' .. id .. ' ' .. id .. '] [http://data.bnf.fr/ark:/12148/' .. id .. ' (datos)]' .. getCatForId( 'BNF' )
end
local function bpnLink( id )
if not string.match( id, '^%d+$' ) then
return false
end
return '[http://www.biografischportaal.nl/en/persoon/' .. id .. ' ' .. id .. ']' .. getCatForId( 'BPN' )
end
local function ridLink( id )
return '[http://www.researcherid.com/rid/' .. id .. ' ' .. id .. ']' .. getCatForId( 'RID' )
end
local function bibsysLink( id )
return '[http://ask.bibsys.no/ask/action/result?cmd=&kilde=biblio&cql=bs.autid+%3D+' .. id .. '&feltselect=bs.autid ' .. id .. ']' .. getCatForId( 'BIBSYS' )
end
local function ulanLink( id )
return '[//www.getty.edu/vow/ULANFullDisplay?find=&role=&nation=&subjectid=' .. id .. ' ' .. id .. ']' .. getCatForId( 'ULAN' )
end
local function nlaLink( id )
return '[//nla.gov.au/anbd.aut-an' .. id .. ' ' .. id .. ']' .. getCatForId( 'NLA' )
end
local function nasaLink( id )
return '[http://www.jsc.nasa.gov/Bios/htmlbios/' .. id .. '.html ' .. id .. ']' .. getCatForId( 'NASA' )
end
local function rkdartistsLink( id )
return '[https://rkd.nl/en/explore/artists/' .. id .. ' ' .. id .. ']' .. getCatForId( 'RKDartists' )
end
local function GecLink( id )
return '[http://www.enciclopedia.cat/enciclop%C3%A8dies/gran-enciclop%C3%A8dia-catalana/EC-GEC-' .. id .. '.xml ' .. id .. ']' .. getCatForId( 'GEC' )
end
local function catholicLink( id )
return '[http://www.catholic-hierarchy.org/bishop/b' .. id .. '.html ' .. id .. ']' .. getCatForId( 'CatholicHierarchy' )
end
--local function freebaseLink( id )
-- return '[http://www.freebase.com' .. id .. ' ' .. id .. ']' .. getCatForId( 'Freebase' )
--end
local function imdbLink( id )
return '[http://www.imdb.com/Name?' .. id .. ' ' .. id .. ']' .. getCatForId( 'IMDB' )
end
local function isfdbLink( id )
return '[http://www.isfdb.org/cgi-bin/title.cgi?' ..id.. ' ' .. id .. ']' .. getCatForId( 'ISFDB')
end
local function GutenbergLink( id )
return '[https://www.gutenberg.org/ebooks/author/' .. id .. ' ' .. id .. ']' .. getCatForId( 'Gutenberg' )
end
local function eraLink( id )
return '[http://lamp.infosys.deakin.edu.au/era/?page=jnamedet12f&eraid=' .. id .. ' ' .. id .. ']' ..getCatForId( 'ERA' )
end
local function ptbnpLink( id )
return '[http://purl.pt/index/geral/aut/PT/' .. id .. '.html ' .. id .. ']' .. getCatForId( 'PTBNP' )
end
local function oclcLink( id )
return '[http://www.worldcat.org/oclc/' .. id .. '?lang=en ' .. id .. ']' .. getCatForId( 'OCLC' )
end
local function isbnLink( id )
return '[[Especial:Fontes bibliográficas/' .. id .. '|' .. id .. ']]' .. getCatForId( 'ISBN' )
-- ISBN currently only reads ISBN-13 numbers from Wikidata and ignores ISBN-10 numbers
end
local function issnLink( id )
return '[http://www.worldcat.org/search?fq=x0:jrnl&q=n2:' .. id .. ' ' .. id .. ']' .. getCatForId( 'ISSN' )
end
local function doiLink( id )
return '[http://dx.doi.org/' .. id .. ' ' .. id .. ']' .. getCatForId( 'DOI' )
end
local function cerlLink( id )
if not string.match( id, 'cn[cilp]%d%d%d%d%d%d%d%d$' ) then
return false
end
return '[http://thesaurus.cerl.org/record/' .. id .. ' ' .. id .. ']' .. getCatForId( 'CERL' )
end
local function dialnetLink ( id )
return '[http://dialnet.unirioja.es/servlet/autor?codigo=' .. id .. ' ' .. id .. ']' .. getCatForId( 'Dialnet' )
end
local function eolLink ( id )
return '[http://eol.org/pages/' .. id .. ' ' .. id .. ']' .. getCatForId( 'EOL' )
end
local function fwLink ( id )
return '[http://fossilworks.org/bridge.pl?a=taxonInfo&taxon_no=' .. id .. ' ' .. id .. ']' ..getCatForId( 'FW' )
end
local function ipniLink ( id )
return '[http://www.ipni.org/ipni/idPlantNameSearch.do?id=' .. id .. ' ' .. id .. ']' .. getCatForId( 'IPNI' )
end
local function mycobankLink ( id )
return '[http://www.mycobank.org/MycoTaxo.aspx?Link=T&Rec=' .. id .. ' ' .. id .. ']' .. getCatForId( 'MycoBank' )
end
local function faunaEuropaeaLink ( id )
return '[http://fauna.naturkundemuseum-berlin.de/full_results.php?id=' .. id .. ' ' .. id .. ']' .. getCatForId( 'FE' )
end
local function wormsLink ( id )
return '[http://www.marinespecies.org/aphia.php?p=taxdetails&id=' .. id .. ' ' .. id .. ']' .. getCatForId('WoRMS')
end
local function itisLink ( id )
return '[http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=' .. id .. ' ' .. id .. ']' .. getCatForId('ITIS')
end
local function gbifLink ( id )
return '[http://www.gbif.org/species/' .. id .. ' ' .. id .. ']' .. getCatForId('GBIF')
end
local function avibaseLink ( id )
return '[http://avibase.bsc-eoc.org/species.jsp?avibaseid=' .. id .. ' ' .. id .. ']' .. getCatForId( 'Avibase' )
end
local function xenocantoLink ( id )
return '[http://www.xeno-canto.org/species/' .. id .. ' ' .. id .. ']' .. getCatForId( 'Xenocanto')
end
local function jocondeLink( id )
return '[http://www.culture.gouv.fr/public/mistral/joconde_fr?ACTION=CHERCHER&FIELD_1=REF&VALUE_1=' .. id .. ' ' .. id .. ']' .. getCatForId( 'Joconde' )
end
local function merimeeLink ( id )
return '[http://www.culture.gouv.fr/public/mistral/merimee_fr?ACTION=CHERCHER&FIELD_1=REF&VALUE_1=' .. id .. ' ' .. id .. ']' .. getCatForId( 'Merimee' )
end
local function structuraeLink ( id )
return '[http://en.structurae.de/structures/data/index.cfm?ID=' .. id .. ' ' .. id .. ']' .. getCatForId( 'Structurae' )
end
local function whcLink ( id )
return '[http://whc.unesco.org/en/list/' .. id .. ' ' .. id .. ']' .. getCatForId( 'WHC' )
end
local function nrhpLink ( id )
return '[http://focus.nps.gov/AssetDetail/NRIS/' .. id .. ' ' .. id .. ']' .. getCatForId( 'NRHP' )
end
local function gnisLink ( id )
return '[https://geonames.usgs.gov/pls/gnispublic/f?p=gnispq:3:::NO::P3_FID:' .. id .. ' ' .. id .. ']' .. getCatForId( 'GNIS' )
end
local function boxofficemojoLink ( id )
return '[http://boxofficemojo.com/movies/?id=' .. id .. '.htm ' .. id .. ']' .. getCatForId( 'BoxOfficeMojo' )
end
local function filmaffinityLink ( id )
return '[https://www.filmaffinity.com/en/film' .. id .. '.html ' .. id .. ']' .. getCatForId( 'FilmAffinity' )
end
local function metacriticLink ( id )
return '[http://www.metacritic.com/' .. id .. ' ' .. id .. ']' .. getCatForId( 'Metacritic' )
end
local function allmusicartistLink ( id )
return '[http://www.allmusic.com/artist/' .. id .. ' ' .. id .. ']' .. getCatForId( 'Allmusic' )
end
local function allmusicalbumLink ( id )
return '[http://www.allmusic.com/album/' .. id .. ' ' .. id .. ']' .. getCatForId( 'AllmusicAlbum' )
end
local function allmusicmovieLink ( id )
return '[http://www.allmovie.com/movie/' .. id .. ' ' .. id .. ']' .. getCatForId( 'Allmovie' )
end
local function rottenLink ( id )
return '[http://www.rottentomatoes.com/' .. id .. ' ' .. id .. ']' .. getCatForId( 'RottenTomatoes' )
end
local function discogsmasterLink ( id )
return '[http://www.discogs.com/master/' .. id .. ' ' .. id .. ']' .. getCatForId( 'DiscogsMaster' )
end
local function discogslabelLink ( id )
return '[http://www.discogs.com/label/' .. id .. ' ' .. id .. ']' .. getCatForId( 'DiscogsLabel' )
end
local function discogsartistLink ( id )
return '[http://www.discogs.com/artist/' .. id .. ' ' .. id .. ']' .. getCatForId( 'DiscogsArtist' )
end
local function iaafLink ( id )
return '[http://www.iaaf.org/athletes/athlete=' .. id .. ' ' .. id .. ']' .. getCatForId( 'IAAF' )
end
local function itfLink ( id )
return '[http://www.itftennis.com/procircuit/players/player/profile.aspx?playerid=' .. id .. ' ' .. id .. ']' ..getCatForId( 'ITF' )
end
local function atpLink ( id )
return '[http://www.atpworldtour.com/en/players/wikidata/' .. id .. '/overview ' .. id .. ']' ..getCatForId( 'ATP' )
end
local function wtaLink ( id )
return '[http://www.wtatennis.com/players/player/' .. id .. ' ' .. id .. ']' .. getCatForId( 'WTA' )
end
local function uefaLink ( id )
return '[http://www.uefa.com/teamsandplayers/players/player=' .. id .. ' ' .. id .. ']' .. getCatForId( 'UEFA' )
end
local function worldfootballLink ( id )
return '[http://www.worldfootball.net/player_summary/' .. id .. '/ ' .. id .. ']' .. getCatForId( 'WF' )
end
local function basketballrefLink ( id )
return '[http://www.basketball-reference.com/players/' .. id .. '.html ' .. id .. ']' .. getCatForId( 'BasketballRef' )
end
local function scrumLink ( id )
return '[http://en.espn.co.uk/statsguru/rugby/player/' .. id .. '.html ' ..id .. ']' ..getCatForId( 'SCRUM' )
end
local function boxrecLink ( id )
return '[http://boxrec.com/list_bouts.php?human_id=' .. id .. '&cat=boxer ' .. id .. ']' .. getCatForId( 'BoxRec' )
end
local function fideLink( id )
return '[https://ratings.fide.com/card.phtml?event=' .. id .. ' ' .. id .. ']' .. getCatForId( 'FIDE' )
end
local function chessgamesLink( id )
return '[http://www.chessgames.com/perl/chessplayer?pid=' .. id .. ' ' .. id .. ']' .. getCatForId( 'ChessGames' )
end
local function baseballrefLink( id )
return '[http://www.baseball-reference.com/players/' .. id .. '.shtml ' .. id .. ']' .. getCatForId( 'BaseballRef' )
end
local function pcsLink( id )
return '[http://www.procyclingstats.com/rider/' .. id .. ' ' .. id .. ']' .. getCatForId( 'ProCyclingStats' )
end
local function caLink( id )
return '[http://www.cyclingarchives.com/coureurfiche.php?coureurid=' .. id .. ' ' .. id .. ']' ..getCatForId( 'CyclingArchives' )
end
local function nssdcLink ( id )
return '[http://nssdc.gsfc.nasa.gov/nmc/spacecraftDisplay.do?id=' .. id .. ' ' .. id .. ']' ..getCatForId( 'NSSDC' )
end
local function scnLink ( id )
return '[http://www.n2yo.com/satellite/?s=' .. id .. ' ' .. id .. ']' .. getCatForId( 'SCN' )
end
local function jplLink ( id )
return '[http://ssd.jpl.nasa.gov/sbdb.cgi?sstr=' .. id .. ' ' .. id .. ']' .. getCatForId( 'JPL' )
end
local function mobygamesLink ( id )
return '[https://www.mobygames.com/game/' .. id .. ' ' .. id .. ']' ..getCatForId( 'MobyGames' )
end
local function getIdsFromWikidata( item, property )
local ids = {}
if not item.claims[property] then
return ids
end
for _, statement in pairs( item.claims[property] ) do
if statement.mainsnak.datavalue then
table.insert( ids, statement.mainsnak.datavalue.value )
end
end
return ids
end
local function matchesWikidataRequirements( item, reqs )
for _, group in pairs( reqs ) do
local property = 'p' .. group[1]
local qid = group[2]
if item.claims[property] ~= nil then
for _, statement in pairs ( item.claims[property] ) do
if statement.mainsnak.datavalue ~= nil then
if statement.mainsnak.datavalue.value['numeric-id'] == qid then
return true
end
end
end
end
end
return false
end
local function createRow( id, label, rawValue, link, withUid )
if link then
if withUid then
return '* ' .. label .. ' <span class="uid">' .. link .. '</span>\n'
else
return '* ' .. label .. ' ' .. link .. '\n'
end
else
return '* <span class="error">O identificador ' .. id .. ' ' .. rawValue .. ' non é válido.</span>[[Categoría:Wikisource:Artigos con identificadores de control de autoridades non válidos]]\n'
end
end
--Orde: nome do parámetro, etiqueta, ID da propiedade en Wikidata e nome da función de formato
local conf = {
--Autores / Xerais
{ 'VIAF', '[[w:Virtual International Authority File|VIAF]]', 214, viafLink },
{ 'LCCN', '[[w:Library of Congress Control Number|LCCN]]', 244, lccnLink },
{ 'ISNI', '[[w:International Standard Name Identifier|ISNI]]', 213, isniLink },
{ 'ORCID', '[[w:ORCID|ORCID]]', 496, orcidLink },
{ 'GND', '[[w:Gemeinsame Normdatei|GND]]', 227, gndLink },
{ 'SELIBR', '[[w:LIBRIS|SELIBR]]', 906, selibrLink },
{ 'SUDOC', '[[w:Système universitaire de documentation|SUDOC]]', 269, sudocLink },
{ 'BNF', '[[w:Bibliothèque nationale de France|BNF]]', 268, bnfLink },
{ 'BPN', '[[w:Biografisch Portaal|BPN]]', 651, bpnLink },
{ 'RID', '[[w:ResearcherID|ResearcherID]]', 1053, ridLink },
{ 'BIBSYS', '[[w:BIBSYS|BIBSYS]]', 1015, bibsysLink },
{ 'ULAN', '[[w:Union List of Artist Names|ULAN]]', 245, ulanLink },
{ 'HDS', '[[w:Historical Dictionary of Switzerland|HDS]]', 902, hdsLink },
{ 'LIR', '[[w:Historical Dictionary of Switzerland#Lexicon_Istoric_Retic|LIR]]', 886, lirLink },
{ 'MBA', '[[w:MusicBrainz|MusicBrainz]]', 434, mbLink },
{ 'MGP', '[[w:Mathematics Genealogy Project|MGP]]', 549, mgpLink },
{ 'NLA', '[[w:National Library of Australia|NLA]]', 409, nlaLink },
{ 'NDL', '[[w:Biblioteca Nacional da Dieta|NDL]]', 349, ndlLink },
{ 'NCL', '[[w:National Central Library|NCL]]', 1048, nclLink },
{ 'NKC', '[[w:Biblioteca Nacional da República Checa|NKC]]', 691, nkcLink },
{ 'Léonore', '[[w:Base Léonore|Léonore]]', 640, leonoreLink },
{ 'ICCU', '[[w:Istituto Centrale per il Catalogo Unico|ICCU]]', 396, iccuLink },
{ 'RSL', '[[w:Biblioteca do Estado Ruso|RSL]]', 947, rslLink },
{ 'NARA', '[[w:National Archives and Records Administration|NARA]]', 1222, narapersonLink },
{ 'USCongress', '[[w:Biographical Directory of the United States Congress|USCongress]]', 1157, uscongressLink },
{ 'CANTIC', '[[w:CANTIC|CANTIC]]', 1273, canticLink },
{ 'OL', '[[w:Open Library|OL]]', 648, olLink},
{ 'BNE', '[[w:Biblioteca Nacional de España|BNE]]', 950, bneLink },
{ 'Scopus', '[[w:Scopus (base de datos)|Scopus]]', 1153, scopusLink},
{ 'Scholar', '[[w:Google Scholar|Scholar]]', 1960, scholarLink},
{ 'CINII', '[[w:CiNii|CiNii]]', 271, ciniiLink },
{ 'TLS', '[[w:Theaterlexikon der Schweiz|TLS]]', 1362, tlsLink },
{ 'SIKART', '[[w:SIKART|SIKART]]', 781, sikartLink },
{ 'KULTURNAV', '[[w:KulturNav|KulturNav]]', 1248, kulturnavLink },
{ 'RKDartists', '[[w:Netherlands Institute for Art History|RKD]]', 650, rkdartistsLink },
{ 'GEC', '[[w:Gran Enciclopèdia Catalana|GEC]]', 1296, GecLink },
{ 'PTBNP', '[[w:Biblioteca Nacional de Portugal|PTBNP]]', 1005, ptbnpLink },
{ 'CERL', '[[w:Consortium of European Research Libraries|CERL]]', 1871, cerlLink },
{ 'Dialnet', '[[w:Dialnet|Dialnet]]', 1607, dialnetLink },
{ 'NASA', '[[w:NASA|NASA]]', 2030, nasaLink},
{ 'CatholicHierarchy', 'Catholic-Hierarchy', 1047, catholicLink},
--Bioloxía
{ 'Botanist', '[[w:International Plant Names Index|Botanist]]', 428, botanistLink },
{ 'PlantList', '[[w:The Plant List|PlantList]]', 1070, plantlistLink},
{ 'IPNI', '[[w:International Plant Names Index|IPNI]]', 961, ipniLink},
{ 'Tropicos', '[[w:Tropicos|Tropicos]]', 960, tropicosLink},
{ 'Avibase', 'Avibase', 2026, avibaseLink},
{ 'EOL', '[[w:Encyclopedia of Life|EOL]]', 830, eolLink},
{ 'MycoBank', '[[w:MycoBank|MycoBank]]', 962, mycobankLink},
{ 'FE', '[[w:Fauna Europaea|FE]]', 1895, faunaEuropaeaLink},
{ 'WoRMS', '[[w:World Register of Marine Species|WoRMS]]', 850, wormsLink},
{ 'ITIS', '[[w:Sistema Integrado de Información Taxonómica|ITIS]]', 815, itisLink},
{ 'GBIF', '[[w:Global Biodiversity Information Facility|GBIF]]', 846, gbifLink},
{ 'Xenocanto', 'Xeno-canto', 2426, xenocantoLink},
{ 'FW', '[[w:Fossilworks|Fossilworks]]', 842, fwLink},
--Lugares/Estruturas
{ 'Structurae', '[[w:Structurae|Structurae]]', 454, structuraeLink },
{ 'WHC', '[[w:Patrimonio da Humanidade|WHC]]', 757, whcLink},
{ 'NRHP', '[[w:National Register of Historic Places|NRHP]]', 649, nrhpLink},
{ 'GNIS', '[[w:Geographic Names Information System|GNIS]]', 590, gnisLink},
--Obras
{ 'OCLC', '[[w:OCLC]]', 243, oclcLink },
{ 'ISBN', '[[w:International Standard Book Number|ISBN]]', 212, isbnLink },
{ 'ISSN', '[[w:International Standard Serial Number|ISSN]]', 236, issnLink },
{ 'DOI', '[[w:Digital object identifier|DOI]]', 356, doiLink },
{ 'Joconde', '[[w:Joconde|Joconde]]', 347, jocondeLink },
{ 'Merimee', '[[w:Base Mérimée|Mérimée]]', 380, merimeeLink },
{ 'Gutenberg', '[[w:Proxecto Gutenberg|Gutenberg]]', 1938, GutenbergLink },
{ 'ERA', '[[w:Australian Research Council|ERA]]', 1058, eraLink },
{ 'ISFDB', '[[w:Internet Speculative Fiction Database|ISFDB]]', 1274, isfdbLink },
-- Deporte
{ 'IAAF', '[[w:Asociación Internacional de Federacións de Atletismo|IAAF]]', 1146, iaafLink},
{ 'ITF', '[[w:Federación Internacional de Tenis|ITF]]', 599, itfLink},
{ 'ATP', '[[w:Asociación de Tenistas Profesionais|ATP]]', 536, atpLink},
{ 'WTA', '[[w:Asociación de Tenis Feminino|WTA]]', 597, wtaLink},
{ 'UEFA', '[[w:UEFA|UEFA]]', 2276, uefaLink},
{ 'WF', 'Worldfootball', 2020, worldfootballLink},
{ 'BoxRec', '[[w:BoxRec|BoxRec]]', 1967, boxrecLink},
{ 'FIDE', '[[w:FIDE|FIDE]]', 1440, fideLink},
{ 'ChessGames', 'ChessGames', 1665, chessgamesLink},
{ 'BaseballRef', '[[w:Baseball-Reference.com|Baseball-Ref]]', 1825, baseballrefLink},
{ 'ProCyclingStats', 'ProCyclingStats', 1663, pcsLink},
{ 'CyclingArchives', 'CyclingArchives', 1409, caLink},
{ 'SCRUM', '[[w:ESPN|SCRUM]]', 858, scrumLink},
{ 'BasketballRef', 'Basketball-Reference', 2685, basketballrefLink},
-- Filmes / Música / Videoxogos
{ 'IMDB', '[[w:Internet Movie Database|IMDb]]', 345, imdbLink },
{ 'BoxOfficeMojo', '[[w:Box Office Mojo|Box Office Mojo]]', 1237, boxofficemojoLink },
{ 'FilmAffinity', '[[w:FilmAffinity|FilmAffinity]]', 480, filmaffinityLink },
{ 'Metacritic', '[[w:Metacritic|Metacritic]]', 1712, metacriticLink },
{ 'Allmovie', '[[w:Allmusic|Allmovie]]', 1562, allmusicmovieLink},
{ 'Allmusic', '[[w:Allmusic|Allmusic]]', 1728, allmusicartistLink},
{ 'AllmusicAlbum', '[[w:Allmusic|Allmusic]]', 1729, allmusicalbumLink},
{ 'RottenTomatoes', '[[w:Rotten Tomatoes|Rotten Tomatoes]]', 1258, rottenLink},
{ 'DiscogsMaster', '[[w:Discogs|Discogs]]', 1954, discogsmasterLink},
{ 'DiscogsLabel', '[[w:Discogs|Discogs]]', 1955, discogslabelLink},
{ 'DiscogsArtist', '[[w:Discogs|Discogs]]', 1953, discogsartistLink},
{ 'MobyGames', '[[w:MobyGames|MobyGames]]', 1933, mobygamesLink},
--Astronomía
{ 'NSSDC', '[[w:NSSDC ID|NSSDC ID]]', 247, nssdcLink},
{ 'JPL', '[[w:Laboratorio de Propulsión a Chorro|JPL]]', 716, jplLink},
{ 'SCN', '[[w:Satellite Catalog Number|SCN]]', 377, scnLink}
--Desbotados
-- { 'Freebase', '[[w:Freebase|Freebase]]', 646, freebaseLink },
-- { 'NARA-org', '[[w:National Archives and Records Administration|NARA]]', 1223, naraorganizationLink },
}
-- Check that the Wikidata item has this property-->value before adding it
local reqs = {}
local p = {}
function p.authorityControl( frame )
local parentArgs = frame:getParent().args
--Create rows
local elements = {}
local title = mw.title.getCurrentTitle()
local namespace = title.namespace
if namespace == 0 or namespace == 102 then --Só no espazo de nomes principal e Autor:
--redirect PND to GND
if (parentArgs.GND == nil or parentArgs.GND == '') and parentArgs.PND ~= nil and parentArgs.PND ~= '' then
parentArgs.GND = parentArgs.PND
end
--Wikidata fallback if requested
local item = mw.wikibase.getEntityObject()
if item ~= nil and item.claims ~= nil then
for _, params in pairs( conf ) do
if params[3] ~= 0 then
local val = parentArgs[params[1]]
if not val or val == '' then
local canUseWikidata = nil
if reqs[params[1]] ~= nil then
canUseWikidata = matchesWikidataRequirements( item, reqs[params[1]] )
else
canUseWikidata = true
end
if canUseWikidata then
local wikidataIds = getIdsFromWikidata( item, 'P' .. params[3] )
if wikidataIds[1] then
parentArgs[params[1]] = wikidataIds[1]
end
end
end
end
end
end
--Worldcat
if parentArgs['WORLDCATID'] and parentArgs['WORLDCATID'] ~= '' then
table.insert( elements, createRow( 'WORLDCATID', '', parentArgs['WORLDCATID'], '[//www.worldcat.org/identities/' .. parentArgs['WORLDCATID'] .. ' WorldCat]', false ) ) --Validation?
elseif parentArgs['LCCN'] and parentArgs['LCCN'] ~= '' then
local lccnParts = splitLccn( parentArgs['LCCN'] )
if lccnParts and lccnParts[1] ~= 'sh' then
table.insert( elements, createRow( 'LCCN', '', parentArgs['LCCN'], '[//www.worldcat.org/identities/lccn-' .. lccnParts[1] .. lccnParts[2] .. '-' .. lccnParts[3] .. ' WorldCat]', false ) )
end
end
--Configured rows
local rct = 0
for k, params in pairs( conf ) do
local val = parentArgs[params[1]]
if val and val ~= '' then
table.insert( elements, createRow( params[1], params[2] .. ':', val, params[4]( val ), true ) )
rct = rct + 1
end
end
local Navbox = require('Module:Navbox')
--local elementscats = ''
--if rct > 13 then
-- elementscats = '[[Categoría:Wikisource:Control de autoridades con ' .. rct .. ' elementos]]'
--end
if #elements ~= 0 then
return Navbox._navbox( {
name = 'Control de autoridades',
bodyclass = 'hlist',
group1 = '[[Axuda:Control de autoridades|Control de autoridades]]', --.. elementscats,
list1 = table.concat( elements )
} )
else
return ""
end
end
end
return p