Us der alemannische Wikipedia, der freie Dialäkt-Enzyklopedy
---------- Module:Wikibase ----------------require('strict')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.datatypeendreturnp