Hi!
I see that when I use the Java API to add a Statement with a Property pointing to an Item, but the Item has been merged:

org.wikidata.wdtk.wikibaseapi.apierrors.MediaWikiApiErrorException: [modification-failed] [[Item:Q1040|Q1040]] not found
        at org.wikidata.wdtk.wikibaseapi.apierrors.MediaWikiApiErrorHandler.throwMediaWikiApiErrorException(MediaWikiAp
iErrorHandler.java:62)

Is there a way to put in Items such that Wikibase would point them to the merge target?
Or, do I need to use the API to find out the merge target so I could use that instead?

Thanks!
Cheers
Miguel