This depends only on implementation details of links..
This is not the usual way to do it, but I don't see a special difficulty in having the 'link' commands registering the source in an attribute of the destination, in which case you can answer 'what other tags does this file have?' quite easily.
Another way to do it would be to have a separated database which would register such things.
A find command would work too, even if the answer would be much slower.