Currently `{{#property:P402}}` can pull some OSM relations from Wikidata. That property is now up for deletion (my fault, see T145284), and AFAIK there's no replacement which doesn't involve going through a maplinkIt is only possible to do so for ways within Kartographer's maplink and mapframe tags. We should have a parser function (e.g. `{{#osm:\d+}}`) whichand/or Lua function returnsning an OSM object ID or multiple IDs in plaintext (e.g. `(node|way|relation)/\d+(;(node|way|relation)/\d+)*`) for template use (such as in the French Wikipedia template [[ https://fr.wikipedia.org/wiki/Modèle:Bases géographiques | Bases géographiques ]]). Lua access would be nice as well.
----
[[ https://taginfo.openstreetmap.org/keys/wikidata | OSM objects with Wikidata tag ]] (12 Nov 2018)
| all | 1,199,542 |
| nodes | 593,392 |
| ways | 302,556 |
| relations | 303,594 |