New Version (January 2013) This is a completely reworked proposal with little resemblance to the previous drafts!

This page describes the data inclusion syntax for the Wikibase client, by which the properties of data items can be included and rendered on a wiki page using templates. In short: This is how we want Wikipedia articles to include data from Wikidata.

The inclusion syntax presented here is meant to work for simple cases, and only for them.

Complicated cases are currently planned to be realized using Lua. We do not know yet how the binding to Lua will look like, but we are confident that it will be far easier to use than any binding to Wikitext could ever look like. (Lua would be able to access Wikidata items and then programmatically work on them).

Properties of a Wikidata Item can be used via the #property parser function:

{{#property:population}}

This will provide a representation of the value of the population property of the page's default item. The default item is the Wikidata item that is associated with this page via language links.

To access properties of a different item, it has to be specified explicitly, either by id

{{#property:population|id=q12345}}

or the associated Wiki page

{{#property:population|of=Germany}}

(Note that the parameter name "of" works pretty nicely in English, but in other languages we will most likely need to use some other word here, like "item" or "about" or something, because a direct translation of "of" might lead to problems with cases.)

accessing properties of a different item, such as putting {{#property:p36|id=q183}} on another page of it:, referring to the value of the property specified on d:Q183 (the Wikidata page on Germany) (see [1]: "Currently we only support transclusion of data from the item that is directly linked to the page.")

All values that are preferred are returned. The values also include qualifiers and references.

There are a number of further parameters that can be used to fine-tune the formatting:

separator: if there are several values, this is used to separate the values

value template: a template to call on each value, with the parameters value, qualifiers and references

qualifier template: a template to call on each qualifier, using the qualifier property label as the first and the qualifier values as the second parameter. Ignored if there is a qualifiers template.

qualifier separator: if there are several qualifiers, this is used to separate them. Ignored if there is a qualifiers template.

qualifiers wrapper: a template to call on the qualifiers, using the qualifiers as the parameter. Ignored if there is a qualifiers template. Ignored if there are no qualifiers.

qualifiers template: a template to call for all qualifiers, using the qualifier property labels as the argument names and the values as the respective value.

qualifiers value separator: if a single qualifier has several values, this is used to separate these values

reference keyvalue template: a template to call on each key-value pair of a reference, using the key label as the first and the values as the second parameter. Ignored if there is a reference template.

reference wrapper: a template to call on each reference, using the reference as the parameter. Ignored if there is a reference template.

references wrapper: a template to call on all references, using the references as the parameter. Ignored if there is a reference template. Ignored if there are nor references.

reference keyvalue separator: if there are several key-value pairs in one reference, this is used to separate them. Ignored if there is a reference template.

reference template: a template to call on each references of a value, using the key labels as the argument names and the values as the respective value.

reference value separator: if within a reference one key has several values, this is used to separate these values

reference separator: a separator to use between each reference

There is a (sensible) default value for each of these which can be changed per wiki using the messaging system.

Once you have seen this parameter list, you might understand why we want to use Lua for anything that is not "simple".