Templates can also be coded in lua, which is comparable to javascript in expressivity. It's not so hard to code a generic lua template that could act as reasonator, multilingual and that could be imported into every language versions of Wikipedia.
Here is the interesting thing : this generic version could be, in my proposition, associated to the query "every item", so it is totally compatible. But every wikipedia could also overload the mechanism by associating language specific versions of the template for specific kind on item.
This leads us to the original question of this thread, as every query's results is a subset of the result of the query "every item on WIkidata".