66 411
contributi
(Prefix) |
mNessun oggetto della modifica |
||
(6 versioni intermedie di uno stesso utente non sono mostrate) | |||
Riga 56: | Riga 56: | ||
local HTMLTable | local HTMLTable | ||
local CollectionTable = '' | local CollectionTable = '' | ||
local ExcludeP = { | local ExcludeP = {P3 = true, P14 = true, P26 = true, P30 = true, P37 = true, P58 = true, P68 = true} | ||
local Item = mw.wikibase.getEntity() | local Item = mw.wikibase.getEntity() | ||
local ItemQ = mw.wikibase.getEntityIdForCurrentPage() | local ItemQ = mw.wikibase.getEntityIdForCurrentPage() | ||
Riga 68: | Riga 68: | ||
AllP = mw.wikibase.orderProperties(Item:getProperties()) | AllP = mw.wikibase.orderProperties(Item:getProperties()) | ||
--Debug: list unsorted and sorted properties | |||
--AllRows[#AllRows + 1] = {"getProperties:", Item:getProperties()} | |||
--AllRows[#AllRows + 1] = {"AllP:", AllP} | |||
PageTitle = mw.title.getCurrentTitle() | PageTitle = mw.title.getCurrentTitle() | ||
if (mw.wikibase.getLabelByLang(ItemQ, 'en')) and (mw.wikibase.getLabelByLang(ItemQ, 'en')) ~= PageTitle.text then | if (mw.wikibase.getLabelByLang(ItemQ, 'en')) and (mw.wikibase.getLabelByLang(ItemQ, 'en')) ~= PageTitle.text then | ||
Riga 96: | Riga 100: | ||
end | end | ||
Assignment = Assignment .. SnakValue.qualifiers['P15'][1].datavalue.value .. " " .. LabelOrLink(Value['id']) | if SnakValue.qualifiers['P15'] then | ||
Assignment = Assignment .. SnakValue.qualifiers['P15'][1].datavalue.value .. " " | |||
end | |||
Assignment = Assignment .. LabelOrLink(Value['id']) | |||
if SnakValue.qualifiers['P76'] then --Rank | if SnakValue.qualifiers['P76'] then --Rank | ||
Riga 107: | Riga 115: | ||
AccValues[#AccValues + 1] = Assignment | AccValues[#AccValues + 1] = Assignment | ||
elseif Value['entity-type'] == 'item' then | elseif Value['entity-type'] == 'item' then | ||
local GenericItem | |||
if AddSemantic then | if AddSemantic then | ||
GenericItem = LabelOrLink(Value['id'], Header[2]) | |||
else | else | ||
GenericItem = LabelOrLink(Value['id']) | |||
end | |||
if SnakValue.qualifiers and SnakValue.qualifiers['P15'] then | |||
GenericItem = SnakValue.qualifiers['P15'][1].datavalue.value .. " " .. GenericItem | |||
end | end | ||
AccValues[#AccValues + 1] = GenericItem | |||
elseif SnakValue.mainsnak.datavalue['type'] == 'time' then | elseif SnakValue.mainsnak.datavalue['type'] == 'time' then | ||
if AddSemantic then | if AddSemantic then |