Changes

Jump to: navigation, search

Rule expansions

10,360 bytes added, 13 May
People with multiple parent records
{{Third-party plugin}}
{{#vardefine:chapter|Addons (Rules)}}
 
=Rule Ammendments=
{{man tip| 1=Changes to Rules are inconspicuous|2=New built-in Rules appear without any fanfare. Plus there a are so many of them, grouped in so many subcategories that they may remain concealed.<br />Addons require downloading and installation, so the addon Rules have more visibility than the builtins. Plus they can be searched as a category in the Plugin Manager.}}
[[File:Preferences UpdateAddons-Rule-51.png|thumb|right|450px|Fig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Preferences: Check for Updated Addons showing Rules]]
Rules are the basic building blocks of Filters. With the Release of Gramps version 5.1, the first addon Rules were released as custom [[https://github.com/gramps-project/addons-source/tree/master/FilterRules examples of coding a Filter Rule addon]. [[{{Version manual}}_Addons#Installing_Addons_in_Gramps|Installing similarly to any other addonFilters]], a New Rule appears as a menu item within . A wide variety of [[Gramps_{{Version manualman version}}_Wiki_Manual_-_Filters#Add_Rule_dialogWhich_filter_rules_in_which_Category.3F|Add Rule dialog]] while [[Gramps_{{Version manual}}_Wiki_Manual_rules have been built-_Filters#Define_Filter_dialog|Defining a in for creating custom Filterfilters in each category]].
With the release of [[Template:Releases/5.1.0|Gramps version 5.1]], the first addon Rules were [https://github.com/gramps-project/addons-source/tree/master/FilterRules posted as examples of coding a Filter Rule addon]. [[{{Version manual}}_Addons#Installing_Addons_in_Gramps|Installing similarly to any other addon]], a New Rule appears as a menu item within [[Gramps_{{Version manual}}_Wiki_Manual_-_Filters#Add_Rule_dialog|Add Rule dialog]] while [[Gramps_{{Version manual}}_Wiki_Manual_-_Filters#Define_Filter_dialog|Defining a custom Filter]].
Filters created with these Rules can tested, cloned or deleted using the [[Gramps_5.1_Wiki_Manual_-_Filters#CategoryName_Filters_dialog|Filter Editor]]. The dialog is invoked from the {{Man menu|Edit}} menu in each Category view.
<!--
* Find Families/People having Events with a specific Role
:([https://github.com/gramps-project/addons-source/blob/master/FilterRules/hasrolerule.py source] and [https://github.com/gramps-project/addons-source/blob/master/FilterRules/hasrolerule.gpr.py info])
:This example shows how to create a rule which applies to 2 Categories (Families & People) where with an Event having a spefic role[[Gramps_Glossary#event_role|Event Role]]
* hassourcefilter.py Fix FilterRules to recognize local po files 29 days ago
* isrelatedwithfiltermatch.gpr.py Fix FilterRules to recognize local po files
 
: [https://github.com/gramps-project/addons-source/pull/274 Proposed #274] New filter rule 'familieswitheventfiltermatch'
: [https://github.com/gramps-project/addons-source/pull/275 Proposed #275] New filter rule 'personshavingfamilyfiltermatch'
-->
=Section=
[[File:EnhancedPlugInManager-addon-SearchRule 51win.png|thumb|right|450px|Fig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Search for '''''Rule''''' in the [[Plugin_Manager_Plugin|Enhanced Plugin Manager]]]]The Plugin Manager can be used for more than installing & updating plug-in modules. It can help you discover the growing capabilities that might not be obvious.
=locating Filter Rule Add-Ons=[[File:EnhancedPlugInManager-addon-SearchRule 51win.png|thumb|right|450px|Fig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Search for '''''Rule''''' in the Enhanced Plugin Manager]]The [[Plugin_Manager_Plugin|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 {{Man menu|Plugin Manager }} from the {{Man menu|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.
[[File:EnhancedPlugInManager-addon-Info 51win.png|thumb|right|450px|Fig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Info on 'People related to ''<filter>''' addon Rule]]
Add-on Rules that have been peer-reviewed will be added to Gramps' Update Manager system. This automates the installation process
 
When manually installed, each add-on rule's Python source code (<code>.py</code>) file and Gramps Plugin Registration (<code>.gpr.py</code>) file will be located in the <code>\gramps{{Version manual}}\plugins\FilterRules\</code> subdirectory of your [[Gramps_{{Version manual}}_Wiki_Manual_-_User_Directory|User Directory]]
 
Looking at the Info on any currently installed Rule will verify the file location where add-on rules have been installed.
{{-}}
==Add-on 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 [https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html .po and .pot] files using gettext.
 
In the few months that add-on Rules have been a feature, two sets of rules have been collected:
===Individual Rules===
====Active Person====
[[File:Rule_Active_Person_Filter_Win.png|thumb|right|191px|Fig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Searching for '''''person''''' rules]]'''General filters''' [[{{Version manual}}_Addons|add-on]] rule to find the [[Gramps_Glossary#active_person|Active Person]]. Available for {{icon|peop}}'''Person''', {{icon|rela}}'''Relationships''', {{icon|ance}}'''Charts''', {{icon|geog}}'''Geography'''
 
This is a useful "basic" rule for use in compound filters.
 
Also see:
* the [[Gramps_{{Version manual}}_Wiki_Manual_-_Filters#Home_person|Home Person filter rule]].
{{-}}
===[https://github.com/gramps-project/addons-source/tree/master/FilterRules FilterRules] : Plugin Manager Rulebook Collection===
General Filter Rule Addons
====People related to &lt;filter&gt;====
<!-- isrelatedwithfiltermatch.py -->
[[File:Rule_Person_Filter_Win.png|thumb|right|450px|Fig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Searching by Rule name]]{{icon|peop}}'''Person &bull; General filters''' [[{{Version manual}}_Addons|add-on]] rule to find [[Gramps_Glossary#person|Person(s)]] matching a specified filter.
 
Matches people who are related to anybody matched by a person filter.{{-}}[[File:Pythongadget.png|left|150px|link=https://github.com/gramps-project/addons-source/tree/master/FilterRules]]<code>'''isrelatedwithfiltermatch'''</code> provided as [https://github.com/gramps-project/addons-source/tree/master/FilterRules <code>sample '''.gpr.py''' & '''.py''' code</code> for writing add-on filter rules]. Demonstrates piping the output of one custom Filter into another.{{-}}
====People with events with a selected role====
<!-- hasrolerule.py -->
[[File:Rule_PersonEvent_Role_Win.png|thumb|right|450px|Fig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Searching for Person Rules which include the 'role' term.]]
{{icon|peop}}'''Person &bull; Event filters''' [[{{Version manual}}_Addons|add-on]] rule to find [[Gramps_Glossary#person|Person(s)]] having any [[Gramps_Glossary#event|Event]] with a specified [[Gramps_Glossary#event_role|Event Role]].
{{-}}
===People Separated less than &lt;N&gt; degrees of &lt;Home person&gt;===
[[File:Rule_DegreesOfSep_PersonID_Win.png|thumb|right|450px|Fig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Searching by Rule name]]
====Families with Events with a selected role====
<!-- familieswitheventfiltermatch.py -->
[[File:Rule_FamiliesEvent_Role_Win.png|thumb|right|450px|Fig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Searching by Rule name]]
{{icon|fami}}'''Families &bull; Event filters''' [[{{Version manual}}_Addons|add-on]] rule to find [[Gramps_Glossary#family|Families]] having any Family member or shared Family level [[Gramps_Glossary#event|Event]] with a specified [[Gramps_Glossary#event_role|Event Role]].{{-}}[[File:Pythongadget.png|left|150px|link=https://github.com/gramps-project/addons-source/tree/master/FilterRules]]<code>'''hasrolerule'''</code> provided as [https://github.com/gramps-project/addons-source/tree/master/FilterRules <code>sample '''.gpr.py''' & '''.py''' code</code> for writing add-on filter rules]. Demonstrates including category variants of a rule in the same add-on.{{-}}
 
====Source matching parameters====
<!-- hassourcefilter.py -->[[File:Rule_Sources_Parameters_Win.png|thumb|right|450px|Fig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Searching by Rule name]]
{{icon|sour34}}'''Sources &bull; General filters''' [[{{Version manual}}_Addons|add-on]] rule to find [[Gramps_Glossary#source|Sources]] based on the following parameters: ''Title'', ''Author'', ''Abbreviation'', ''Publication''.
 
This add-on rule has similar options to the standard Filter Gramplet for the [[Gramps_{{Version manual}}_Wiki_Manual_-_Entering_and_editing_data:_detailed_-_part_2#New_Source_dialog|Source]] [[Gramps_{{Version manual}}_Wiki_Manual_-_Categories#Sources_Category|Category View]]. It can be used to save complex filter parameters.{{-}}[[File:Pythongadget.png|left|150px|link=https://github.com/gramps-project/addons-source/tree/master/FilterRules]]<code>'''hassourcefilter'''</code> provided as sample [[Addons_development#Create_a_Gramps_Plugin_Registration_file|.gpr.py]] & '''.py''' code for [https://github.com/gramps-project/addons-source/tree/master/FilterRules writing add-on filter rules]. Demonstrates text based filtering with RegEx options.{{-}}
 
====People Separated less than &lt;N&gt; degrees of &lt;Home person&gt;====
<!-- degreesofseparation.py (1)-->
[[File:Rule_DegreesOfSep_HomePerson_Win.png|thumb|right|450px|Fig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Searching for Person Rules which include the 'degrees' term.]]
{{icon|peop}}'''Person &bull; Relationship filters''' [[{{Version manual}}_Addons|add-on]] rule to find [[Gramps_Glossary#person|Person(s)]] having a relationship to the ''[[Gramps_Glossary#home_person|Home Person]]'' within a specified degree of [[Genealogy_Glossary#consanguinity|Consanguinity]] and [[Genealogy_Glossary#affinity|Affinity]].
 
The [[Gramps_Glossary#home_person|Home person]] is point of reference for calculating ('''&lt;N&gt;''') Degrees. For '''N''', Minimum value is 1, Maximum is value 32.
 
* '''Degree 1''': person/spouse + children ( &lt;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.
 
[https://gist.github.com/Mattkmmr/4d0369cbee38bdf14395cb2f4505fb8a GitHub Repository files]
{{-}}
 ====People Separated less than &lt;N&gt; degrees of &lt;person&gt;====<!-- degreesofseparation.py (2)-->[[File:Rule_DegreesOfSep_HomePerson_WinRule_DegreesOfSep_PersonID_Win.png|thumb|right|450px|Fig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Degrees Searching Person rules by 'degrees' term; roll-over hint for ID.]]{{icon|peop}}'''Person &bull; Relationship filters''' [[{{Version manual}}_Addons|add-on]] rule to find [[Gramps_Glossary#person|Person(s)]] having a relationship to a specified Person within a specified degree of [[Genealogy_Glossary#consanguinity|Consanguinity]] and [[Genealogy_Glossary#affinity|Affinity]]. [https://github.com/gramps-project/addons-source/pull/283 GitHub Repository files]{{stub}}====Events of families matching a &lt;family filter&gt;====Events of families matching a &lt;family filter&gt; ====Families matching &lt;event filter&gt;====<!-- isfamilyfiltermatchevent.py -->Matches families that are matched by an event filter ====People who are part of families matching &lt;filter&gt;====<!-- infamilyrule.py --> People who are part of Separation families matching &lt;filter&gt; ====Filter people by their age at death==== ====Match associations of &lt;person filter&gt;==== ====People with multiple parent records===={{icon|peop}}'''Person &bull; Family filters''' [[{{Version manual}}_Addons|add-on Rule]]rule thatmatches people who have more than one set of parents.
{{-}}
=Section==[https://github.com/gramps-project/addons-source/tree/master/FilterRules2 FilterRules2] : Plugin Manager Rulebook Collection===Genetic Genealogy Filter Rule Addons{{stub}}====Matrilineal progenitrix of &lt;person&gt;====<!-- matrilinealprogenitrix.py -->Matches the earliest recorded matrilineal ancestor mother. ====Mitochondrial inheritance of &lt;filter&gt;====<!-- mtinheritanceoffiltermatch.py -->Matches recorded descendants of a filter result following mitochondrial inheritance patterns. ====Mitochondrial inheritance of &lt;person&gt;====<!-- mtinheritance.py -->Matches recorded descendants of person following mitochondrial inheritance patterns. ====Patrilineal progenitor of &lt;person&gt;====<!-- patrilinealprogenitor.py -->Matches the earliest recorded patrilineal ancestor father. ====X-chromosomal ancestors of &lt;person&gt;====<!-- xchromancestors.py -->Matches ancestors of &lt;person&gt; following a X-chromosomal inheritance pattern. ====X-chromosomal descendants of &lt;person&gt;====<!-- xchromdescendants.py -->Matches descendants of &lt;person&gt; following a X-chromosomal inheritance pattern. ====Y-chromosomal inheritance of &lt;person filter&gt;====<!-- yinheritanceoffiltermatch.py -->Matches recorded descendants of a filter result following Y-chromosomal inheritance patterns.====Y-chromosomal inheritance of &lt;person&gt;====<!-- yinheritance.py -->Matches recorded descendants of person following Y-chromosomal inheritance patterns.{{-}} ===Pre-Release Rules=======Descendants of &lt;person&gt; sharing yDNA with each other====Matches descendants of a &lt;person&gt; sharing yDNA<!--Hide the Active Person rule until the necessary patch is released in 5.1.3 ====The Active Person====The active Person Requires a [https://gramps.discourse.group/t/custom-filters-based-on-currently-selected-person-s/354/17 patch] to be compatible with the Person Grouped View--> =The Evolution of of Rules as Add-Ons=
==Gramps 5.1.1 (Sept. 2019)==
* Fix bug {{Bug|0011114}}: resolve crashes in withinarea filter rule:
* Fix Custom filter update when created via sidebar.
=Development of Rules as addons Developing New Rule Add-Ons =
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 add-on (plug-in) framework to support expanding Filter Rules via the Plugin Manager.
-->
== Resources ==
* [https://github.com/gramps-project/addons-source/tree/master/FilterRules Sample addon Filter code]
== See also ==
* [[Gramps_{{man version}}_Wiki_Manual_-_Filters#Which_filter_rules_in_which_Category.3F|Built-in rules by category]]
* [[Brief_introduction_to_Git|Git introduction]]
* [https://github.com/gramps-project/gramps/tree/master/gramps/gen/filters/rules Built-in Rules Source code] (Git)* [https://github.com/gramps-project/addons-source Add- on Rules Source code ] (Git)
* [https://developer.gnome.org/gtk3/stable/ch03.html Gtk+ widget gallery] - Gnome development sample code
* [https://github.com/gramps-project/addons - downloadable .tgz files] (Git)
* [[Addons_development|Addons Development]]
* [[Writing_a_plugin|Writing a Plugin]]
* [Gramps-devel]: [https://sourceforge.net/p/gramps/mailman/message/28524592 Sequencing of filter rules?]
* [Gramps-devel]: [https://sourceforge.net/p/gramps/mailman/message/7969670/ filter rules]
* [Gramps-users]: [https://sourceforge.net/p/gramps/mailman/messagegramps-users/25097338thread/ 4BD58852.3040705%40o2.co.uk/#msg25097338 Gramplet writing - newbie help needed]
*based on the [https://sourceforge.net/p/gramps/mailman/gramps-users/ Gramps-users] archived threads:
[[Category:Addons]]
[[Category:Plugins]]
[[Category:WikiContributors]][[Category:How do I...]]
<!--
{{man warn|1=WarningTitle/Heading |2=warning text }}</onlyinclude>
-->
{{Languages|Rule expansions}}
10
edits

Navigation menu