Fact Sentence with Gender Switch

I am trying to share a child’s death Fact with the parents. Having set up two witness roles - Mother and Father - I want a role sentence for the mother which says something like “(Mother’s name) lost her son/daughter (depending on the sex of the child). (Name of child) died on (date)” and another sentence for the father “(Father’s name) lost his son/daughter”. Whatever I try, the mother’s role sentence always seems to describe the child as “daughter” and the father’s sentence always describes the child as ”son”. Can anyone please suggest how I correctly write a gender switch which references the son or daughter rather than the parent? Thank you.

Look under Gender Switches in the RM9 Help for Sentence Templates.

1 Like

After some extensive testing, I’m persuaded that the way the gender switch works for role sentences doesn’t work as documented. So I think there is a bug, although I suppose there could be a debate as to whether the bug is in the code or in the documentation. I have tested with the same results in both RM7 and RM9.

I can think of two workarounds.

Workaround #1. Have four different roles rather than two different roles. The roles could be something like the following. You would probably want the role names to be shorter than my samples.


Doing it this way, you would not need any gender switches at all. Instead, you would hardwire the words father, mother, son, and daughter. So your role sentences for the four roles could be something like the following.

<[ThisPerson] lost his son [Person]< [Date]>< [Place]>.>
<[ThisPerson] lost his daughter [Person]< [Date]><[Place]>.>
<[ThisPerson] lost her son [Person]< [Date]>< [Place]>.>
<[ThisPerson] lost her daughter [Person]< [Date]>< [Place]>.>

Workaround #2. Have two different roles, and hardwire only the words son and daughter.


Doing it this way, you would need gender switches and your role sentences would be something like the following.

<[ThisPerson] lost <%his|her> son [Person]< [Date]>< [Place]>.>
<[ThisPerson] lost <%his|her> daughter [Person]< [Date]>< [Place]>.>

Whether you choose Workaround #1 or Workaround #2, the common element is that you have to hardwire the words “son” and “daughter” because there does not seem to be a way to test the gender of the [Person] in a role sentence. Then when you share the Death fact for the child, you have to choose the role that has the son/daughter choice that you need.

If this were me, I would choose Workaround #2 because it only needs two roles instead of four. There may yet be a way to test the gender of the [Person] in the role sentence that I haven’t found. I would be pleased to be proven wrong that this is not possible. But my testing has been pretty thorough.

I have actually tested my proposed solution successfully in RM9, and it works fine. I didn’t test it in RM7, but I’m confident it would work there as well. My sentences may need some improved punctuation or spacing or something like that, but the basic concept seems to be sound.

By the way, where the gender switch does seem to work as documented is for the sentence for the main fact. In this case, that would be the Death fact for the child. For that sentence, you actually can test the gender of both [Person] and the person with whom the the main fact is being shared. The real problem is in the role sentence, not in the main sentence.


Thank you very much for your suggested Workarounds, and for all the time and effort you’ve put into investigating this.

I’m relieved to see you say you don’t think the role sentence works as documented - it’s not just me being thick - but, at the same time, it’s a little disappointing that RM haven’t got it right. Maybe I should put in a feature request?

In the meantime, I really appreciate the clarity with which you’ve set out the options and I think I’ll probably go for your Workaround#2 which will achieve exactly what I want.


It took me forever to figure out how RM’s shared fact feature worked when the feature was first introduced into RM4. Part of the problem was surely that the documentation was not adequate. Part of the problem was surely that I was just being dense. But part of the problem is that I think there is no such thing as a shared fact in RM. Rather, I think that a fact can have roles and then it’s the roles that are shared, not the fact. Not everyone agrees with this interpretation of the term “shared fact”, but I think it’s a good way to think about the feature. I couldn’t understand RM’s shared fact feature until I understood that RM doesn’t support shared facts. It only supports shared roles.

Another part of my original problem in understanding RM’s shared fact feature is that so many of RM’s facts have the Witness role defined by default. Unless it’s a fact such as a Deed fact or a Will fact or something like that, I can’t think of any situation where the Witness role makes any sense. The flower girl and minister and best man and maid of honor etc. at a wedding don’t “witness” the marriage. Rather, they serve their roles and the roles in RM should be such things as FlowerGirl and Minister and BestMan and MaidOfHonor etc. For the Census fact, the roles need to be such things as Wife and Son and Daughter and Boarder etc. I think that if you try to use the built-in Witness roles, the results are going to be confusing or nonsensical and that for the most part RM would benefit by not having all those built-in Witness roles.

A role does inherit certain information from its owning fact - namely, a role inherits the place, the date, the sort date, any citations, and any media. But a role does not inherit the note or the sentence from the fact. In many cases, users would like to use RM’s shared fact feature as a way to make an exact copy of a fact. But that’s not really possible. And the reason that’s not really possible is that it’s not the fact that’s being shared. Rather, it’s a role that’s owned by the fact that’s being shared, and a role has its own sentence and note that’s separate from the sentence and note for the fact.

Then there is the issue that the variables and the fact sentence and the role sentence can be confusing. For example, the creation of a MidWIfe role for the Birth fact creates a [MidWife] variable. There are now two sentences to be defined: a fact sentence for the Birth fact and a role sentence for the MidWife role. A most curious consequence of the two sentences is that the [Midwife] variable can be used in the sentence for the Birth fact but the [Midwife] variable cannot be used in the sentence for the Midwife role. Instead, the sentence for the Midwife role uses the [ThisPerson] variable for the name of the midwife and the [Person] variable for the name of the baby who was delivered by the midwife.

I don’t know if anybody ever does it, but it could even make sense to define a role without defining a role sentence, just to make the role variable available for use in the fact sentence. Similarly, it could even make sense to define a role without using the role variable in the fact sentence, just to make the role sentence available in the timeline for the person with whom the role is shared. In my MidWife example, that means you could make the name of the midwife show up in the Birth sentence for the baby without the role of Midwife for the birth showing up in timeline for the midwife. Or you could make make the role of Midwife show up in the timeline for the midwife without the name showing up in the Birth sentence for the baby.

While this is not a direct answer to your question, I think it illustrates that it can be done. The highlighted words are generated by gender switches. The child is the Principal and each parent is assigned the Parent role.

The custom fact type is _parentage with the following roles and sentence templates:
Role: Principal
Sentence template: [parent] <#parent#is the parent|are the parents> of <%son|daughter> [person].

Role: Parent
Sentence template: [Person:poss] <%parent%father|mother> is [Parent].

Maybe you can apply similar switches to your fact type. There is also the use of the Value switch to control the is|are verb.

Further to my previous post, I tackled your specific case for the Death fact type and I think I made the gender switch work as you want (of course there are other issues with sentence templates that jump out but that’s another discussion).

In this case, again only the one custom role, Parent, was created for the Death fact which was shared to both male and female parents from both male and female children to test:
Role: Parent
Sentence template: [ThisPerson] lost [ThisPerson:HisHer] <%Person%son|daughter>. [Person] died [Date].

One thing I learned or relearned on revisiting this old experiment with a “_parentage” fact type is that the variable name for the Principal role is actually “Person”. That’s why testing for the Principal’s gender from within another role sentence must use the construct “<%Person%son|daughter>”. While one might think from the documentation that “<%son|daughter>” should test the gender of the Principal role from within all role sentences, it does so only in the Principal’s sentence and tests the gender of [ThisPerson] in all other role sentences.


Aha! Not for the first time, Tom solved a problem that I was not able to solve. I was pretty sure I tried the solution that worked for Tom, but obviously I missed something. So armed with Tom’s solution, I can now get either of the following to work with just one role for the Death fact - namely a Parents role. I don’t need both of these sentences. Either one will work as the sentence for the Parents role for the Death fact.

<[ThisPerson] lost <%his|her> <%Person%son|daughter>< [Person]>< [Date]>< [Place]>.>

<[ThisPerson] lost <%ThisPerson%his|her> <%Person%son|daughter>< [Person]>< [Date]>< [Place]>.>

The reason that either sentence will work is because this is a role sentence rather than a fact sentence. Therefore, the gender switch defaults to testing the ThisPerson variable. It doesn’t hurt anything to specify the ThisPerson variable with the gender switch if you are testing the gender of ThisPerson, but it is not necessary. On the other hand, because this is a role sentence it is necessary to specify the Person variable with the gender switch if you are testing the Person variable.

Tom’s sentence got by with only one gender switch - the one for the Person variable - because he was able to use the :HisHer pronoun option for the ThisPerson variable. My new sentences uses two gender switches, one for the ThisPerson variable and one for the Person variable. The :HisHer pronoun option works for the ThisPerson variable in a role sentence if all you need is the :HisHer pronoun designation. That’s probably the case 99% of the time. But if your sentence needs something fancier than that such as a father|mother designation, then you might actually need two gender switches, one for the Person variable and one for the ThisPerson variable.

This means I withdraw my comment that there is a bug in RM’s handling of the gender switch. It just has to be used properly with the Person variable and the ThisPerson variable.


Jerry, (and TomH)

Thanks for your continued interest in my little death fact/role question.

I started out trying to write sentences for a mother and father whose three sons all died before their parents. This seems to me to be an important fact to highlight in the parent’s own record - simply because children should outlive their parents, not the other way around.

I’m always keen to vary my narratives as much as possible so I was looking to write different sentences for each parent and, in this case, with more detail for the mother (using her maiden surname, rather than married).

Your help and suggestions have been invaluable in working out what I hope will be an acceptable solution. These are the sentences I’ve come up with, and examples of how they evaluate :

Mother role sentence
<[ThisPerson] lost <%his|her> <%Person%son|daughter>< [Person]>< [Date]>.> <[Person:HeShe:Proper] died> <of [Desc:Lower]> <[Place]> <when [Person:HeShe] was [Person:Age:Plain] years old.>

Emily JENNER lost her son Joseph Robert LOCK on 28 October 1890. He died of bronchitis in Tooting, London when he was 30 years old

Father role sentence
<[ThisPerson:Casual:Surname]'s <%Person%son|daughter>< [Person:Given]> pre-deceased him <in [Date:Year]>.> <[Person:HeShe:Proper] was [Person:Age:Plain] years old when ><[Person:HeShe] died>.

Joseph LOCK’s son Joseph Robert pre-deceased him in 1890 in Tooting, London. He was 30 years old when he died.

It all seems to work (I think!). Thanks again.

1 Like

Those read very well. Given the limitations of the system, you couldn’t do better.

I’m equally impressed. I use point form sentences in my narrative reports rather grammatically complete English sentences, but nevertheless your sentences can serve as good models for an idea I have had on the back burner for many years.

I long ago took a decision not to use RM’s shared roles due to the fact that so much other genealogy software doesn’t support them. I certainly respect that other RM users may reasonably come to a different decision and instead they fully embrace RM’s shared roles. However, I do make one exception. Namely, I do use RM’s shared roles when it serves to enhance the content of my narrative reports as long as no data is actually lost when my RM data is transferred to other software.

Right now, I have two use cases and it’s been on my back burner to add some additional use cases. Use case #1 is that I share Marriage and Divorce facts with both parties to the marriage and divorce. Sometimes users will call RM’s Marriage and Divorce facts “shared facts”, but they really are not. Instead, they are family facts and I think they really should be called couple facts. In narrative reports, couple facts do not show up in the timeline for an individual. Instead, couple facts show up only in a timeline that’s for the couple as a whole. So sharing a role for the Marriage and Divorce facts with both parties serves to include the marriage and divorce events in the timeline for each individual. If my data is transferred to software that doesn’t support RM’s shared roles, the Marriage and Divorced facts are not lost.

Use case #2 is that I have a Parents fact which serves two purposes. One purpose is to show the name of a person’s parents explicitly as a part of an individual’s timeline in a narrative reports. Curiously, narrative reports do not show this information explicitly in the timeline for an individual. Rather, the information is implicit in the overall structure of a narrative report. But the main purpose for the my Parents fact is to provide a place to attach evidence of who a person’s parents were. The nature of such evidence can be very diverse, and it’s not just a modern style birth certificate that can serve as such evidence. It’s my opinion that neither RM in particular nor genealogy software in general provides a good place to attach such evidence. For example (and I have written in great length previously about this), I don’t think the Parents line in RM’s Edit Person screen provides a good place to attach evidence of parentage.

My initial concept for the Parents fact was that I would include the names of a person’s parents in the Description field of my Parents fact. That works, of course, but it’s just text and information from the Description field does not show up in the Name index at the end my my narrative reports. So I decided to create a role for the Parents fact which I then shared with each of the parents. The name of the role is Birth_of_Child which sounds a little funny, but bear with me. The sentence for the Parents fact then becomes the following. Note that it does not actually use the [Desc] variable, even though the name of the parents is actually stored in the Description field.

(a carriage return is here to force a new line)
<b>Parents:</b>< [Birth_of_Child].>

The [Birth_of_Child] variable then expands to be the names of the parents, and the parents therefore do show up in the Name index at the end of the report.

The name of the role being [Birth_of_Child] has always seemed sort of backwards to me. It’s like the role should be [Parents]. But then the role sentences is as follows, which more or less justifies why I gave the role the name I gave it. And by the way, you can clearly see the use of a gender switch in association with the [ThisPerson] variable.

(a carriage return is here to force a new line)
<b>Birth of Child:</b> <[Date:plain]><, [Person:Full]><, [Place:Plain]><, age of <%ThisPerson%father|mother>: [ThisPerson:age:plain]>.

Absent my Parents fact, what would make sense instead would be to share the Birth fact for each person with both of their parents. Doing so would get the names of a person’s parents into the person’s timeline in narrative reports and into the Name index in narrative reports, but it still would not quite provide a good place to attach evidence of parentage.

With that a a background, my possible future use cases for this kind of use of roles might be as follows. Steve Turner’s message is serving as inspiration to put these ideas back onto the front burner.

  • Share the Death fact for a young child with the parents. That mirrors Steve Turner’s use case in this thread.
  • Share the Death fact for a young parent with each of the young parent’s children.
  • Share the Death fact for a young parent with the young parent’s spouse.

As a prime and very real example, both of my grandfathers became widowers as young men and both of them had young children who had lost their mother. It was a huge life event both for my grandfathers and for their young children. It’s the sort of thing that I think needs to be well recorded in family histories.

All the events I have talked about in this message are still there in narrative reports even if the shared roles are not there. So I’m still talking about not using RM’s shared roles in a way that actually loses something if my data is transferred to software other than RM. So for example, I don’t use RM’s shared roles for census records or for obituaries, even though it would be extremely convenient to do so. I’m still just using RM’s shared roles to enhance the appearance of RM’s narrative reports.

1 Like