Modulo:DTGenerico: differenze tra le versioni

Vai alla navigazione Vai alla ricerca
mNessun oggetto della modifica
mNessun oggetto della modifica
Riga 149: Riga 149:
table.insert(ListProp, Property)
table.insert(ListProp, Property)
if (not ExcludeP[Property]) and Item.claims[Property][1].mainsnak.datatype ~= 'external-id' then
if (not ExcludeP[Property]) and Item.claims[Property][1].mainsnak.datatype ~= 'external-id' then
-- START specific property
if Property == "P46" then
if Property == "P46" then
-- Collection
-- Collection
Riga 206: Riga 207:
end]==]
end]==]
--mw.smw.set("OperatorName2=" .. OperatorName)
--mw.smw.set("OperatorName2=" .. OperatorName)
-- END specific property
else
else
-- Unspecified Property
-- START Unspecified Property
local Header = {Property, (mw.wikibase.getLabelByLang(Property, 'it') or mw.wikibase.getLabel(Property))} -- .. ":"} -- or {Property, mw.wikibase.getLabel(Property) .. ":"} --'-' .. Property .. ":"}
local Header = {Property, (mw.wikibase.getLabelByLang(Property, 'it') or mw.wikibase.getLabel(Property))} -- .. ":"} -- or {Property, mw.wikibase.getLabel(Property) .. ":"} --'-' .. Property .. ":"}
local Values = Item['claims'][Property]
local Values = Item['claims'][Property]
Riga 216: Riga 218:
--mw.smw.set("OperatorName4=" .. OperatorName)
--mw.smw.set("OperatorName4=" .. OperatorName)
if (type(Value) == "table") then
if (type(Value) == "table") then
-- DataValue is an array
if Property == "P72" then
if Property == "P72" then
--CASE Assigments
--CASE Assigments
Riga 358: Riga 361:
AccValues[#AccValues + 1] = StringValue
AccValues[#AccValues + 1] = StringValue
elseif SnakValue.mainsnak.datavalue.type == 'url' then
else
AccValues[#AccValues + 1] = 'Unspecified TABLE'
end
elseif SnakValue.mainsnak.datavalue.type == 'url' then
--URL, URI or URN
--URL, URI or URN
local URLString
local URLString
Riga 367: Riga 373:
end
end
table.insert(AccValues, URLString)
table.insert(AccValues, URLString)
else
AccValues[#AccValues + 1] = 'Unspecified TABLE'
end
else
else
-- String items
-- String items
Riga 379: Riga 382:
end
end
AllRows[#AllRows + 1] = {Header, AccValues}
AllRows[#AllRows + 1] = {Header, AccValues}
-- END Unspecified Property
end
end
end
end