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( {
end
local function getAutori()
end
local function
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
--
-- 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
if not is_set(args.titolo) then
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')
end
if not is_set(args.vol) and not is_set(args.volume) then
args.data = getQualifier('P478')
end
end
|