Currently, there is no easy way to fetch the Structured Data on Commons (SDOC) M-ID for e.g. the value of the "image" property on Wikidata.
The value of the "image" property in Wikidata RDF dumps is an URL like http://commons.wikimedia.org/wiki/Special:FilePath/Leon%20Cogniet%20-%20Jean-Francois%20Champollion.jpg
However, this is the URL of the file itself, and not of the SDOC MediaInfo entity.
This requires people to write SPARQL queries between Wikidata and SDOC to "hack" in order to fetch the M-ID for a given "Commons File" value on Wikidata.
It would be nice to provide the M-IDs in Wikidata dumps using the same "normalized value" system that is already used for RDF URIs for some "external id" properties. For example, we could have:
wd:Q123 wdt:P18 <http://commons.wikimedia.org/wiki/Special:FilePath/Leon%20Cogniet%20-%20Jean-Francois%20Champollion.jpg> . wd:Q123 wdtn:P234 sdoc:M22222
instead of just
wd:Q123 wdt:P18 <http://commons.wikimedia.org/wiki/Special:FilePath/Leon%20Cogniet%20-%20Jean-Francois%20Champollion.jpg> .
The "normalized value" system is not used already for "commons files" and so, allows to keep RDF backward compatibility.