Module:WikidataIB/sandbox1: Difference between revisions

Content deleted Content added
Inline single-use "_getvalue" function
No edit summary
Line 1,063:
-------------------------------------------------------------------------------
p.getValueByQual = function(frame)
local qualID = frame.args[2].qualID
-- The Q-id of the value for the qualifier we want to match is in named parameter |qvalue=
local qval = frame.args.qvalue or ""
Line 1,111:
local propertyID = mw.text.trim(frame.args[1] or "")
if propertyID == "" then return "no property supplied" end
 
-- The property ID of the qualifier with a particular value is in named parameter |qualID=
local qualID = frame.args.qualID or ""
if qualID == "" then return "no qualifier supplied" end
 
Line 1,146 ⟶ 1,144:
-- We'll only deal with wikibase-items for now
if v1q[qualID][1].datatype == "wikibase-item" then
if checkvalue(v1q[qualID][1].datavalue.value.id == qval) then
out[#out + 1] = v1.mainsnak.datavalue.value
end