Sitelinks from Wikidata to Commons are very unpredictable sometimes linking to categories sometimes to galleries and sometimes to other pages. On the other hand properties are very precise:
- Commons category (P373) links to categories
- Commons Creator page (P1472) links to creator pages
- Commons gallery (P935) links to geleries
- Commons Institution page (P1612) links to institution pages
- image (P18) links to images
The problem is that those Commons pages are not aware that there are being linked to. I would like to have a function in LUA that when called from c:Creator:Leonardo_da_Vinci with mw.wikibase.getEntityIdForCurrentPage('P1472') would return Q762