Modulo:Wikidata/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m aggiunto parametro "entity"
+test getAllStatements
Riga 414:
-- "rank", "qualifier", "qualifiertype" e "n"
local function getClaims(property, args)
local entityentityId, claims, filteredClaims
entityId = args.from or mw.wikibase.getEntityIdForCurrentPage()
-- get entity
if not entityentityId then
entity = args.entity or mw.wikibase.getEntity(args.from)
claims = mw.wikibase.getAllStatements(entityId, property)
if not entity then
return nil
end
 
if property and entity.claims and entity.claims[property] and
#entity.claims[property] > 0 then
claims = entity.claims[property]
else
return nil