Get item's linked thing programmatically?

Did you check the following link @rossko57 posted :

This shows a way how to get the thing an item is linked to. Isn’t that what you want ?