I am using Refinitiv python API to clean the data for a project for which I have a dataset with a massive number of international bonds with CUSIPs and ISINs as identifiers. I have to keep a record of unique bonds and merge them with another dataset. My problem is specifically two groups of bonds :
1) bonds with only one unique issue, but multiple sets of identifiers are assigned to them. For example, take the bond with the PermID 46643978220. As in the following picture, both CUSIPs of 03965UAC4 and 03965UAD2 are assigned to this unique bond (each for a different set of investors). Therefore, in my dataset with CUSIPs and ISINs, I see these two identifiers as two distinct bonds, which is problematic if I add their face values to get the issuer's debt.
PS: Please note that in this case, I solved the problem by finding the PermID of the two CUSIPs, which are identical. I would be happy to know if there is a better way to solve it.
2) Some bond issues are distinct (in their target market and identifiers) but coupled in their issuing. For example, from the same issuer above, the two issues whose ISINs are US03965TAA16 and USP04568AA23 are duplicates of each other, as shown in the following picture. Crucially, since for such bonds, one of them is a portion of the other, the amount outstanding and amount issued must not be added up; otherwise, double counting happens in the issuer's debt. Furthermore, investors' ownership has to be aggregated for the bonds; otherwise, one would erroneously think she observes only half of the actual bondholders while she observes all. How should I link together such duplicated assets?
PS: I can not solve this problem with PermIDs as in case 1 since such bonds have distinct PermIDs.
Bests, Alireza