Module:Wikidata/doc: Difference between revisions

Content deleted Content added
Methods: update link
m Testing: <source>
Line 109:
=== Testing spouse ===
Copy and paste the following into any article and preview it (please don't save!):
<source lang="moin">
<pre>
* - {{#invoke:Wikidata|getValue|P26|}}
* - {{#invoke:Wikidata|getValue|P26|FETCH_WIKIDATA}}
* - {{#invoke:Wikidata|getValue|P26|[[Hillary Rodham Clinton]]}}
</presource>
 
In [[Bill Clinton]] you should get:
Line 140:
=== Testing birthplace ===
Copy and paste the following into any article and preview it (please don't save!):
<source lang="moin">
<pre>
* - {{#invoke:Wikidata|getValue|P19|}}
* - {{#invoke:Wikidata|getValue|P19|FETCH_WIKIDATA}}
* - {{#invoke:Wikidata|getValue|P19|[[Newport]]}}
</presource>
Try [[William Ellery]] and check that the Wikidata call correctly disambiguates.
 
Line 150:
Copy and paste the following into any article and preview it (please don't save!):
<pre>
* - {{#invoke:Wikidata|getValue|P19|FETCH_WIKIDATA}}
* - {{#invoke:Wikidata|getValue|P26|FETCH_WIKIDATA}}
* - {{#invoke:Wikidata|getValue|P27|FETCH_WIKIDATA}}
* - {{#invoke:Wikidata|getValue|P140|FETCH_WIKIDATA}}
* - {{#invoke:Wikidata|getRawValue|P21|FETCH_WIKIDATA}}
* - {{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|dmy}}
* - {{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|mdy}}
* - {{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|y}}
</pre>
This should return the Wikidata values for birthplace, spouse, citizenship, religion, gender, date of birth (twice) and year of birth, if they exist. The dob is first in dmy format and then in mdy.
Line 164:
Copy and paste the following into a short section of article such as [[Horace #See also]] and preview it (please don't save!):
<pre>
* - {{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|y}}
* - {{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|y|BCE}}
</pre>
This should return 65 BC and 65 BCE, respectively.