https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3AWikidataIdentifiersModule:WikidataIdentifiers - Revision history2025-06-07T17:45:24ZRevision history for this page on the wikiMediaWiki 1.45.0-wmf.4https://en.wikipedia.org/w/index.php?title=Module:WikidataIdentifiers&diff=1096474532&oldid=prevMusikBot II: Changed protection settings for "Module:WikidataIdentifiers": High-risk template or module: 2500 transclusions (more info) ([Edit=Require extended confirmed access] (indefinite) [Move=Require extended confirmed access] (indefinite))2022-07-04T17:59:54Z<p>Changed protection settings for "<a href="/wiki/Module:WikidataIdentifiers" title="Module:WikidataIdentifiers">Module:WikidataIdentifiers</a>": <a href="/wiki/Wikipedia:High-risk_templates" title="Wikipedia:High-risk templates">High-risk template or module</a>: 2500 transclusions (<a href="/wiki/User:MusikBot_II/TemplateProtector" title="User:MusikBot II/TemplateProtector">more info</a>) ([Edit=Require extended confirmed access] (indefinite) [Move=Require extended confirmed access] (indefinite))</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 17:59, 4 July 2022</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>MusikBot IIhttps://en.wikipedia.org/w/index.php?title=Module:WikidataIdentifiers&diff=804712432&oldid=prevMusikAnimal: Protected "Module:WikidataIdentifiers": High-risk Lua module; 1,000+ transclusions ([Edit=Require autoconfirmed or confirmed access] (indefinite))2017-10-10T17:47:29Z<p>Protected "<a href="/wiki/Module:WikidataIdentifiers" title="Module:WikidataIdentifiers">Module:WikidataIdentifiers</a>": <a href="/wiki/Wikipedia:High-risk_templates" title="Wikipedia:High-risk templates">High-risk Lua module</a>; 1,000+ transclusions ([Edit=Require autoconfirmed or confirmed access] (indefinite))</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 17:47, 10 October 2017</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>MusikAnimalhttps://en.wikipedia.org/w/index.php?title=Module:WikidataIdentifiers&diff=766684938&oldid=prevRexxS: create module to hold functions for use in retrieving Wikidata for use in templates that deal with identifiers2017-02-21T15:26:43Z<p>create module to hold functions for use in retrieving Wikidata for use in templates that deal with identifiers</p>
<p><b>New page</b></p><div>-- Functions for use in retrieving Wikidata for use in templates that deal with identifiers<br />
-- getIdentifierQualifier returns the value of a qualifier for an Identifier<br />
<br />
p = {}<br />
<br />
-- getIdentifierQualifier returns the value of a qualifier for an Identifier<br />
-- such as 'Art UK artist ID', P1367<br />
-- the assumption is that one value exists for the property<br />
-- and only one qualifier exists for that value<br />
-- Constraint violations for P1367 are at:<br />
-- https://www.wikidata.org/wiki/Wikidata:Database_reports/Constraint_violations/P1367#Single_value<br />
p.getIdentifierQualifier = function(frame)<br />
local propertyID = mw.text.trim(frame.args[1] or "")<br />
<br />
-- The PropertyID of the qualifier<br />
-- whose value is to be returned is passed in named parameter |qual=<br />
local qualifierID = frame.args.qual<br />
<br />
-- Can take a named parameter |qid which is the Wikidata ID for the article.<br />
-- This will not normally be used because it's an expensive call.<br />
local qid = frame.args.qid<br />
if qid and (#qid == 0) then qid = nil end<br />
<br />
local entity = mw.wikibase.getEntityObject(qid)<br />
local props<br />
if entity and entity.claims then<br />
props = entity.claims[propertyID]<br />
end<br />
if props then<br />
-- Check that the first value of the property is an external id<br />
if props[1].mainsnak.datatype == "external-id" then<br />
-- get any qualifiers of the first value of the property<br />
local quals = props[1].qualifiers<br />
if quals and quals[qualifierID] then<br />
-- check what the dataype of the first qualifier value is<br />
-- if it's quantity return the amount<br />
if quals[qualifierID][1].datatype == "quantity" then<br />
return tonumber(quals[qualifierID][1].datavalue.value.amount)<br />
end<br />
-- checks for other datatypes go here:<br />
<br />
end<br />
end<br />
end<br />
end<br />
<br />
<br />
return p</div>RexxS