Best usage for a custom filter operator / operand / suffix?

While writing a couple of custom filter operators for The Memory Keeper (a genealogical research tool), I thought it appropriate to write some blood relationship filter operators:

  • paternal
  • maternal
  • ancestors
  • descendants
  • uncles
  • aunts
  • cousins

Given a person (or a set of people), the filter would return, for example, their cousins. My first attempt, which is working:

[[Sturgeon, Craig]cousins[1]]

returns my first cousins

[[Sturgeon, Craig]cousins:1[2]]

The above would return my 2nd cousins, once removed.

Question. Is this usage appropriate? Or do I have it backwards? Should I reverse it?

[[cousins:2:1[Sturgeon, Craig]]

Or, what format usage should this be, and why?

Thanks,

Craig

You can do this with one or more kin filter operators but ones defined specificaly for genealogy would be great bit you need to workout how to deal with multiple parents 1, 2 or even more. Step parents, adopter etc…

1 Like

I recommend thinking in terms of where the data you provide to the filter operator is likely to come from. Will it be hard coded names and relationships? Derived from other filter calculations?

A limitation of operator suffixes is that they cannot be provided via variables.

So perhaps you might consider this form for maximum flexibility:

[[Sturgeon, Craig]cousins[2],[1]]

3 Likes

Thank you for the tip. I will this change from suffix to additional operands.

Craig

My initial focus was blood relationships. I do plan on writing more filter operators. MK supports adopted parents. Step parents does my head in when biological parents marry multiple times. Technically is a step relationship ended when a step parent dies or remarries? A question for a genealogy forum. Regardless, I’m not supporting complex non blood relationships like step-aunt. Aside, I’m still trying to find out if aunt-in-law and uncle-in-law are formal terms or not.

I think part of the long term validity is to record the births, deaths and marriages with a date, even an approximate one, then the tree gets an additional and essential dimension. Marriage’s can have an end date.

  • Its true you may have to set a limit, but spell it out while designing.