Module:Sandbox/N3rsti/Wikidata Explained

local p =

function p.get_item_info(frame) local qid = frame.args.qid or "" local prop = frame.args.prop or "" local out = "" local val = "" local valtbl = mw.wikibase.getBestStatements(qid, prop) for _, value in pairs(valtbl) do id = value.mainsnak.datavalue.value.id label = mw.wikibase.getLabel(id) or "" link = mw.wikibase.getSitelink(id) if link then val = "" .. link .. "" else val = label end out = out .. val .. "
" end return outend

return p