Beberapa fungsi modul ini digunakan pada Templat:Infobox lokasi dari Wikipedia bahasa Katalan, jangan update modul ini dari Wikipedia bahasa Inggris dengan menhilangkan fungsi-fungsi tersebut!
---------- Module:Wikibase ----------------require('Module:No globals')localp={}-- Return the entity ID of the item linked to the current page.functionp.id(frame)ifnotmw.wikibasethenreturn"no mw.wikibase"endreturnmw.wikibase.getEntityIdForCurrentPage()or"no entity"end-- Return the URL of an entity given its entity ID-- or the item linked to the current page if no argument is provided.functionp.wdurl(frame)returnmw.wikibase.getEntityUrl(frame.args[1]andmw.text.trim(frame.args[1]))-- defaults to entity URL of the item linked to the current pageend-- Return the label of an entity given its entity ID-- or the item linked to the current page if no argument is provided.functionp.label(frame)returnmw.wikibase.getLabel(frame.args[1]andmw.text.trim(frame.args[1]))-- defaults to label of the item linked to the current pageend-- Return the description of an entity given its entity ID-- or the item linked to the current page if no argument is provided.functionp.description(frame)returnmw.wikibase.getDescription(frame.args[1]andmw.text.trim(frame.args[1]))-- defaults to description of the item linked to the current pageend-- Return the local title of an item given its entity ID-- or the item linked to the current page if no argument is provided.functionp.page(frame)localqid=frame.args[1]andmw.text.trim(frame.args[1])ifnotqidorqid==''thenqid=mw.wikibase.getEntityIdForCurrentPage()-- default the item connected to the current pageendreturnmw.wikibase.getSitelink(qidor'')-- requires one string argend-- Return the data type of a property given its entity ID.functionp.datatype(frame)localprop=mw.wikibase.getEntity(frame.args[1]andmw.text.trim(frame.args[1]):upper():gsub('PROPERTY:P','P'))-- trim and remove any "Property:" prefixreturnpropandprop.datatypeend-- Returns true if property datavalue is found excluding novalue/somevalue and deprecated rankfunctionp.validProperty(frame)localproperty=mw.text.trim(frame.args[1])localitem=frame.args.itemorframe.args.from;ifitem==''thenitem=nilendifitem==nilthenitem=mw.wikibase.getEntityIdForCurrentPage()endifitem==nilthenreturnendlocalproperties=mw.wikibase.getBestStatements(item,property)if#properties==0thenreturnendreturnproperties[1].mainsnak.datavalueandtrueornilendreturnp