# Redacting a Tree for sample data

**URL:** <https://gramps.discourse.group/t/redacting-a-tree-for-sample-data/6072>\
**Category:** Ideas\
**Created:** [September 16, 2024, 4:33pm UTC](https://gramps.discourse.group/t/redacting-a-tree-for-sample-data/6072 "2024-09-16T16:33:21Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [September 16, 2024, 4:33pm UTC](https://gramps.discourse.group/t/redacting-a-tree-for-sample-data/6072/1 "2024-09-16T16:33:21Z")

</div>

I just needed to export sample data for a DNA related issue. Since DNA data tends to involve living persons, it made sense to export a limited skeleton of my tree with mostly redacted data.

Sufficiently redacting the skeletal tree was a _ **very** _ involved process.

### Steps

#### Create the skeleton tree

Export the Home Person (myself), the cousins with the DNA matches in question, a ‘control’ cousin without a match, and the pedigrees linking the cousins through common ancestors to the Home Person.

This was accomplished by using a Custom Filter with the **[Relationship path between \<person\> and people matching \<filter\>](https://gramps-project.org/wiki/index.php/Gramps_5.2_Wiki_Manual_-_Filters#Relationship_path_between_.3Cperson.3E_and_people_matching_.3Cfilter.3E)** rule.

My choice for “ **_matching_ \<filter\>** ” was a based on Tagged persons. I created a Tag and then (laboriously) found each cousin and added Tags. (No drag’n’drop for a tag. And extended selection for the cousins wasn’t viable.)

I later realized it would’ve been easier to [use the Clipboard](https://gramps-project.org/wiki/index.php/How_to_use_the_Gramps_Clipboard). Copy the cousins and use its context menu to “**Create Filter from the person(s) selected…**”.

The (colored) Tags still proved a good way to unambiguously flag the Home Person and the target cousins in the People category views. But it would’ve been easier to use the [Add/Remove Tag](https://gramps-project.org/wiki/index.php/Addon:AddRemoveTagTool) addon tool with the Clipboard-generated Custom Filter. Or to use Filter Gramplet to show the that Custom Filter in the flat list People view, do a select-all and then Edit → Tag → Add tag ‘DNA matches’

A basic skeleton was exported using the “Relationship path” filtered data to a “**Gramps XML (family tree)**” (not a “**Gramps XML Package (family tree and media)**” with the Reference Filters “ **Do not include records not linked to a selected person** ”

Creating a new, blank Family Tree and importing the exported skeleton didn’t give me what was expected. Instead of exactly matching the Gramps IDs in the 2 trees, the “I%04d” **ID Formats** Preferences for the Person overrode the “I%08d” leading zeros. (Which is one of the differences between an import-based backup recovery and a true “Restore from backup” recovery.) My system had difference ID Formats preferences than those of my pen-pal. So suddenly, we were not using the same references.

That leading-zero difference complicated eMail discussions using reference Gramps IDs. Worse, it changed tool and rule parameters between us.

#### Winnowing the skeleton tree data

Next, the distractions and excessive Privacy exposures needed to be cleaned out.

Started with the easy items:

- in Events view, delete all records with event types not related to the issue. Birth & Death give context to the relationships. I have DNA Testing recorded as Medical Information. So deleted everything but Birth, Death and Medical Information Events.
- in Source view, delete all Source not related to the issue.
- Another export cycle removed all the unconnected data

Too much detail in the Events is also an exposure. So used the [MultiMerge](https://gramps-project.org/wiki/index.php/Addon:Isotammi_addons#Multimerge_Gramplet) addon gramplet to collapse the Place hierarchy to State administrative level.

That left the things that had to be done manually.

---

<div class="post-metadata">

**Author:** ![GaryGriffin](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/garygriffin/32/6525_2.png) [@GaryGriffin](https://gramps.discourse.group/u/GaryGriffin)\
**Post date:** [September 16, 2024, 5:29pm UTC](https://gramps.discourse.group/t/redacting-a-tree-for-sample-data/6072/2 "2024-09-16T17:29:42Z")

</div>

Interesting was that all common ancestors were not included, so it uncovered an error in the DNA Segment Map gramplet. Specifically, grandparent and sibling were included but great grandparent was not. So calculating relationship (2nd cousin) succeeded but calculating common ancestor failed.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [September 17, 2024, 12:15am UTC](https://gramps.discourse.group/t/redacting-a-tree-for-sample-data/6072/3 "2024-09-17T00:15:47Z")

</div>

> [@GaryGriffin](#):
>
> Interesting was that all common ancestors were not included

That was interesting. Just like Deep Connection gramplet, the common ancestor was not included in the path between people. There doesn’t seem to be a way to get them included.

There isn’t a Family equivalent rule to **[Relationship path between \<person\> and people matching \<filter\>](https://gramps-project.org/wiki/index.php/Gramps_5.2_Wiki_Manual_-_Filters#Relationship_path_between_.3Cperson.3E_and_people_matching_.3Cfilter.3E)**

---

<div class="post-metadata">

**Author:** ![dlynch](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@dlynch](https://gramps.discourse.group/u/dlynch)\
**Post date:** [September 17, 2024, 7:33am UTC](https://gramps.discourse.group/t/redacting-a-tree-for-sample-data/6072/4 "2024-09-17T07:33:43Z")

</div>

There is a way, but it’s complicated:

To get the paths between the home person (I0000) and people in myfilter including the most recent common ancestors:

---

<div class="post-metadata">

**Author:** ![dlynch](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@dlynch](https://gramps.discourse.group/u/dlynch)\
**Post date:** [September 17, 2024, 7:52am UTC](https://gramps.discourse.group/t/redacting-a-tree-for-sample-data/6072/5 "2024-09-17T07:52:10Z")

</div>

%/filter\>  
%filter name=“Full path home & myfilter” function=“or”\>  
%rule class=“MatchesFilter” use\_regex=“False” use\_case=“False”\>  
%arg value=“zMost recent common ancestor home & myfilter”/\>  
%/rule\>  
%rule class=“MatchesFilter” use\_regex=“False” use\_case=“False”\>  
%arg value=“zShort path home & myfilter”/\>  
%/rule\>  
%/filter\>

%/filter\>  
%filter name=“zMost recent common ancestor home & myfilter” function=“and”\>  
%rule class=“MatchesFilter” use\_regex=“False” use\_case=“False”\>  
%arg value=“zShort path home & myfilter & parents”/\>  
%/rule\>  
%rule class=“MatchesFilter” use\_regex=“False” use\_case=“False”\>  
%arg value=“zCommon ancestors home & myfilter”/\>  
%/rule\>  
%/filter\>

%/filter\>  
%filter name=“zShort path home & myfilter” function=“and”\>  
%rule class=“DeepRelationshipPathBetween” use\_regex=“False” use\_case=“False”\>  
%arg value=“I00000”/\>  
%arg value=“myfilter”/\>  
%/rule\>  
%/filter\>

%/filter\>  
%filter name=“zCommon ancestors home & myfilter” function=“and”\>  
%rule class=“IsAncestorOf” use\_regex=“False” use\_case=“False”\>  
%arg value=“I00000”/\>  
%arg value=“1”/\>  
%/rule\>  
%rule class=“IsAncestorOfFilterMatch” use\_regex=“False” use\_case=“False”\>  
%arg value=“myfilter”/\>  
%/rule\>  
%/filter\>

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [September 18, 2024, 12:42pm UTC](https://gramps.discourse.group/t/redacting-a-tree-for-sample-data/6072/6 "2024-09-18T12:42:52Z")

</div>

> [@dlynch](#):
>
> To get the paths between the home person (I0000) and people in myfilter including the most recent common ancestors:

Thank you but that posting seems have been mangled.

Could you try to Edit it?

Start (and end) a XML section with multiple lines of code with a line containing just 3 backticks ( ` ). The starting line can have a suffix specifying the type of encoding. (Like ` XML` or ` python` ) if you want Discousre to try color-coding keywords.

Discourse sees bookmatched “less than” (\<) and “greater than” (\>) symbols as HTML markdown. So they are hidden.

---

<div class="post-metadata">

**Author:** ![dlynch](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@dlynch](https://gramps.discourse.group/u/dlynch)\
**Post date:** [September 18, 2024, 4:05pm UTC](https://gramps.discourse.group/t/redacting-a-tree-for-sample-data/6072/7 "2024-09-18T16:05:49Z")

</div>

There is a way, but it’s complicated:

To get the paths between the home person (I0000) and people in myfilter including the most recent common ancestors:

> Thank you @emyoulation I have tried to edit it as you suggest.
> 
> Where is this editing documented, please?

```python
  </filter>
<filter name="Full path home & myfilter" function="or">
<rule class="MatchesFilter" use_regex="False" use_case="False">
<arg value="zMost recent common ancestor home & myfilter"/>
</rule>
<rule class="MatchesFilter" use_regex="False" use_case="False">
<arg value="zShort path home & myfilter"/>
</rule>
</filter>

</filter>
<filter name="zMost recent common ancestor home & myfilter" function="and">
<rule class="MatchesFilter" use_regex="False" use_case="False">
<arg value="zShort path home & myfilter & parents"/>
</rule>
<rule class="MatchesFilter" use_regex="False" use_case="False">
<arg value="zCommon ancestors home & myfilter"/>
</rule>
</filter>

</filter>
<filter name="zShort path home & myfilter" function="and">
<rule class="DeepRelationshipPathBetween" use_regex="False" use_case="False">
<arg value="I00000"/>
<arg value="myfilter"/>
</rule>
</filter>

</filter>
<filter name="zCommon ancestors home & myfilter" function="and">
<rule class="IsAncestorOf" use_regex="False" use_case="False">
<arg value="I00000"/>
<arg value="1"/>
</rule>
<rule class="IsAncestorOfFilterMatch" use_regex="False" use_case="False">
<arg value="myfilter"/>
</rule>
</filter>

```

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [September 18, 2024, 4:17pm UTC](https://gramps.discourse.group/t/redacting-a-tree-for-sample-data/6072/8 "2024-09-18T16:17:17Z")

</div>

> [@dlynch](#):
>
> Where is this editing documented, please?

There is a [**Discourse New User Guide**](https://gramps.discourse.group/t/discourse-new-user-guide/707) topic in the **[User Manuals](https://gramps.discourse.group/c/gramps-users/user-manual/26)** subsection of the **[Help](https://gramps.discourse.group/c/gramps-users/7)** category.

---

<div class="post-metadata">

**Author:** ![dlynch](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@dlynch](https://gramps.discourse.group/u/dlynch)\
**Post date:** [September 18, 2024, 4:26pm UTC](https://gramps.discourse.group/t/redacting-a-tree-for-sample-data/6072/9 "2024-09-18T16:26:27Z")

</div>

Sorry, one filter was missing:

```python
</filter>
<filter name="zShort path home & myfilter & parents" function="or">
<rule class="MatchesFilter" use_regex="False" use_case="False">
<arg value="zShort path home & myfilter"/>
</rule>
<rule class="IsParentOfFilterMatch" use_regex="False" use_case="False">
<arg value="zShort path home & myfilter"/>
</rule>
</filter>

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/2ac1e712b7adf612e31ca08a55419f4cf37c0158.png) [@system](https://gramps.discourse.group/u/system)\
**Post date:** [October 18, 2024, 4:26pm UTC](https://gramps.discourse.group/t/redacting-a-tree-for-sample-data/6072/10 "2024-10-18T16:26:39Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
