This page is currently a draft. More information and discussion about changes to this draft may be on thediscussion page. |
Various tools support TemplateData maps for mapping between parameters and their corresponding Wikidata properties.
Below, a barebone example of templateData that shows you how the 'maps' key fits in with the rest of the templateData. 'maps' values correspond to the name of the service being used, in this case 'wikidata.'. The values in the wikidata object must be valid 'params' (i.e. in this case, 'foo' - aliases are not allowed); 'maps' keys, i.e. 'bar' here, correspond to keys coming from the wikidata service.
"description":null,"params":{"foo":{"label":null,"description":null,"default":null,"example":null,"required":false,"suggested":false,"deprecated":false,"aliases":[],"type":"unknown","autovalue":null}},"paramOrder":["foo"],"sets":[],"maps":{"wikidata":{"P1234":"foo"}}
[{P1234:'foo'}]
{{mytemplate|foo = P1234 value}}
This is a full example of a template and maps for wikidata.
Template:
{|! Country || {{{Country|{{#property:P17}}}}}|-| colspan="2" | {{{Flag|[[File:{{#property:P41}}|200px]]}}}|}Template data (maps part):
"maps":{"wikidata":{"P17":"Country","P41":"Flag",}}
A complete list of fields are defined inwikidata:Special:ListProperties