Module:Sandbox

local p = {} function p.hello return "Hello, world!" end

function p.check(frame) return entityCheck(frame.args[1]) end

function entityCheck(entityId) if string.match(entityId, '^[PQ]%d+$') == nil then return entityId .. ': Invalid entity id' end

if mw.wikibase.getEntity(entityId) then return entityId .. ': Does exist' else return entityId .. ': Does not exist' end end return p