跳转到内容

模組:Taxobox wikidata/sandbox

本页使用了标题或全文手工转换
维基百科,自由的百科全书

这是Module:Taxobox wikidata/sandbox当前版本,由Taeas留言 | 贡献编辑于2023年7月14日 (五) 10:45。这个网址是本页该版本的固定链接。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)
local wdib = require('Module:WikidataIB')

local p = {}
local l = {}

function p.main(frame)
    return l.getDataRaw('Q42196', 'P105')
end

local function has_content(arg)
    return arg ~= nil and arg ~= ""
end


function l.getData(args, id)
	local opts = {id}
	opts.qid = has_content(args.qid) and args.qid or nil
	opts.onlysourced = has_content(args.onlysourced) and args.onlysourced or "no"
	opts.noicon = has_content(args.noicon) and args.noicon or "true"
	opts.fetchwikidata = has_content(args.fetchwikidata) and args.fetchwikidata or "ALL"
    opts.suppressfields = has_content(args.suppressfields) and args.suppressfields or nil
	return wdib._getValue(opts)
end

function l.getDataRaw(qid, pid)
	local opts = {pid}
	opts.qid = qid
	opts.onlysourced = "no"
	opts.noicon = "true"
	opts.fetchwikidata = "ALL"
    opts.plaindate = "no"
    opts.rank = 'best'
    opts.linked = "no"
    opts.qualsonly = "yes"
	return wdib._getValue(opts)
end

return p