Content deleted Content added
helps if we actually call the arbitrary access |
Prune repetiotion of code for extracting a q number from an entity (in many places) |
||
Line 532:
local out = {}
for k, v in pairs(claims) do
local
local
local label = mw.wikibase.label(qnumber) or qnumber
if label == nil then label = "Q" .. v.mainsnak.datavalue.value["numeric-id"] end▼
if sitelink then
out[#out + 1] = "[[" .. sitelink .. "|" .. label .. "]]"
else
out[#out + 1] = "[[:d:
end
end
Line 570 ⟶ 569:
local out = {}
for k, v in pairs(claims) do
local
local sitelink = mw.wikibase.sitelink(qnumber)
local label
local claimEntity = mw.wikibase.getEntity(
if claimEntity ~= nil then
if claimEntity.claims.P1813 then
Line 582:
end
end
if label == nil or label == "" then label = mw.wikibase.label(
if label == nil then label =
if sitelink then
out[#out + 1] = "[[" .. sitelink .. "|" .. label .. "]]"
else
out[#out + 1] = "[[:d:
end
end
Line 624:
local out = {}
for k, v in pairs(claims) do
local
local
local label = mw.wikibase.label(qnumber)
if sitelink then
out[#out + 1] = "[[" .. sitelink .. "|" .. label .. "]]"
else
out[#out + 1] = "[[:d:
end
end
Line 657 ⟶ 658:
for k2, v2 in pairs(v.qualifiers[qualifierID]) do
if v2.snaktype == 'value' then
out[#out + 1] = "[[" .. mw.wikibase.sitelink(qnumber) .. "]]"
else
out[#out + 1] = "[[:d:
end
end
|