Modulo:Cita Wikidata: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica
Nessun oggetto della modifica
Riga 11:
 
local function getQualifier(qualifierId, conjunction)
return mWikidata._getQualifier( { 'P36'propertyId, 'P580', from = 'Q183'qualifierId, conjunction=conjunction } )
end
 
local function getAutori()
local autoriStringa = getQualifier('P2093')
if is_set(autoriStringa) then
local autoriConLink = getQualifier('P50', ", ")
if is_set(autoriConLink) then
args.autore =return autoriConLink .. ', ' .. autoriStringa
else
args.autore =return autoriStringa
end
else
args.autore =return getQualifier('P50')
end
end
 
local function getDatagetTitolo()
local titolo = getQualifier('P1476')
or getQualifier('P1932')
or getQualifier('P1932')
or getQualifier('P742')
or getQualifier('P554')
or mw.title.getCurrentTitle()--TODO: aggiungere pipetrick
return titolo
end
 
local function getUrl(urlPattern)
return mWikidata._getProperty( { propertyId, pattern=urlPattern } )
end
 
Riga 26 ⟶ 48:
local medium = args.medium
local identifier = args.id
local urlType = args.tipourl or 'titolo'
local urlPattern = args.patternurl
-- seSe un identificatore è specificato, allora si sta forzando l'inserimento manuale;
-- in tal caso, nessun dato va ricavato da Wikidata, altrimenti si rischierebbero incongruenze fra i dati manuali e quelli automatici
if false and not is_set(identifier) then
if not is_set(args.autore) then
args.autore = getAutori()
local autoriStringa = getQualifier('P2093')
if is_set(autoriStringa) then
local autoriConLink = getQualifier('P50', ", ")
if is_set(autoriConLink) then
args.autore = autoriConLink .. ', ' .. autoriStringa
else
args.autore = autoriStringa
end
else
args.autore = getQualifier('P50')
end
end
if noturlType is_set(args.== 'titolo)' then
if not is_set(args.titolo) then
--TODO
args.titolo = getTitolo()
end
if not is_set(args.url) then
args.url = getUrl(urlPattern)
end
elseif urlType == 'capitolo' then
if not is_set(args.capitolo) then
args.capitolo = getTitolo()
end
if not is_set(args.urlcapitolo) then
args.urlcapitolo = getUrl(urlPattern)
end
end
if not is_set(args.data) and not is_set(args.anno) then
args.data = getQualifier('P577')
--TODO
end
if not is_set(args.vol) and not is_set(args.volume) then
args.data = getQualifier('P478')
--TODO
end
end