<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://www.wikiw.cn/index.php?action=history&amp;feed=atom&amp;title=%E6%A8%A1%E5%9D%97%3AWikidataCheck</id>
	<title>模块:WikidataCheck - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://www.wikiw.cn/index.php?action=history&amp;feed=atom&amp;title=%E6%A8%A1%E5%9D%97%3AWikidataCheck"/>
	<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:WikidataCheck&amp;action=history"/>
	<updated>2026-04-08T20:06:30Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:WikidataCheck&amp;diff=397&amp;oldid=prev</id>
		<title>Admin：​导入1个版本</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:WikidataCheck&amp;diff=397&amp;oldid=prev"/>
		<updated>2025-06-20T17:02:26Z</updated>

		<summary type="html">&lt;p&gt;导入1个版本&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2025年6月21日 (六) 01:02的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;zh-Hans-CN&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;（没有差异）&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:WikidataCheck&amp;diff=396&amp;oldid=prev</id>
		<title>wikiw&gt;TimWu007：​自Module:WikidataCheck/sandbox合并Tjmj的版本70745879</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:WikidataCheck&amp;diff=396&amp;oldid=prev"/>
		<updated>2022-05-09T01:32:16Z</updated>

		<summary type="html">&lt;p&gt;自&lt;a href=&quot;/index.php?title=%E6%A8%A1%E5%9D%97:WikidataCheck/sandbox&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;模块:WikidataCheck/sandbox（页面不存在）&quot;&gt;Module:WikidataCheck/sandbox&lt;/a&gt;合并&lt;a href=&quot;/index.php?title=%E7%89%B9%E6%AE%8A:%E7%94%A8%E6%88%B7%E8%B4%A1%E7%8C%AE/Tjmj&quot; title=&quot;特殊:用户贡献/Tjmj&quot;&gt;Tjmj&lt;/a&gt;的&lt;a href=&quot;/index.php?title=%E7%89%B9%E6%AE%8A:%E5%9B%BA%E5%AE%9A%E9%93%BE%E6%8E%A5/70745879&quot; title=&quot;特殊:固定链接/70745879&quot;&gt;版本70745879&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.wikidatacheck(frame)&lt;br /&gt;
    local pframe = frame:getParent()&lt;br /&gt;
    local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself&lt;br /&gt;
    local args = pframe.args -- the arguments passed TO the template, in the wikitext that transcludes the template&lt;br /&gt;
    &lt;br /&gt;
    local property = config.property&lt;br /&gt;
    local value = config.value or &amp;quot;&amp;quot;&lt;br /&gt;
    local catbase = config.category&lt;br /&gt;
    local namespaces = config.namespaces&lt;br /&gt;
    local nocatsame = config.nocatsame or &amp;quot;&amp;quot;&lt;br /&gt;
    local qid = config.qid or &amp;quot;&amp;quot;&lt;br /&gt;
    local ok = false -- one-way flag to check if we&amp;#039;re in a good namespace&lt;br /&gt;
    local ns = mw.title.getCurrentTitle().namespace&lt;br /&gt;
    for v in mw.text.gsplit( namespaces, &amp;quot;,&amp;quot;, true) do&lt;br /&gt;
        if tonumber(v) == ns then&lt;br /&gt;
            ok = true&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    if not ok then -- not in one of the approved namespaces&lt;br /&gt;
        return &amp;quot;&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    local entity&lt;br /&gt;
    if qid == &amp;quot;&amp;quot; then&lt;br /&gt;
        entity = mw.wikibase.getEntityObject()&lt;br /&gt;
    else&lt;br /&gt;
        entity = mw.wikibase.getEntityObject(qid)&lt;br /&gt;
    end&lt;br /&gt;
    if not entity then -- no Wikidata item (根本找不到对应的维基数据页)&lt;br /&gt;
        return &amp;quot;[[Category:不在維基數據的&amp;quot; .. catbase .. &amp;quot;]]&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if value == &amp;quot;&amp;quot; then&lt;br /&gt;
    	return nil -- Using Wikidata (检索维基数据页)&lt;br /&gt;
    end&lt;br /&gt;
    local claims = entity.claims or {}&lt;br /&gt;
    local hasProp = claims[property]&lt;br /&gt;
    if not hasProp then -- no claim of that property (在维基数据页的各条信息项都中没有对应的信息)&lt;br /&gt;
        return &amp;quot;[[Category:不在維基數據的&amp;quot; .. catbase .. &amp;quot;]]&amp;quot; -- bad. Bot needs to add the property (这不是好事,但可以由机器人完成对应项的添加)&lt;br /&gt;
    end&lt;br /&gt;
    for i, v in ipairs(hasProp) do	-- Now we try to iterate over all possible values? (将要检查的模板参数与多条信息记录逐个取值比对)&lt;br /&gt;
    	propValue = (v.mainsnak.datavalue or {}).value&lt;br /&gt;
    	if propValue == value then&lt;br /&gt;
    		if nocatsame == &amp;quot;&amp;quot; then&lt;br /&gt;
    			return &amp;quot;[[Category:與維基數據相同的&amp;quot; .. catbase .. &amp;quot;]]&amp;quot; -- yay! (这是好结果,表示调用模板时填写的信息参数和wikidata中填写的信息能对得上号,万事大吉)&lt;br /&gt;
    		else&lt;br /&gt;
    			return nil -- if nocatsame, the &amp;quot;same as&amp;quot; category is not added （如果有nocatsame参数,不加入“相同”分类）&lt;br /&gt;
    		end&lt;br /&gt;
    	end&lt;br /&gt;
	end&lt;br /&gt;
    return &amp;quot;[[Category:與維基數據不同的&amp;quot; .. catbase .. &amp;quot;]]&amp;quot; -- needs human review :( (此结果表示虽然wikidata中有对应的信息项,但是与调用模板时填写的参数不匹配,需要人工查证)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>wikiw&gt;TimWu007</name></author>
	</entry>
</feed>