Module:Wikibase
From Bahaipedia
This was a test module, you can modify it for your purposes as it is not used. See a similar Module:InfoboxWB for getting wikibase data for infoboxes.
local module = {}
function module.getSitelink(frame)
local itemId = frame.args[1]
local globalSiteId = frame.args[2]
return mw.wikibase.getSitelink(itemId, globalSiteId)
end
function module.getBestStatements(frame)
local entityId = frame.args[1]
local propertyId = frame.args[2]
return mw.wikibase.getBestStatements(entityId, propertyId)
end
function module.dumpBestStatements(frame)
return mw.dumpObject(module.getBestStatements(frame))
end
function module.dumpBestStatement(frame)
return mw.dumpObject(module.getBestStatements(frame)[1])
end
return module