Modulo:Wikidata: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m commento non aggiornato |
+p._subclassOf() con refactoring di p._instanceOf() |
||
Riga 606:
end
-- Ritorna true se la proprietà P31 (instance of) ha come valore almeno uno tra gli entityId specificati▼
--[[
function p._instanceOf(args)▼
* La proprietà specificata ha come valore almeno uno tra gli entityId specificati?
local statements = p._getProperty( { 'P31', from = args.from, formatting = 'raw' }, true)▼
*
* @param string property Wikidata Property ID
* @param table args values (mixed with .from)
* @return boolean
]]
function p._propertyHasEntity(property, args)
if statements then
for _, statement in ipairs(statements) do
Riga 620 ⟶ 627:
return false
end
▲-- Ritorna true se la proprietà P31 (instance of) ha come valore almeno uno tra gli entityId specificati
▲function p._instanceOf(args)
return p._propertyHasEntity('P31', args)
end
-- Ritorna true se la proprietà P279 (subclass of) ha come valore almeno uno tra gli entityId specificati
function p._subclassOf(args)
return p._propertyHasEntity('P279', args)
end
|