Improve PoolQuery to allow queries on dependencies. (bnc #475682)