Movatterモバイル変換


[0]ホーム

URL:


Jump to content
MediaWiki
Search

Wikibase/Maps TemplateData

From mediawiki.org
<Wikibase
This page is currently a draft.
More information and discussion about changes to this draft may be on thediscussion page.
Further information:Help:TemplateData
Further information:phab:T69659

Various tools support TemplateData maps for mapping between parameters and their corresponding Wikidata properties.

Example of TemplateData skeleton

[edit]

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"}}

A wikidata bound parameter with the field "P1234"

[edit]
[{P1234:'foo'}]

Resulting template

[edit]

{{mytemplate|foo = P1234 value}}

Example

[edit]

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",}}

Available fields and field structure

[edit]

A complete list of fields are defined inwikidata:Special:ListProperties

Tools supporting Wikidata maps

[edit]
Retrieved from "https://www.mediawiki.org/w/index.php?title=Wikibase/Maps_TemplateData&oldid=5894524"
Category:
Hidden category:

[8]ページ先頭

©2009-2025 Movatter.jp