Módulo:Teste: diferenças entre revisões
Saltar para a navegação
Saltar para a pesquisa
Sem resumo de edição |
Sem resumo de edição |
||
| Linha 2: | Linha 2: | ||
function p.foo(frame) | function p.foo(frame) | ||
return mw.wikibase. | return mw.logObject(mw.wikibase.getEntity("Q4")) | ||
end | end | ||
Revisão das 19h12min de 11 de maio de 2020
A documentação para este módulo pode ser criada na página Módulo:Teste/doc
local p = {}
function p.foo(frame)
return mw.logObject(mw.wikibase.getEntity("Q4"))
end
function p.qualifiers(frame)
local entity = mw.wikibase.getEntity("Q4")
local snak = entity['claims']
return mw.wikibase.formatValue( snak )
end
function p.entidade(frame)
local entity = trim(frame.args[1])
if not entity:match('^[QP]%d{1,10}$') then
entity = mw.wikibase.resolvePropertyId(entity) or entity
end
-- entity = mw.wikibase.getEntity(trim(frame.args[2]) or nil)
if entity == '' then
entity = mw.wikibase.getEntity()
if entity == nil or entity.claims == nil then return 'No wikidata entity' end
else
entity = mw.wikibase.getEntity(entity)
if entity == nil then
return 'No wikidata entity: ' .. frame.args[1]
end
end
end
return p