Module:Sandbox/Yurik/OSM NoWD

local p = {}

function p.show( frame ) local dataPage = 'Sandbox/Yurik/OSM objects with missing Wikidata ID.tab' local results = {}

table.insert(results, '!Name||Alt||LVL||ID||Wikipedia||Boundary||Type||Designation\n') for key, row in pairs(mw.ext.data.get(dataPage).data) do       local latitude, longitude, admin_level, name, relid, wikipedia, boundary, type_, alt_name, designation = unpack(row) if wikipedia then wikipedia =  .. wikipedia ..  end local line = '|-\n| ' .. '| ' .. (name or '') .. '\n' .. '| ' .. (alt_name or '') .. '\n' .. '| ' .. (admin_level or '') .. '\n' .. '| [http://www.openstreetmap.org/relation/' .. relid .. ' ' .. relid .. '] (.. relid .. ' edit) \n' .. '| ' .. (wikipedia or '') .. '\n' .. '| ' .. (boundary or '') .. '\n' .. '| ' .. (type_ or '') .. '\n' .. '| ' .. (designation or '') .. '\n' table.insert(results, line) end

return '{| class="wikitable sortable"\n' .. table.concat(results, '\n') .. '|}' end

return p