I think I would start by restructuring the data differently. Even in a robust language like javascript I would avoid storing data in two parallel "arrays" like you are doing. It would be so easy to get them out of synch.
Maybe keep the list of family members, but then have the field "roles" contain the name of a data tiddler that describes the relationship:
roles: Burts family roles
Burts family roles: (data tiddler)
Burt: son
Connie: wife
Danny: brother
Or keep the list of family members, but then have a series of fields that describe roles:
role-sons: [[Cycil de Mille]] [[Cyrano de bergerac]]
role-wives: Connie
role-brothers:Danny [[Dante Alighieri]]
You can use the fields operator to get a list of all fields and the
prefix operator to limit that selection to just ones marked "roles-" .
There's no arrays in TW parlance, but there are lists and list fields.
See the tiddler "Filter Operators" at
tiddlywiki.com and review list,
enlist, listop operators and string operators to get an idea of the tech
available.
AFAIK, there's no indexing lists, but there are other tools. If you have items in the list with spaces in the name, surround the name with double square brackets as in the examples above.
Also, you can nest <$lists> inside lists, linking the inner ones with the 'all[current]' filter operator to be driven by the outer ones.
So, I recommend picking a data structure that matches the way TW works (probably the 2nd method, thought the first method corresponds to better database design).
But maybe someone will come along with a more straight-forward solution. So rather than diving into an example, let's see what others say.
-- Mark