Advanced Gramps Plugin for Enhanced Family Connections Analysis

I propose to develop an exceptionally powerful Gramps add-on for analyzing family connections that would generate a text file in DOT format. Its essence is that, besides the main family connections like father, mother, and spouse, it will also contain other links interconnected by the Gramps program. These could be, for instance: godfather, godson, godmother, witness, etc. Such a file can be rendered using local or online tools such as http://www.webgraphviz.com.

A bit more detail: In the add-on, one can specify a surname of interest, for example, Bush. The script manages to gather all individuals with this surname into, for instance, two separate families (couldn’t combine into one family due to insufficient family links). Next, the script recursively goes through all target individuals from both families (all bearers of the surname Bush) and adds all other existing links (as well as connections to these links).

digraph CombinedFamilies {
    splines=polyline;
    ranksep=1;
    node [fontsize=12];
    edge [fontsize=10, labelloc="c", labelfontsize=10];

    subgraph clusterBushFamily1 {
        label="Brown's Family 1";
        style=filled;
        color=lightgrey;

        id1 [label="Bush James \nid1", shape=ellipse, color="blue", style=filled, fillcolor="lightblue"];
        id2 [label="Bush (Smith) Emily \nid2", shape=ellipse, color="blue", style=filled, fillcolor="lightpink"];
        id3 [label="Bush Michael \nid3", shape=ellipse, color="blue", style=filled, fillcolor="lightblue"];
        id4 [label="Bush John \nid4", shape=ellipse, color="blue", style=filled, fillcolor="lightblue"];
        
        id1 -> {id3 id4} [label="father"];
        id2 -> {id3 id4} [label="mother"];
        id1 -> id2 [dir=none, label="spouses", constraint=false];
    }

    subgraph clusterBushFamily2 {
        label="Brown's Family 2";
        style=filled;
        color=yellow;

        id5 [label="Bush William \nid5", shape=ellipse, color="blue", style=filled, fillcolor="lightblue"];
        id6 [label="Bush (Anderson) Mia \nid6", shape=ellipse, color="blue", style=filled, fillcolor="lightpink"];
        id7 [label="Bush Olivia \nid7", shape=ellipse, color="blue", style=filled, fillcolor="lightpink"];
        id8 [label="Bush (Jones) Isabella \nid8", shape=ellipse, color="blue", style=filled, fillcolor="lightpink"];
        id9 [label="Jones Joseph \nid9", shape=ellipse, color="blue", style=filled, fillcolor="lightblue"];
        id10 [label="Jones Charles \nid10", shape=ellipse, color="blue", style=filled, fillcolor="lightblue"];

        id5 -> {id7 id8} [label="father"];
        id6 -> {id7 id8} [label="mother"];
        id8 -> {id10} [label="father"];
        id9 -> {id10} [label="mother"];
        id5 -> id6 [dir=none, label="spouses", constraint=false];
    }


    subgraph others {
        id11 [label="Miller William \nid5", shape=ellipse, color="blue", style=filled, fillcolor="lightblue"];
        id12 [label="Miller (Anderson) Mia \nid6", shape=ellipse, color="blue", style=filled, fillcolor="lightpink"];
        id13 [label="Brown Olivia \nid7", shape=ellipse, color="blue", style=filled, fillcolor="lightpink"];
        id14 [label="Brown (Jones) Isabella \nid8", shape=ellipse, color="blue", style=filled, fillcolor="lightpink"];
        
        id11 -> id12 [label="father"];
        id12 -> id3 [label="godmother"]; 
        id12 -> id4 [label="godmother"]; 
        id12 -> id13 [label="godmother"];
        id12 -> id14 [label="witness"]; 
        id14 -> id9 [label="witness"]; 
    }
}

As you can see, this greatly facilitates the search for new family connections, as it becomes apparent who from the distant connections might also be related to a specific person:

  1. It can help identify maiden names of women or, conversely, surnames they acquired after marriage.
  2. It may also help find that thread that can combine separate family branches into one large family tree.
  3. It can assist in identifying common places of residence (neighborhoods, streets, …) or relocations.
  4. It can allow for the identification of some faded and poorly readable surnames and patronymics.
  5. It can enable users to see connections between families that were previously unknown or hidden.
  6. It might give the researcher new ideas or even entire family histories - how a particular family or individual lived in their environment.

Is there anyone who can implement such an add-on? I can assist with its testing.

1 Like

That sounds interesting.
How is this different from the relationship graph in Gramps? The relationship graph produces a dot file. It can be used with a filter, which is a very flexible way of selecting people to include in the chart. I appears that a filter could be used to select the cases in your example, and this could be fed to a relationship graph.

1 Like

You’re correct, it seems that the relationship graph is almost what I need. I was able to export the data to dot (size around 1 MB). However, viewing the file or its conversion to png works incorrectly. Here are the steps I took:

For file viewing on Ubuntu, I installed xdot: sudo apt install xdot

I tested its functionality with the above code from our conversation - graphs are drawn correctly, including Cyrillic.

`xdot Main_rel_graph.gv` 

The CPU is loaded to 100% for about 30 seconds, resulting in a blank page in the app opening. The computer’s capacity is not questionable, and there are no errors in the logs.

`neato -Tpng Main_rel_graph.gv -o output_neato.png` Warning: some nodes with margin (3.20,3.20) touch - falling back to straight line edges. 

The resulting png seems to have something drawn on it, but it appears that all the connections are fit into a tiny page. Maybe there’s a limitation on the page size in pixels.

`twopi -Tpng Main_rel_graph.gv -o output_twopi.png` Warning: some nodes with margin (3.20,3.20) touch - falling back to straight line edges. 

The image has the same issue.

`circo -Tpng Main_rel_graph.gv -o output_circo.png` Segmentation fault (core dumped). 

No file was generated.

`fdp -Tpng Main_rel_graph.gv -o output_fdp.png` Error: node "I0017" is contained in two non-comparable clusters "cluster_F0516" and "cluster_F0003". 

A blank file was generated. Here’s the problematic fragment of the code…

subgraph cluster_F0003
  {
  style="invis";
  "I0016" -> "I0017" [ style=invis arrowhead=none arrowtail=none dir=both ];
  "I0017" -> "F0003" [ arrowhead=normal arrowtail=none dir=both ];
  "I0016" -> "F0003" [ arrowhead=normal arrowtail=none dir=both ];
  }
  "I0017" [ shape="box" color="#e0e0ff" style="solid" label="Герасим Михайлович" ];
  "F0516" [ shape="ellipse" color="#ffffe0" style="solid" label="" ];
  subgraph cluster_F0516
  {
  style="invis";
  "I0017" -> "I1839" [ style=invis arrowhead=none arrowtail=none dir=both ];
  "I0017" -> "F0516" [ arrowhead=normal arrowtail=none dir=both ];
  "I1839" -> "F0516" [ arrowhead=normal arrowtail=none dir=both ];
  }
  "I1839" [ shape="box" color="#ffe0e0" style="rounded" label="Варвара Іванівна" ];
  "I0018" [ shape="box" color="#e0e0ff" style="solid" label="Іван Павлович" ];
  "F0004" [ shape="ellipse" color="#ffffe0" style="solid" label="" ];
`dot -Tpng Main_rel_graph.gv -o output_dot.png` 

A blank file was generated.

I seek assistance in addressing this issue.

Additionally, I have a question about filters: is it possible to set them up in such a way that only individuals with a specific surname are selected, as well as all individuals with other surnames who are related to the target surname (to the full depth of relationships - recursively)?

8 posts were split to a new topic: Custom filter ignores a rule

One more question. I see, people from Associations dont have arrows on the graph. Is it possible to fix this?

So, finally I see 2 problems:

  1. On the graph, associative individuals are not represented with arrows.
  2. The graph is disproportionately stretched vertically, even though there’s sufficient space to position the individuals closer together.

@emyoulation the problem 2 is solved with changing the size attribute:


But the problem 1 is still actual. Can anybody add ability to draw dashed arrows between person and Associations? This is very important because I can not do it manually inside the dot file.

Including People with “Associated” relationships in addition to Family relationship in the Relationship Graph definitely would require an enhancement.

1 Like

Graphviz generally tries to fill the available space.
For larger charts, I find it works better if the graph direction is set to horizontal (in the graph layout tab).

1 Like

@emyoulation @hewettp About the enhancement I’ve created a separate task here https://gramps.discourse.group/t/include-people-with-associated-relationships-to-relationship-graph/4180.
Hope anybody can implement this update.

Thank you guys for your time today!
Have a nice day!

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