Relying questions TMg posted on the draft's talk page
<https://meta.wikimedia.org/wiki/Talk:Wikidata/Notes/Inclusion_syntax>:
Localization, syntax and more questions
1) Currently we are using the hash syntax for parser functions like {{#if:
and {{#expr:. I'm not sure if it's a good idea to use the same syntax for the
Wikidata stuff. As you said the output of e.g. {{#data-value: can not be used as
an input for e.g. {{#if:. Isn't this confusing?
2) Maybe it would be more confusing to invent a new syntax?
3) Why does data-template use a dash but data_item and data_param are using
underscores? Please use dashes everywhere. Be consistent with the HTML5 data-*
attributes.
4) Why not using the same syntax inside the templates? For example,
{{{data-color}}} instead of {{{data.color}}}?
5) Are we free to use localized template names and parameter names for the
new infobox syntax? I consider this very, very important. Here is an example why
this is so important. We need a clearly defined point where the parameter names
can be translated to create a localized version of the same template.
6) Overall, I'm not sure if the new infobox syntax is meant to be used in
articles or in other templates? Can we keep our existing localized templates and
use the new syntax in these templates? The new syntax should allow this.
--TMg 14:23, 22 May 2012 (UTC)
Hi TMg, thanks for your input!
1) these are parser functions. And you can use their output as input for
other parser functions, they are just riddled with a lot of HTML and so pretty
useless as conditions, etc. But I will rephrase the relevant sentence - the
output of #data-value etc can be used as the seconds or third parameter to #if
just fine, it just doesn't make sense to use it as the first parameter (the
condition).
2) yes :) Also much harder to implement.
3) ok, will use slashes instead of underscores in parameter names.
4) {{{data.color}}} is a structured identifier, meaning the property
"color" of the object "data". Dots (and colons) are commonly used in
programming
languages to denote sub-entities (parts, properties, members, etc). in contrast,
data-template or data-param are not structured - they are just compound phrases.
The do not denote sub-entities.
5) Template names are completely custom. It's not that you can localize
them - you will have to provide your own. As to the parameters supported by the
parser functions... they will use whatever mechanism exists for localizing the
parameter names of parser functions. I don't know if MediaWiki supports it. If
MediaWiki supports it, Wikidata/Wikibase supports it.
6) The intention is to use {{#data-template:whatever}} in the article and
{{#data-value:data.foo}} in the template. If you want to hide the
{{#data-template}} stuff, you can wrap another template around it: {{Whatever}}
would do {{#data-template:whatever-format}}, and whatever-format would contain
the actual formatting logic.
HTH -- Duesentrieb (talk) 14:44, 22 May 2012 (UTC)
--
Daniel Kinzler, Softwarearchitekt
Wikimedia Deutschland e.V. | Eisenacher Straße 2 | 10777 Berlin
http://wikimedia.de | Tel. (030) 219 158 260
Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e.V.
Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg
unter der Nummer 23855 B. Als gemeinnützig anerkannt durch das Finanzamt
für Körperschaften I Berlin, Steuernummer 27/681/51985.