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||LVL||ID||Wikipedia||Boundary||Type||Designation\n') for key, row in pairs(mw.ext.data.get(dataPage).data) do       local relid, admin_level, latitude, longitude, name, wikipedia, boundary, type_, designation = unpack(row) if wikipedia then wikipedia =  .. wikipedia ..  end local line = '|-\n| ' .. '| ' .. (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