Modulo:DTGenerico: differenze tra le versioni

Vai alla navigazione Vai alla ricerca
Fallback in case of Title label error
(SMW property for P14)
(Fallback in case of Title label error)
(6 versioni intermedie di uno stesso utente non sono mostrate)
Riga 46: Riga 46:
end
end
--ItemQ = Item['claims']['P14'][1].mainsnak.datavalue['value']['id']
ItemQ = p.QFromP('P14')
ItemQ = p.QFromP('P14')
--SeriesQ = Item['claims']['P16'][1]['mainsnak'].datavalue['value']['id']
--FileName = mw.wikibase.getEntity(SeriesQ)['claims']['P3'][1]['mainsnak'].datavalue['value']
--IconFileName = Item['claims']['P3'][1].mainsnak.datavalue['value']
--return ItemQ
--return mw.wikibase.getEntity(ItemQ)['claims']['P3'][1].mainsnak.datavalue['value']
TitleText = mw.wikibase.getLabelByLang(ItemQ, 'it')
TitleText = mw.wikibase.getLabelByLang(ItemQ, 'it')
if TitleText == nil then
--Return Q item in case of error processing the label to troubleshoot
TitleText = ItemQ
end
mw.smw.set("Istanza=" .. TitleText)
mw.smw.set("Istanza=" .. TitleText)


Riga 64: Riga 62:
local HTMLTable
local HTMLTable
local CollectionTable = ''
local CollectionTable = ''
local ExcludeP = {P3 = true, P14 = true, P26 = true, P30 = true, P37 = true, P58 = true, P68 = true}
local ExcludeP = {P3 = true, P14 = true, P26 = true, P30 = true, P37 = true, P58 = true, P68 = true, P52 = true, P79 = true, P90 = true}
local Item = mw.wikibase.getEntity()
local Item = mw.wikibase.getEntity()
local ItemQ = mw.wikibase.getEntityIdForCurrentPage()
local ItemQ = mw.wikibase.getEntityIdForCurrentPage()
Riga 139: Riga 137:
AccValues[#AccValues + 1] = frame:expandTemplate{title = 'TimeL', args = {Tipo='ITEstesa', Istante=Value['time']}}
AccValues[#AccValues + 1] = frame:expandTemplate{title = 'TimeL', args = {Tipo='ITEstesa', Istante=Value['time']}}
end
end
elseif SnakValue.mainsnak.datavalue.type == 'quantity' then
local StringValue
StringValue = string.format('%u', SnakValue.mainsnak.datavalue.value.amount)
if AddSemantic then
mw.smw.set(Header[2] .. "::" .. StringValue)
end
AccValues[#AccValues + 1] = StringValue
else
else
AccValues[#AccValues + 1] = 'TABLE'
AccValues[#AccValues + 1] = 'TABLE'

Menu di navigazione