def riids_of_mip(dq, mip):
    """Request item ids that link to the mip."""
    return set(ri
               for rlid in (rl.uid
                            for rl in dq.coll['requestLink'].items
                            if rl.mip == mip)
               for ri in dq.inx.iref_by_sect[rlid].a['requestItem'])