A little answer to GEPS 015 [Repository Research Support] using Supertool

Hi,

This a Google Translate translation (maybe giving less mistakes than my usual posts, maybe not) from French to English of my post on Geneanet about a SuperTool filter wich is about to “find all the persons who have one or more sources concerning (associated with; coming from) a given place but who do not have an event related to that place”.

Thanks to @kku for its help!


Hello,

It’s been a while since I replied to this thread to talk about a new SuperTool filter. But first you will be entitled to a long enough introduction to explain what the filter does, which is not more complicated than the others but which has a prerequisite that deserves explanation. The usefulness of this filter? Find all the persons who have one or more sources concerning (associated with; coming from) a given place but who do not have an event related to that place.

So here I present you a new filter which requires a little preparation. It is inspired by ​​GEPS 015 “Repository Research Report” (it is Aunt Martha who will be happy) which roughly aims to find leads by ricochet: what can a source repository bring me that is interesting as additional information? In the context of this question, the filter makes it possible to find persons (in this first draft) whose source of a citation from one of their events is common with the sources of citations linked to one or more places (in my filter you will see indicated the IDs of a place, the municipality of Saint-Pierre-des-Loges (SPDL), and its sub-locations).

Example: I created a source “Livre d’or 14/18” [WW1 guestbook] for this municipality and I also created citations for the MPF [“Morts pour la France”: Death for France] of this source and finally created events associated with these people and these citations. These persons were not all born in that place and died elsewhere, on the battlefield. An Persons filter based on the location of events in the town of SPDL does not display them, and for good reason, there is no event there, I only know these people through this SPDL WW1 guestbook source.

I have for each of my sources a special citation (created by a SuperTool script too, already mentioned a little above) “Objet de la source: xyz” [source subject] where xyz takes the title of the source, in the case of the previous Source example; “_Objet de la source: FR-61446, Saint-Pierre-des-Loges. Livre d’or. Relevé collaboratif” [i.e “_Source subject: FR-61446, Saint-Pierre-des-Loges. Guestbook. Collaborative statement”]. A special citation I associated with the SPDL place [in the future V5.2 it could be an event “The municipality of SPDL made a guestbook” associated to that place].

The SuperTool source filter that follows searches for the places I have indicated this type of citation for each source and returns the corresponding sources, including the source “_Objet de la source: FR-61446, Saint-Pierre-des-Loges. Livre d’or. Relevé collaboratif”.

An Events filter searches for any event associated with the sources returned by this SuperTool filter and an Persons filter returns all the persons corresponding to the filtered events.

Persons who were neither born nor died at SPDL and have no event here, but have citations from a source from this municipality (probably because they lived there) now go back with this Persons filter. QED. A new lead for Aunt Martha and for myself to find locals in the database.

The SuperTool filter to save as a Sources filter:

[Gramps SuperTool script file]
version=1

[title]
90. Citations['_Objet de la source:'].References[{'Lieu': 'FR-61446, Saint-Pierre-des-Loges"}] - 157p

[category]
Sources

[initial_statements]
# derived from original @kku import and function - https://github.com/Taapeli/isotammi-addons/issues/1
from supertool_engine import PlaceProxy

def place_citators(handle, ic):
 for _, rhandle in db.find_backlink_handles(handle, include_classes=[ic]):
  yield PlaceProxy(db, rhandle)

#Valeurs modifiables - Début
ref_ids = ["P12073", "P24110", "P00875", "P00874", "P00420", "P23151", "P00870", "P00422", "P23147", "P00866", "P00868", "P00867", "P00864", "P12516", "P00865", "P00863"] # Saint-Pierre-des-Loges et ses sous-lieux
ref_cit = "_Objet de la source:" # Tout ou partie du nom de la citation à rechercher dans ces lieux
#Valeurs modifiables - Fin

ref_type = "Place"
gid = []

[statements]
add_page = False
for citation in citations:
 for referent in place_citators(citation.handle, ref_type):
  for ref_id in ref_ids:
   if f'{ref_type}[{ref_id}]' in str(referent) and ref_cit in citation.page:
    add_page = True
    break
  if add_page:
   break

if add_page:
 gid.append(gramps_id)

[filter]
gramps_id in gid

[expressions]

[scope]
selected

[unwind_lists]
False

[commit_changes]
False

[summary_only]
False

The classic filters that go back to the Persons mentioned before:

The Events filter which calls the SuperTool filter defined in the Sources filters:

    <filter name="90. Sources.Citations['_Objet de la source:'].References[{'Lieu': 'FR-61446, Saint-Pierre-des-Loges&quot;}] - 422p" function="and" comment="422p (E90.422p) - Filtre == [S90.157p]">
      <rule class="MatchesSourceFilter" use_regex="False">
        <arg value="90. Citations['_Objet de la source:'].References[{'Lieu': 'FR-61446, Saint-Pierre-des-Loges&quot;}] - 157p"/>
      </rule>
    </filter>

The Persons filter which calls the previous Events filter:

    <filter name="88. Evenements.Sources.Citations['_Objet de la source:'].References[{'Lieu': 'FR-61446, Saint-Pierre-des-Loges&quot;}] &amp; ^Evénements.Lieux['FR-61446, Saint-Pierre-des-Loges'].Self.SousLieux - 514p" function="and" comment="514p (I88.514p) - Filtre(&amp;) == [E90.422p, I90.513i]">
      <rule class="MatchesEventFilter" use_regex="False">
        <arg value="90. Sources.Citations['_Objet de la source:'].References[{'Lieu': 'FR-61446, Saint-Pierre-des-Loges&quot;}] - 422p"/>
      </rule>
    </filter>

Some screenshots to end this long post:
Examples of sources and citations:

Citations applied to a place (these are the sources of all these citations starting with “_Objet de la source:” that the ST filter will return to the events filter. Any event related to any citation from one of these sources will go back to the persons filter to display it):

One of the people found by the Persons filter (we see that it has no event at SPDL):

And the detail of one of its events which allowed the ST filter to find it (we find the citation from the guestbook 14/18 “_Objet de la source: FR-61446, Saint-Pierre-des-Loges. Livre d’or. Relevé collaboratif”:

A second example to finish; among the Persons there are of course those of the guestbook but also all those who have events nowhere or elsewhere depending on a source at SPDL:


or there:

Et voila. Hoping that this long post and this filter can be usefull to someone.

1 Like

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