Modulo:DTBase: differenze tra le versioni

Vai alla navigazione Vai alla ricerca
Item added to References
mNessun oggetto della modifica
(Item added to References)
(8 versioni intermedie di uno stesso utente non sono mostrate)
Riga 396: Riga 396:
else
else
for _, Statement in pairs(Statements) do
for _, Statement in pairs(Statements) do
local Reference = mw.wikibase.getSitelink(Statement.mainsnak.datavalue.value.id)
local ReferenceItem = Statement.mainsnak.datavalue.value.id
local Reference = mw.wikibase.getSitelink(ReferenceItem)
if not Reference then
if not Reference then
Reference = Statement.mainsnak.datavalue.value.id
--Reference = Statement.mainsnak.datavalue.value.id
AllReferences[#AllReferences + 1] = "* [[Special:AboutTopic/" .. Reference .. "]]"
AllReferences[#AllReferences + 1] = "* [[Special:AboutTopic/" .. ReferenceItem .. "]] - " .. ReferenceItem
else
else
if frame.args['AddSemantic'] then
if frame.args['AddSemantic'] then
Reference = "Riferimento::" .. Reference
Reference = "Riferimento::" .. Reference
end
end
AllReferences[#AllReferences + 1] = "* [[" .. Reference .. "]]"
AllReferences[#AllReferences + 1] = "* [[" .. Reference .. "]] - " .. ReferenceItem
end
end
end
end
Riga 460: Riga 461:
Row = "[[" .. v.fulltext .. "]]"
Row = "[[" .. v.fulltext .. "]]"
             end
             end
             Row = Row .. " - " .. v.printouts['DataTrek ID'][1]
             if v.printouts['DataTrek ID'][1] ~= nil then
            Row = Row .. " - " .. v.printouts['DataTrek ID'][1]
            end
           
AllBackReferences[#AllBackReferences + 1] = "*" .. Row
AllBackReferences[#AllBackReferences + 1] = "*" .. Row
         end
         end
Riga 470: Riga 474:
     return queryResult
     return queryResult
end
end
--- Generates a table of episodes with details using SMW query.
--
-- @frame Info from MW session
-- @return A table with episodes list and details
function p.EpisodesTable(frame)
local Value
local Selection
local Item = mw.wikibase.getEntity()
if not Item then
Item = mw.wikibase.getEntity('Q1')
end
if Item.claims[P90][1] then
if Item.claims[P18][1] then
Selection = "[[Istanza::" .. "]][[Stagione::" .. "]]"
else
Selection = "[[Istanza::" .. "]]"
end
else
return "No P90"
end


Value = Item['claims'][Property][1].mainsnak.datavalue['value']
local QueryResult = mw.smw.ask(Selection .. '|?Titolo italiano|?Numero di produzione|?Data di trasmissione|format=broadtable|sort=Numero di produzione|order=asc|class=sortable wikitable smwtable')
end
--- Prepares the selection for the SMW query to generate a list of episodes
-- with details using SMW query.
--
-- @frame Info from MW session
-- @return Query text
function p.EpisodesQuerySelection(frame)
local Value
local Selection
local Item = mw.wikibase.getEntity()
if not Item then
Item = mw.wikibase.getEntity('Q1')
end
if Item.claims[P90] then
if Item.claims[P18] then
Selection = "[[Istanza::{{#property:P90}}]][[Stagione::{{#property:P18}}]]"
else
Selection = "[[Istanza::{{#property:P90}}]]"
end
return Selection
else
return "No P90"
end
end
return p
return p

Menu di navigazione