66 435
contributi
mNessun oggetto della modifica |
m (Test) |
||
Riga 198: | Riga 198: | ||
--OperatorName = string.gsub("[[Flotta Stellare|Flotta Stellare]]", "|.+]]", ""):gsub("%[%[", "") .. " - " | --OperatorName = string.gsub("[[Flotta Stellare|Flotta Stellare]]", "|.+]]", ""):gsub("%[%[", "") .. " - " | ||
OperatorName = string.gsub(PropValue, "|.+]]", ""):gsub("%[%[", "") .. " - " | OperatorName = string.gsub(PropValue, "|.+]]", ""):gsub("%[%[", "") .. " - " | ||
mw.smw.set("OperatorName1=" .. OperatorName) | --mw.smw.set("OperatorName1=" .. OperatorName) | ||
end | end | ||
if AddSemantic then | if AddSemantic then | ||
mw.smw.set(PropName .. "=" .. PropValue) | --mw.smw.set(PropName .. "=" .. PropValue) | ||
end | end | ||
end | end | ||
Riga 213: | Riga 213: | ||
mw.smw.set("Operatore=" .. OperatorTree(frame)) | mw.smw.set("Operatore=" .. OperatorTree(frame)) | ||
end]==] | end]==] | ||
mw.smw.set("OperatorName2=" .. OperatorName) | --mw.smw.set("OperatorName2=" .. OperatorName) | ||
else | else | ||
-- Unspecified Property | -- Unspecified Property | ||
Riga 219: | Riga 219: | ||
local Values = Item['claims'][Property] | local Values = Item['claims'][Property] | ||
local AccValues = {} | local AccValues = {} | ||
mw.smw.set("OperatorName3=" .. OperatorName) | --mw.smw.set("OperatorName3=" .. OperatorName) | ||
for _, SnakValue in pairs(Values) do | for _, SnakValue in pairs(Values) do | ||
local Value = SnakValue.mainsnak.datavalue['value'] | local Value = SnakValue.mainsnak.datavalue['value'] | ||
mw.smw.set("OperatorName4=" .. OperatorName) | --mw.smw.set("OperatorName4=" .. OperatorName) | ||
if (type(Value) == "table") then | if (type(Value) == "table") then | ||
if Property == "P72" then --CASE Assigments | if Property == "P72" then --CASE Assigments | ||
Riga 263: | Riga 263: | ||
AccValues[#AccValues + 1] = Assignment | AccValues[#AccValues + 1] = Assignment | ||
elseif Value['entity-type'] == 'item' then | elseif Value['entity-type'] == 'item' then | ||
mw.smw.set("OperatorName5=" .. OperatorName) | --mw.smw.set("OperatorName5=" .. OperatorName) | ||
-- Process a generic Item | -- Process a generic Item | ||
local GenericItem | local GenericItem | ||
Riga 271: | Riga 271: | ||
GenericItem = LabelOrLink(Value['id']) | GenericItem = LabelOrLink(Value['id']) | ||
end | end | ||
mw.smw.set("OperatorName6=" .. OperatorName) | --mw.smw.set("OperatorName6=" .. OperatorName) | ||
-- Prefix | -- Prefix | ||
if SnakValue.qualifiers and SnakValue.qualifiers['P15'] then | if SnakValue.qualifiers and SnakValue.qualifiers['P15'] then | ||
Riga 279: | Riga 279: | ||
--Naval class | --Naval class | ||
if Property == "P88" then | if Property == "P88" then | ||
mw.smw.set("OperatorName8=" .. OperatorName | mw.smw.set("OperatorName8=" .. OperatorName .. " ( " .. Property) | ||
GenericItem = GenericItem .. "[[Category:" .. OperatorName .. mw.wikibase.getEntity(Value['id']).labels['it'].value .. "]]" | GenericItem = GenericItem .. "[[Category:" .. OperatorName .. mw.wikibase.getEntity(Value['id']).labels['it'].value .. "]]" | ||
GenericItem = mw.text.nowiki(GenericItem) .. " -" .. mw.text.nowiki(OperatorName) .. "- " | --GenericItem = mw.text.nowiki(GenericItem) .. " -" .. mw.text.nowiki(OperatorName) .. "- " | ||
end | end | ||
mw.smw.set("OperatorName9=" .. OperatorName) | mw.smw.set("OperatorName9=" .. OperatorName) |