Modulo:Wikidata: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m ottimizzazione |
m new fix |
||
Riga 422:
-- Entry-point per {{#invoke:Wikidata|checkStatements}}
function p.checkStatements(frame)
local entity, property, value,
property = frame.args.property and string.upper(frame.args.property)
value = frame.args.value
if not property then
Line 435 ⟶ 434:
if entity and entity.claims and entity.claims[property] then
local claims = entity.claims[property]
for
if claim and claim.mainsnak and claim.mainsnak.datavalue then
local options = { formatting = 'nolink' }
-- controllo tramite identificatore per tipo di dato "elemento"
▲ local datavalue = formatDatavalue(claim.mainsnak.datavalue, options, formatting)
if
checkvalue = formatEntityId(getEntityIdFromValue(datavalue.value), options, 'raw')
return true▼
if checkvalue == string.upper(value) then
return n
end
end
-- controllo testuale tra stringhe
checkvalue = formatDatavalue(datavalue, options)
if tostring(checkvalue) == value then
end
end
|