Selecting families with empty parents

I have a tree with lots of medieval, and even mythical, figures, in which there are a lot of people who are siblings with unknown parents. This means that they are connected to a parent family, in which both parents are empty.

When I select the families view, I can create a filter for all sorts of things, including names and IDs of parents, but I see no way to create one for families that have no defined parents.

Any ideas?

This is similar (but not exactly the same) to the discussion:

I have several (real) people that I know the sibling but not the parents.

I tag the Family with the apt named “Related Siblings (unknown parents)” tag. I make the tag Red so in the family list I know why both parents are blank.

Note: Two of these are endline ancestors so when I do a search for relatives of the branch, the sibling (and their branch) is not included without adding the siblings of ancestors before bringing the lines forward by finding the descendants.

Create a 2 custom filter for Families

  • Father missing (Invert RegEx for any Father ID)
  • Mother missing (Invert RegEx for any Mother ID)

Then a Families filter that finds both:

custom_filters.xml

<?xml version="1.0" encoding="utf-8"?>
<filters>
  <object type="Family">
    <filter name="Both parents missing" function="and" comment="Family container where siblings are known but parents are not.">
      <rule class="MatchesFilter" use_regex="False" use_case="False">
        <arg value="Father missing"/>
      </rule>
      <rule class="MatchesFilter" use_regex="False" use_case="False">
        <arg value="Mother missing"/>
      </rule>
    </filter>
    <filter name="Father missing" function="and" invert="1" comment="(Invert RegEx for any Father ID)">
      <rule class="FatherHasIdOf" use_regex="True" use_case="False">
        <arg value="(.|\s)*\S(.|\s)"/>
      </rule>
    </filter>
    <filter name="Mother missing" function="and" invert="1" comment="(Invert RegEx for any Mother ID)">
      <rule class="MotherHasIdOf" use_regex="True" use_case="False">
        <arg value="(.|\s)*\S(.|\s)"/>
      </rule>
    </filter>
  </object>
</filters>
1 Like

Yes, that’s a smart one. I tried searching for empty IDs wirh the ^$ regexp, but that didn’t help, and the inversion that you use here, of a positive match on any ID, may probably solve the problem here too.

Searching for end of line persons won’t help here, because I only want to select the families that have no parents, and 2 or more children.

1 Like

Not smart. I fumbled through a dozen filters where the logic fit but failed to produce results. This was pure trial and error.

As always, a good Regular Expresssions “NULL” search eluded me.

1 Like

I guess the top Custom Filter needs an additional Family Rule for that last ‘2 or more children’ parameter:

  • Family with <count> of child where Number of instances:="1";Number must be:="greater than"

(I know you were aware of that. Just including for future readers of the discussion.)

custom_filters.xml

<?xml version="1.0" encoding="utf-8"?>
<filters>
  <object type="Family">
    <filter name="Both parents missing" function="and" comment="Family container where multiple siblings are known but parents are not.">
      <rule class="MatchesFilter" use_regex="False" use_case="False">
        <arg value="Father missing"/>
      </rule>
      <rule class="MatchesFilter" use_regex="False" use_case="False">
        <arg value="Mother missing"/>
      </rule>
      <rule class="HasNumChild" use_regex="False" use_case="False">
        <arg value="1"/>
        <arg value="greater than"/>
      </rule>
    </filter>
    <filter name="Father missing" function="and" invert="1" comment="(Invert RegEx for any Father ID)">
      <rule class="FatherHasIdOf" use_regex="True" use_case="False">
        <arg value="."/>
      </rule>
    </filter>
    <filter name="Mother missing" function="and" invert="1" comment="(Invert RegEx for any Mother ID)">
      <rule class="MotherHasIdOf" use_regex="True" use_case="False">
        <arg value="."/>
      </rule>
    </filter>
  </object>
</filters>

I sorted by Father in the Family view then tagged the records.

1 Like

OK, I thought that it was smart, because you reversed my thinking, where I tried to find empty IDs with the ^$ regexp.

I can make your example a bit simpler though, by replacing the expressions with a single dot. That works, because that single dot matches with any character, and the regexp search automatically searches by substring, so that that single dot matches any ID, except empty ones. Reversing that does the same as what I expected from the ^$ that didn’t work.

1 Like

Your filter works and it agrees with my tagged families.

To find each parent without ID’s, I tried it with just a period . in the ID field, Used regular expression then invert the results.

The . indicates any single character (letter, number, or anything)

It returned the same results as the (.|\s)*\S(.|\s) conditions.

2 Likes

Strangely, the (.) was very slightly slower than (.|\s)*\S(.|\s)
Ranged from 3.17 to 3.83 seconds to find 90 families in 18,688 families