Addon:Rule expansions
This is a Third-party Addon. Please use carefully on data that is backed up, and help make it better by reporting any comments or problems to the author, or issues to the bug tracker |
Contents
- 1 Rule Amendments
- 2 Locating Filter Rule AddOns
- 2.1 Addon Rules
- 2.1.1 Individual Rules
- 2.1.2 Isotammi Addon Rules
- 2.1.3 FilterRules : Plugin Manager Rulebook Collection
- 2.1.3.1 People related to <filter>
- 2.1.3.2 People with events with a selected role
- 2.1.3.3 Families with Events with a selected role
- 2.1.3.4 Source matching parameters
- 2.1.3.5 People Separated less than <N> degrees of <Home person>
- 2.1.3.6 People Separated less than <N> degrees of <person>
- 2.1.3.7 Events of families matching a <family filter>
- 2.1.3.8 Families matching <event filter>
- 2.1.3.9 People who are part of families matching <filter>
- 2.1.3.10 Filter people by their age at death
- 2.1.3.11 Match associations of <person filter>
- 2.1.3.12 People with multiple parent records
- 2.1.4 FilterRules2 : Plugin Manager Rulebook Collection
- 2.1.4.1 Matrilineal progenitrix of <person>
- 2.1.4.2 Mitochondrial inheritance of <filter>
- 2.1.4.3 Mitochondrial inheritance of <person>
- 2.1.4.4 Patrilineal progenitor of <person>
- 2.1.4.5 X-chromosomal ancestors of <person>
- 2.1.4.6 X-chromosomal descendants of <person>
- 2.1.4.7 Y-chromosomal inheritance of <person filter>
- 2.1.4.8 Y-chromosomal inheritance of <person>
- 2.1.5 Pre-Release Rules
- 2.1 Addon Rules
- 3 The Evolution of of Rules as Addons
- 4 Developing New Rule Addons
Rule Amendments
Rules are the basic building blocks of custom Filters. A wide variety of rules have been built-in for creating custom filters in each category.
The following of addon Rule collections have been gathered released as "Packs" of rules:
- FilterRules - documentation, GitHub repository
- FilterRules2 - documentation, GitHub repository
- Generic rules (SuperTool) - (separate entries under each object category, for use with with custom rule code generated by SuperTool) - documentation, GitHub repository
With the release of Gramps version 5.1, the first addon Rules were posted as examples of coding a Filter Rule addon. Installing similarly to any other addon, a New Rule appears as a menu item within Add Rule dialog while Defining a custom Filter.
Filters created with these Rules can tested, cloned or deleted using the Filter Editor. The dialog is invoked from the Edit menu in each Category view.
Locating Filter Rule AddOns
The Plugin Manager can be used for more than installing and updating plug-in modules. It can help you discover the growing capabilities that might not be obvious.
Open the Plugin Manager from the Help menu and use its Search box to filter the view to only those addons which have a row or filename which include the 'Rule' term.
Addon Rules that have been peer-reviewed will be added to Gramps' Update Manager system. This automates the installation process
When manually installed, each addon rule's Python source code (.py
) file and Gramps Plugin Registration (.gpr.py
) file will be located in the \gramps5.2\plugins\FilterRules\
subdirectory of your User Directory
Looking at the Info on any currently installed Rule will verify the file location where addon rules have been installed.
Addon Rules
Rules are added in sets/groups via the Plugin Manager. All the Rules in a set are added/removed when any Rule in that set is added/removed.
Each set supports Multilingual internationalization services through .po and .pot files using gettext.
In the few months that addon Rules have been a feature, two sets of rules have been collected:
Individual Rules
Active Person
General filters addon rule to find the Active Person. Available for Person, Relationships, Charts, Geography
This is a useful "basic" rule for use in compound filters.
Also see:
Isotammi Addon Rules
Rather than distributing through the Gramps open source project, the Taapeli Project (which is a national database of Finnish Genealogical Society) curates their own set of "Isotammi lisäosia" : “Big Oak (the mythological World Tree) addons" for Gramps. The addon manager installation files are hosted separately.
Besides an initial experiment distributing a rule, they created the SuperTool for directly executing queries and building custom query rules used by a "Generic <Object> filter" in each category view.
FilterRules : Plugin Manager Rulebook Collection
General Filter Rule Addons
Person • General filters addon rule to find Person(s) matching a specified filter.
Matches people who are related to anybody matched by a person filter.
isrelatedwithfiltermatch
provided as sample .gpr.py & .py code
for writing addon filter rules. Demonstrates piping the output of one custom Filter into another.
People with events with a selected role
Person • Event filters addon rule to find Person(s) having any Event with a specified Event Role.
This rule is particularly useful to search for people with Events having an "Unknown" event role. An Unknown role always a placeholder that should be resolved as soon as possible.
Families with Events with a selected role
Families • Event filters addon rule to find Families having any Family member or shared Family level Event with a specified Event Role.
hasrolerule
provided as sample .gpr.py & .py code
for writing addon filter rules. Demonstrates including category variants of a rule in the same addon.
Source matching parameters
Sources • General filters addon rule to find Sources based on the following parameters: Title, Author, Abbreviation, Publication.
This addon rule has similar options to the standard Filter Gramplet for the Source Category View. It can be used to save complex filter parameters.
hassourcefilter
provided as sample .gpr.py & .py code for writing addon filter rules. Demonstrates text based filtering with RegEx options.
People Separated less than <N> degrees of <Home person>
Person • Relationship filters addon rule to find Person(s) having a relationship to the Home Person within a specified degree of Consanguinity and Affinity.
The Home person is point of reference for calculating (<N>) Degrees. For N, Minimum value is 1, Maximum is value 32.
- Degree 1: person/spouse + children ( <zero N> ancestors, because the selected person is generation 1 + 1N descendants)
- Degree 2: person plus person’s parents, siblings, niece/nephew, children, grandchildren, etc. (= 1N ancestors + 2N descendants)
- Degree 3: persons grandparents and 3 generations down. (= 2N ancestors + 3N descendants).
The ancestors and descendants generations have an offset of 1 to mimic the built-in filter rule behavior. Early versions of this rule optionally included partners and non-primary parents. Those relatives are now always included.
This Rule may need to manually downloaded and installed: see the source code files on the GitHub Repository
People Separated less than <N> degrees of <person>
Person • Relationship filters addon rule to find Person(s) having a relationship to a specified Person within a specified degree of Consanguinity and Affinity.
The Person corresponding to the ID is the focal point of reference for calculating (<N>) Degrees. For N, Minimum value is 1, Maximum is value 32.
- Degree 1: person/spouse + children ( <zero N> ancestors, because the selected person is generation 1 + 1N descendants)
- Degree 2: person plus person’s parents, siblings, niece/nephew, children, grandchildren, etc. (= 1N ancestors + 2N descendants)
- Degree 3: persons grandparents and 3 generations down. (= 2N ancestors + 3N descendants).
The ancestors and descendants generations have an offset of 1 to mimic the built-in filter rule behavior. Early versions of this rule optionally included partners and non-primary parents. Those relatives are now always included.
Early versions of this rule optionally included partners and non-primary parents. Those relatives are now always included. See the GitHub Repository files
Events of families matching a <family filter>
Events of families matching a <family filter>
Families matching <event filter>
Matches families that are matched by an event filter
People who are part of families matching <filter>
People who are part of families matching <filter>
Filter people by their age at death
Match associations of <person filter>
People with multiple parent records
Person • Family filters addon rule that matches people who have more than one set of parents.
FilterRules2 : Plugin Manager Rulebook Collection
Genetic Genealogy Filter Rule Addons
The following rules are based on the logical rules of genetics, not on comparing DNA data.
Matrilineal progenitrix of <person>
Matches the earliest recorded matrilineal ancestor mother.
Mitochondrial inheritance of <filter>
Matches recorded descendants of a filter result following mitochondrial inheritance patterns.
Mitochondrial inheritance of <person>
Matches recorded descendants of person following mitochondrial inheritance patterns.
Patrilineal progenitor of <person>
Matches the earliest recorded patrilineal ancestor father.
X-chromosomal ancestors of <person>
Matches ancestors of <person> following a X-chromosomal inheritance pattern.
X-chromosomal descendants of <person>
Matches descendants of <person> following a X-chromosomal inheritance pattern.
Y-chromosomal inheritance of <person filter>
Matches recorded descendants of a filter result following Y-chromosomal inheritance patterns.
Y-chromosomal inheritance of <person>
Matches recorded descendants of person following Y-chromosomal inheritance patterns.
Pre-Release Rules
Descendants of <person> sharing yDNA with each other
Matches descendants of a <person> sharing yDNA
The Evolution of of Rules as Addons
Gramps 5.1.1 (Sept. 2019)
- Fix bug 0011114: resolve crashes in withinarea filter rule:
- Avoid bad coordinates in the ref place
- Avoid alphabetic characters in filter rules
- Could not convert string to float by using withinarea filter rule
- Difference between sidebar filter and filter rule
- Fix Bug 0011293 Fix internationalization issue where untranslated English GUI items appear in Event filter
Gramps 5.1.0 (Aug. 2019)
- New feature : Filter Rules can now be expanded through the addons interface.
- Filter Rule editor, save pane position
- Fix Bugs 0007950 and 0011430: Name Filter rule now supports multiple attribute: Check all values of an attribute type and not only the first one
- filters rule have children person filter: Check all families of a person for children and not only the first
- Person Sidebarfilter:
- Fix Person Sidebarfilter when using ‘Event’ and Reg expressions
- In personsidebarfilter, search on each part of name Instead of requiring that the entire search string matches a single one of the Person’s names, the function will require that each word in the search string matches any of the Person’s name fields.
- Fix exception when merging with active sidebar filter
Gramps 5.0.2 (Aug. 2019)
- Fix bug 0010509: resolves silent fail - relationship path between filter rule when parent is missing
- Fix crash when using sidebar filter and merging in another view
- Fix Place Tree view when using enclosed by sidebar filter
- Fix Relationship Graph; extra people when using filters & subgraphs
Gramps 5.0.1 (Dec. 2018)
- Fix bug 0010685: resolves crash in IsDuplicatedAncestorOf filter rule on tree loop
- Fix Person Sidebarfilter when using ‘Event’ and Reg expressions
- Fix FilterParser for much older 3.x custom_filters.xml files
- Fix crash when a filter with loop in definition is defined
- Fix view so column widths are preserved when using filters
Gramps 5.0.0 (Jul. 2018)
- Fix Custom filter update when created via sidebar.
Developing New Rule Addons
Beginning with version 5.0, Gramps implemented an database API (application programming interface) infrastructure supporting user selectable backends. This new exploration of database support lead developer to extend the addon (plug-in) framework to support expanding Filter Rules via the Plugin Manager.
The 5.1 release changed the default database backend from BSDDB (Berkeley database) to SQLite. With the broader group of user familiar with optimizing searches, it made sense to open Gramps to the specialized knowledge.
Resources
See also
- Built-in rules by category
- Git introduction
- Built-in Rules Source code (Git)
- Addon Rules Source code (Git)
- Gtk+ widget gallery - Gnome development sample code
- downloadable .tgz files (Git)
- Addons Development
- Writing a Plugin
- Policy for Committing code contributions
- [Gramps-devel]: Filter rules as plugins?
- [Gramps-users]: A question on writing filters
- [Gramps-devel]: New filter rules on Names
- [Gramps-devel]: Sequencing of filter rules?
- [Gramps-devel]: filter rules
- [Gramps-users]: Gramplet writing - newbie help needed
- based on the Gramps-users archived threads: