Extension:WikibaseMediaInfo/Lua
WikibaseMediaInfo provides a Lua Scribunto interface to access MediaInfo entities. It does so by:
- integrating with the existing mw.wikibase methods, making MediaInfo entities accessible alongside other Wikibase entities.
- exposing a new set of methods under mw.wikibase.mediainfo, that is mostly identical to the mw.wikibase methods, but has been adapted to be more MediaInfo specific:
getCaption*
functions - an alias forgetLabel*
functions - have been addedgetEntityIdForTitle
doesn't support theglobalSiteId
argument
mw.wikibase.mediainfo
editmw.wikibase.mediainfo
has general Lua functionality for working with MediaInfo data.
mw.wikibase.mediainfo.getEntity
editmw.wikibase.mediainfo.getEntity()
mw.wikibase.mediainfo.getEntity( id )
This function is identical to the more generic mw.wikibase.getEntity
provided by Wikibase, but will return MediaInfo entity objects.
Please refer to Wikibase Lua documentation for mw.wikibase.getEntity.
mw.wikibase.mediainfo.getEntityIdForCurrentPage
editmw.wikibase.mediainfo.getEntityIdForCurrentPage()
This function is identical to the more generic mw.wikibase.getEntityIdForCurrentPage
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.getEntityIdForCurrentPage.
mw.wikibase.mediainfo.getEntityIdForTitle
editmw.wikibase.mediainfo.getEntityIdForTitle( pageTitle )
This function is identical to the more generic mw.wikibase.getEntityIdForTitle
provided by Wikibase, except that there is no support for a second argument: globalSiteId - entities are only accessible on the local wiki that acts as the MediaInfo repository.
Please refer to Wikibase Lua documentation for mw.wikibase.getEntityIdForTitle.
mw.wikibase.mediainfo.getEntityUrl
editmw.wikibase.mediainfo.getEntityUrl()
mw.wikibase.mediainfo.getEntityUrl( id )
This function is identical to the more generic mw.wikibase.getEntityUrl
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.getEntityUrl.
mw.wikibase.mediainfo.getLabel
editmw.wikibase.mediainfo.getLabel()
mw.wikibase.mediainfo.getLabel( id )
This function is identical to the more generic mw.wikibase.getLabel
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.getLabel.
mw.wikibase.mediainfo.getLabelWithLang
editmw.wikibase.mediainfo.getLabelWithLang()
mw.wikibase.mediainfo.getLabelWithLang( id )
This function is identical to the more generic mw.wikibase.getLabelWithLang
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.getLabelWithLang.
mw.wikibase.mediainfo.getLabelByLang
editmw.wikibase.mediainfo.getLabelByLang( id, languageCode )
This function is identical to the more generic mw.wikibase.getLabelByLang
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.getLabelByLang.
mw.wikibase.mediainfo.getCaption
editmw.wikibase.mediainfo.getCaption()
mw.wikibase.mediainfo.getCaption( id )
This function is an alias for getLabel.
mw.wikibase.mediainfo.getCaptionWithLang
editmw.wikibase.mediainfo.getCaptionWithLang()
mw.wikibase.mediainfo.getCaptionWithLang( id )
This function is an alias for getLabelWithLang.
mw.wikibase.mediainfo.getCaptionByLang
editmw.wikibase.mediainfo.getCaptionByLang( id, languageCode )
This function is an alias for getLabelByLang.
mw.wikibase.mediainfo.getDescription
editmw.wikibase.mediainfo.getDescription()
mw.wikibase.mediainfo.getDescription( id )
This function is identical to the more generic mw.wikibase.getDescription
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.getDescription.
mw.wikibase.mediainfo.getDescriptionWithLang
editmw.wikibase.mediainfo.getDescriptionWithLang()
mw.wikibase.mediainfo.getDescriptionWithLang( id )
This function is identical to the more generic mw.wikibase.getDescriptionWithLang
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.getDescriptionWithLang.
mw.wikibase.mediainfo.isValidEntityId
editmw.wikibase.mediainfo.isValidEntityId( entityIdSerialization )
This function is identical to the more generic mw.wikibase.isValidEntityId
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.isValidEntityId.
mw.wikibase.mediainfo.entityExists
editmw.wikibase.mediainfo.entityExists( id )
This function is identical to the more generic mw.wikibase.entityExists
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.entityExists.
mw.wikibase.mediainfo.renderSnak
editmw.wikibase.mediainfo.renderSnak( snakSerialization )
This function is identical to the more generic mw.wikibase.renderSnak
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.renderSnak.
mw.wikibase.mediainfo.formatValue
editmw.wikibase.mediainfo.formatValue( snakSerialization )
This function is identical to the more generic mw.wikibase.formatValue
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.formatValue.
mw.wikibase.mediainfo.renderSnaks
editmw.wikibase.mediainfo.renderSnaks( snaksSerialization )
This function is identical to the more generic mw.wikibase.renderSnaks
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.renderSnaks.
mw.wikibase.mediainfo.formatValues
editmw.wikibase.mediainfo.formatValues( snaksSerialization )
This function is identical to the more generic mw.wikibase.formatValues
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.formatValues.
mw.wikibase.mediainfo.resolvePropertyId
editmw.wikibase.mediainfo.resolvePropertyId( propertyLabelOrId )
This function is identical to the more generic mw.wikibase.resolvePropertyId
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.resolvePropertyId.
mw.wikibase.mediainfo.getPropertyOrder
editmw.wikibase.mediainfo.getPropertyOrder()
This function is identical to the more generic mw.wikibase.getPropertyOrder
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.getPropertyOrder.
mw.wikibase.mediainfo.orderProperties
editmw.wikibase.mediainfo.orderProperties( tableOfPropertyIds )
This function is identical to the more generic mw.wikibase.orderProperties
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.orderProperties.
mw.wikibase.mediainfo.getBestStatements
editmw.wikibase.mediainfo.getBestStatements( entityId, propertyId )
This function is identical to the more generic mw.wikibase.getBestStatements
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.getBestStatements.
mw.wikibase.mediainfo.getAllStatements
editmw.wikibase.mediainfo.getAllStatements( entityId, propertyId )
This function is identical to the more generic mw.wikibase.getAllStatements
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.getAllStatements.
mw.wikibase.mediainfo.getReferencedEntityId
editmw.wikibase.mediainfo.getReferencedEntityId( fromEntityId, propertyId, toIds )
This function is identical to the more generic mw.wikibase.getReferencedEntityId
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.getReferencedEntityId.
mw.wikibase.mediainfo.getGlobalSiteId
editmw.wikibase.mediainfo.getGlobalSiteId()
This function is identical to the more generic mw.wikibase.getGlobalSiteId
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.getGlobalSiteId.
MediaInfo entity object
editmw.wikibase.mediainfo.getEntity
(and mw.wikibase.getEntity
, when invoked for a MediaInfo entity) will return a MediaInfo object representing the requested entity.
Like mw.wikibase.mediainfo
and mw.wikibase
, these MediaInfo entity objects are essentially pretty much the same as mw.wikibase.entity
objects, except for:
- the addition of
getCaption*
methods as an alias forgetLabel*
methods - the removal of the
getSitelink*
method, which is a concept that doesn't apply to MediaInfo entities
entity:getId
editentity:getId()
This function is identical to the more generic mw.wikibase.entity:getId
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.entity:getId.
entity:getLabel
editentity:getLabel()
entity:getLabel( langCode )
This function is identical to the more generic mw.wikibase.entity:getLabel
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.entity:getLabel.
entity:getCaption
editentity:getCaption()
entity:getCaption( langCode )
This method is an alias for getLabel.
entity:getDescription
editentity:getDescription()
entity:getDescription( langCode )
This function is identical to the more generic mw.wikibase.entity:getDescription
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.entity:getDescription.
entity:getLabelWithLang
editentity:getLabelWithLang()
entity:getLabelWithLang( langCode )
This function is identical to the more generic mw.wikibase.entity:getLabelWithLang
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.entity:getLabelWithLang.
entity:getCaptionWithLang
editentity:getCaptionWithLang()
entity:getCaptionWithLang( langCode )
This method is an alias for getCaptionWithLang.
entity:getDescriptionWithLang
editentity:getDescriptionWithLang()
entity:getDescriptionWithLang( langCode )
This function is identical to the more generic mw.wikibase.entity:getDescriptionWithLang
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.entity:getDescriptionWithLang.
entity:getProperties
editentity:getProperties()
This function is identical to the more generic mw.wikibase.entity:getProperties
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.entity:getProperties.
entity:getBestStatements
editentity:getBestStatements( propertyIdOrLabel )
This function is identical to the more generic mw.wikibase.entity:getBestStatements
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.entity:getBestStatements.
entity:getAllStatements
editentity:getAllStatements( propertyIdOrLabel )
This function is identical to the more generic mw.wikibase.entity:getAllStatements
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.entity:getAllStatements.
entity:formatPropertyValues
editentity:formatPropertyValues( propertyLabelOrId )
entity:formatPropertyValues( propertyLabelOrId, acceptableRanks )
This function is identical to the more generic mw.wikibase.entity:formatPropertyValues
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.entity:formatPropertyValues.
entity:formatStatements
editentity:formatStatements( propertyLabelOrId )
entity:formatStatements( propertyLabelOrId, acceptableRanks )
This function is identical to the more generic mw.wikibase.entity:formatStatements
provided by Wikibase.
Please refer to Wikibase Lua documentation for mw.wikibase.entity:formatStatements.