Diferencia entre revisiones de «Módulo:Wikibase»

Sin resumen de edición
Sin resumen de edición
Línea 44: Línea 44:
         return mw.wikibase.sitelink( id )
         return mw.wikibase.sitelink( id )
end
end
 
-- Devuelve el primer elemento de una propiedad de un ítem dado.
function p.claim(frame)
        if frame.id == nil then
            entity = mw.wikibase.getEntity()
            if not entity then return nil end
        else
            entity = mw.wikibase.getEntity(frame.id)
            if not entity then return nil end
        end
        return entity.claims[frame.property]
end
 
return p
return p