Not sure what wikidata has to do with anything, but the standard way to
generate interwiki links is to install pywikipediabot, a bundle of
Python scripts which includes interwiki.py to perform exactly this task.
There should be info on botwiki.sno.cc