Module:Convert/wikidata: Difference between revisions

Content deleted Content added
 
(3 intermediate revisions by 2 users not shown)
Line 215:
-- very likely that any decision a module makes about how to handle data
-- will be wrong for some cases at some time. This meets current requirements.
-- For each qualifier (or if no qualitiferqualifier), if there are any preferred
-- statements, use them and ignore any normal statements.
-- For each qualifier, for the preferred statements if any, or for
Line 307:
local text = parms.input -- should be a trimmed, non-empty string
local pid = text:match('^P%d+$')
local sep = ','
local sep = parms.test == '#' and '#' or ',' -- LATER remove test when decide what is wanted
local special = specials[parms[index]]
if special then
Line 337:
end
local item = ucode
if item == parms[index] then
-- Remove specified output unit if it is the same as the Wikidata unit.
-- For example, {{convert|input=P2044|km}} with property "12 km".
table.remove(parms, index)
end
for i = result.n, 1, -1 do
insert2(result[i][1], item)
Line 478 ⟶ 483:
end
if k == 'label' then
local wdl = mw.wikibase.labelgetLabel(key)
if wdl ~= value then
note:add('label changed to ' .. tostring(wdl))