<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.americanmusicclub.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=82.45.65.97</id>
	<title>The Official Website for Mark Eitzel &amp; American Music Club - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.americanmusicclub.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=82.45.65.97"/>
	<link rel="alternate" type="text/html" href="https://wiki.americanmusicclub.com/wiki/Special:Contributions/82.45.65.97"/>
	<updated>2026-04-06T11:07:37Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>https://wiki.americanmusicclub.com/index.php?title=Module:Wikidata/doc&amp;diff=19062</id>
		<title>Module:Wikidata/doc</title>
		<link rel="alternate" type="text/html" href="https://wiki.americanmusicclub.com/index.php?title=Module:Wikidata/doc&amp;diff=19062"/>
		<updated>2013-09-29T17:31:46Z</updated>

		<summary type="html">&lt;p&gt;82.45.65.97: /* Example:birth place */ correct the typo: spouse -&amp;gt; birth place&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{module rating|alpha}}&lt;br /&gt;
This module is a modification of the original at [[Module:Sandbox/Tom Morris]] which was created 19 May 2013.&lt;br /&gt;
&lt;br /&gt;
The module &amp;quot;{{BASEPAGENAME}}&amp;quot; contains:&lt;br /&gt;
* a call (getValue) that allows the calling script to retrieve the wiki-linked value(s) for any property from Wikidata by supplying the property ID as the first parameter.&lt;br /&gt;
* a call (getRawValue) that allows the calling script to retrieve the non-linked value(s) for any property from Wikidata by supplying the property ID as the first parameter.&lt;br /&gt;
* a call (getDateValue) that allows the calling script to retrieve the date value(s) for any property from Wikidata by supplying the property ID as the first parameter. It allows specifying that the date be returned in dmy or mdy format by supplying &amp;quot;dmy&amp;quot; or &amp;quot;mdy&amp;quot; as an optional third parameter.&lt;br /&gt;
&lt;br /&gt;
If the property is not defined in Wikidata for the article that invokes this code, then an empty string (&amp;quot;&amp;quot;) is returned.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
* For the generalised linked case (getValue), two unnamed parameters are supplied. The first is the ID of the property that is to be retrieved (e.g. p19 for birthplace or p26 for spouse). The second may be null, &amp;quot;FETCH_WIKIDATA&amp;quot;, or any other string, which becomes the returned value.&lt;br /&gt;
* For the generalised unlinked case (getRawValue), two unnamed parameters are supplied. The first is the ID of the property that is to be retrieved (e.g. p21 for gender). The second may be null, &amp;quot;FETCH_WIKIDATA&amp;quot;, or any other string, which becomes the returned value.&lt;br /&gt;
* For the generalised date case (getDateValue), three unnamed parameters are supplied. The first is the ID of the property that is to be retrieved (e.g. p569 for date of birth). The second may be null, &amp;quot;FETCH_WIKIDATA&amp;quot;, or any other string, which becomes the returned value. The third is the format that the date should be returned in, either dmy or mdy.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
=== Example:spouse ===&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Wikidata|getValue|p26|}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; = returns nothing, so suppresses the display of spouse in an infobox&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Wikidata|getValue|p26|FETCH_WIKIDATA}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; = returns the linked value(s) of property p26 (spouse) stored in wikidata for the corresponding article (e.g. for article [[Bill Clinton]], it returns [[Hillary Rodham Clinton]])&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Wikidata|getValue|p26|[[Hillary Clinton]]}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; = returns [[Hillary Clinton]], allowing an infobox to use a local value rather than the value stored in Wikidata.&lt;br /&gt;
&lt;br /&gt;
=== Example in Infobox template ===&lt;br /&gt;
Inside an infobox definition, it may be called like this:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;| data55 = {{#invoke:Wikidata|getValue|p26|{{{spouse|FETCH_WIKIDATA}}} }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
which causes the infobox to:&lt;br /&gt;
# not display spouse if the infobox parameter &amp;lt;code&amp;gt;|spouse&amp;lt;/code&amp;gt; is set to be blank (as &amp;lt;code&amp;gt;&amp;quot;| spouse =&amp;quot;&amp;lt;/code&amp;gt;}&lt;br /&gt;
# display the linked value(s) from Wikidata if the infobox parameter &amp;lt;code&amp;gt;|spouse&amp;lt;/code&amp;gt; is not supplied&lt;br /&gt;
# display the local infobox parameter &amp;lt;code&amp;gt;|spouse&amp;lt;/code&amp;gt; if it is supplied (e.g. &amp;lt;code&amp;gt;&amp;quot;|spouse = Hillary Clinton&amp;quot;&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Optionally, it could be called as:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;| data55 = {{#invoke:Wikidata|getValue|p26|{{{spouse|}}} }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
which should behave as the parameter does now, unless the parameter is set to FETCH_WIKIDATA when it displays the linked value(s) fetched from Wikidata.&lt;br /&gt;
&lt;br /&gt;
=== Example:birth place ===&lt;br /&gt;
This works in just the same way as the calls above:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Wikidata|getValue|p19|}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; = returns nothing, so suppresses the display of birth place in an infobox&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Wikidata|getValue|p19|FETCH_WIKIDATA}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; = returns the linked value(s) of property p19 (place of birth) stored in wikidata for the corresponding article (e.g. for article [[Bill Clinton]], it returns [[Hope, Arkansas]])&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Wikidata|getValue|p19|[[Hope, Arkansas|Hope]]}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; = returns [[Hope, Arkansas|Hope]], allowing an infobox to use a local value rather than the value stored in Wikidata.&lt;br /&gt;
&lt;br /&gt;
=== Example:gender ===&lt;br /&gt;
We don&#039;t want the returned value linked, so use:&lt;br /&gt;
* - &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Wikidata|getRawValue|p21|FETCH_WIKIDATA}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example:date of birth ===&lt;br /&gt;
If we want the date of birth in dmy format, we use:&lt;br /&gt;
* - &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Wikidata|getDateValue|p569|FETCH_WIKIDATA|dmy}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want the date of birth in mdy format, we use:&lt;br /&gt;
* - &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Wikidata|getDateValue|p569|FETCH_WIKIDATA|mdy}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Testing spouse ===&lt;br /&gt;
Copy and paste the following into any article and preview it (please don&#039;t save!):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* - {{#invoke:Wikidata|getValue|p26|}}&lt;br /&gt;
* - {{#invoke:Wikidata|getValue|p26|FETCH_WIKIDATA}}&lt;br /&gt;
* - {{#invoke:Wikidata|getValue|p26|[[Hillary Clinton]]}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In [[Bill Clinton]] you should get:&lt;br /&gt;
* -&lt;br /&gt;
* - [[Hillary Rodham Clinton]]&lt;br /&gt;
* - [[Hillary Clinton]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In [[Barack Obama]] you should get:&lt;br /&gt;
* -&lt;br /&gt;
* - [[Michelle Obama]]&lt;br /&gt;
* - [[Hillary Clinton]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In [[Richard Burton]] you should get:&lt;br /&gt;
* -&lt;br /&gt;
* - [[Sally Burton]], [[Elizabeth Taylor]]&lt;br /&gt;
* - [[Hillary Clinton]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In [[Franz Kafka]] you should get:&lt;br /&gt;
* -&lt;br /&gt;
* -&lt;br /&gt;
* - [[Hillary Clinton]]&lt;br /&gt;
&lt;br /&gt;
=== Testing birthplace ===&lt;br /&gt;
Copy and paste the following into any article and preview it (please don&#039;t save!):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* - {{#invoke:Wikidata|getValue|p19|}}&lt;br /&gt;
* - {{#invoke:Wikidata|getValue|p19|FETCH_WIKIDATA}}&lt;br /&gt;
* - {{#invoke:Wikidata|getValue|p19|[[Newport]]}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Try [[William Ellery]] and check that the Wikidata call correctly disambiguates.&lt;br /&gt;
&lt;br /&gt;
=== Testing getValue, getRawValue and getDateValue ===&lt;br /&gt;
Copy and paste the following into any article and preview it (please don&#039;t save!):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* - {{#invoke:Wikidata|getValue|p19|FETCH_WIKIDATA}}&lt;br /&gt;
* - {{#invoke:Wikidata|getValue|p26|FETCH_WIKIDATA}}&lt;br /&gt;
* - {{#invoke:Wikidata|getValue|p27|FETCH_WIKIDATA}}&lt;br /&gt;
* - {{#invoke:Wikidata|getValue|p140|FETCH_WIKIDATA}}&lt;br /&gt;
* - {{#invoke:Wikidata|getRawValue|p21|FETCH_WIKIDATA}}&lt;br /&gt;
* - {{#invoke:Wikidata|getDateValue|p569|FETCH_WIKIDATA|dmy}}&lt;br /&gt;
* - {{#invoke:Wikidata|getDateValue|p569|FETCH_WIKIDATA|mdy}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This should return the Wikidata values for birthplace, spouse, citizenship, religion, gender and date of birth (twice) if they exist. The dob is first in dmy format and then in mdy.&lt;br /&gt;
&lt;br /&gt;
[[Category:Wikidata]]&lt;/div&gt;</summary>
		<author><name>82.45.65.97</name></author>
	</entry>
</feed>