Modulo:Wikidata: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
aggiungo la possibilità di richiedere solo le property che hanno un certo rank
così il rank funziona anche in combinazione del parametro n=
Riga 70:
 
if options.n then
local n = tonumber( options.n )
local statementproperty = entity.claims[string.lower( options.property )][n - 1]
if n then
if n then
local statement = entity.claims[string.lower(options.property)][n - 1]
if statementoptions.rank then
local i=0
table.insert( formattedStatements, formatStatement( statement, options ) )
local k=0
local statement = ""
while i ~= n do
statement = entity.claims[property][k]
if statement then
if statement.rank == options.rank then
i=i+1
k=k+1
else
k=k+1
end
else
i=n
end
end
if statement then
table.insert( formattedStatements, formatStatement( statement, options ) )
end
else
local statement = entity.claims[property][n - 1]
if nstatement then
table.insert( formattedStatements, formatStatement( statement, options ) )
end
end
end