* Custom query to export subset to GEDCOM

Questions about exporting information from FH to other programs and websites
Post Reply
avatar
torivar
Gold
Posts: 13
Joined: 16 Jan 2024 06:48
Family Historian: V7

Custom query to export subset to GEDCOM

Post by torivar »

Hi all,
I’m a long-time user of TMG, and now a Family Historian newbie - slowly preparing the “final move” to Family Historian (I’m currently using FH 7.0.22).

On a regular basis, I’m updating a TNG website with a subset of my database in TMG. (And no, I don't want to split the DB in different DBs). In TMG I’ve been using "focus group" to define what to include in the GEDCOM exported from TMG and imported in TNG (plus some fine-tuning with a couple of php scripts).

The rules I apply when exporting are something like this:
  • For a given couple (couple A) include
    • All siblings and their spouses
    • All direct ancestors (for X generations indicated in code or as parameter)
      • For all the direct ancestors, include
        • All spouses
        • All siblings/half-siblings AND their spouses
  • For the same given couple A, include
    • All descendants (for Y generations indicated in code or as parameter)
      • for all descendants, include
        • all spouses
          • the parents of all spouses

I’m hoping that some of you can get me going an help me creating a reusable custom query that will perform the steps in the algorithm above - and result be fed to FH GEDCOM export.

Thank you!
User avatar
tatewise
Megastar
Posts: 28594
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Custom query to export subset to GEDCOM

Post by tatewise »

That is an interesting technique that I don't remember anyone using before.
It might help us understand your objectives if you could explain why you work in 'focus groups' rather than simply migrate the entire Project database to TNG.

Do you use Shared Fact Witnesses or any other linked Individual records such as Associated Persons or Aliases?
If so, must they be included, and if so, what about their relatives?

In due course, you will also have to make decisions about migrating Source Citations and Media Files.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
torivar
Gold
Posts: 13
Joined: 16 Jan 2024 06:48
Family Historian: V7

Re: Custom query to export subset to GEDCOM

Post by torivar »

Thank you for your promt reply
As I said, I've been using TMG (For a long time) and TNG (only a few months). I'm now using both TMG and FH in parallell, trying to learn FH and figuring out what adaptations I need to do before abandoning TMG and making FH my master DB. TNG is used for sharing info to different family groups. My question is really about finding a workflow that is robust and requires as little manual intervention as possible when exporting part of my DB to TNG.
It might help us understand your objectives if you could explain why you work in 'focus groups' rather than simply migrate the entire Project database to TNG.
As said, my "master DB" will be in FH. The DB is rather large, and to put it simple; the website I'm currently exporting to, has a focus on ancestors and descentants on my 2xGG father on my paternal side. My maternal side and all ancestors on my wife's side is of no interest for the "target audiences" of this website. Thus I ony want to export part of my DB.

Tentative workflow
I've been using "focus group" in TMG just for convenience. Still without detailed insight of all the functionality of FH, it looks to me that using i) a custom query finding the right people and ii) putting them into a named list before iii) exporting the GEDCOM would be a workflow that looks ok.
Agree? Better alternatives?

For the witnesses part, I'm still in the process "googling" what experiences people have with witnesses etc. As I understand TNG is treating this a bit differently than "most" other programmes.

For "aliases", I'm not sure what your mean, but from TMG, I've normally only exported the "primary name" to TNG, not the variants.

For the media files, I've had a file structure that I'm mostly happy with - although I would like to adjust slightly when making the final move to FH - but I guess my questions related to that is for another post...
avatar
jelv
Megastar
Posts: 672
Joined: 03 Feb 2020 22:57
Family Historian: V7
Location: Mere, Wiltshire

Re: Custom query to export subset to GEDCOM

Post by jelv »

I do something similar to update three different trees on Ancestry using Mark's Ancestry synchronisation plugin. The first has everyone and is a private tree used just to get Ancestry hints. The second is just my relatives to which I link my DNA results and the third the same for my wife. The second and third are shared with researching relations.

The first Ancestry tree is obviously created from my main FH project.

To create the second and third trees I copy my main project. I then have queries that list everyone required in that tree and using the FH split tree helper delete everyone not found by the query. The whole process only takes minutes each time.

You could do the same and use Mike's export plugin to create the TNG GEDCOMs.
John Elvin
avatar
OlivierM
Famous
Posts: 104
Joined: 30 Jan 2023 04:33
Family Historian: V7
Location: Brussels
Contact:

Re: Custom query to export subset to GEDCOM

Post by OlivierM »

torivar wrote: 10 Feb 2024 16:24
Tentative workflow
I've been using "focus group" in TMG just for convenience. Still without detailed insight of all the functionality of FH, it looks to me that using i) a custom query finding the right people and ii) putting them into a named list before iii) exporting the GEDCOM would be a workflow that looks ok.
Agree? Better alternatives?

For the witnesses part, I'm still in the process "googling" what experiences people have with witnesses etc. As I understand TNG is treating this a bit differently than "most" other programmes.
Hello,

I did follow a similar path: TMG, TNG + MH, and then I discovered FH.
Today FH is my master database, and I publish it in TNG + wordpress on a regular base, by deleting all former records in TNG and importing a Gedcom from FH.
I do not really understand why you export partial selections in parallel to FH and TNG.
I would export all my data from TMG to FH, and then export the selection you want to TNG.
(Because FH can handle more data from TMG, like witnesses for instance)
Exporting partial gedcoms from FH is a piece of cake, and the Gedom plugin from Mike even allows you to integrate witnesses in TNG if you want to.

PS: And I love looking at TMG from time to time: that software is still a model for all genealogical softwares. :)
I started with Reunion > 30 years ago, later TMG.
I now use FH as main software, TNG to share my data.
Transkribus to decipher old texts.
Genealogica Grafica, TCGB and My Family Tree to view & check my data. And Genopro for its layered reports.
avatar
Jean001
Famous
Posts: 143
Joined: 03 Mar 2021 11:49
Family Historian: V7

Re: Custom query to export subset to GEDCOM

Post by Jean001 »

OlivierM wrote: 11 Feb 2024 09:39 PS: And I love looking at TMG from time to time: that software is still a model for all genealogical softwares. :)
You are not alone. TMG refugee here. I still miss my customised layout.
Jean
User avatar
tatewise
Megastar
Posts: 28594
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Custom query to export subset to GEDCOM

Post by tatewise »

I think the attached Focus Group query may be close to your stated OP requirements.
Attachments
Focus Group.fhq
(2.15 KiB) Downloaded 96 times
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
torivar
Gold
Posts: 13
Joined: 16 Jan 2024 06:48
Family Historian: V7

Re: Custom query to export subset to GEDCOM

Post by torivar »

I think the attached Focus Group query may be close to your stated OP requirements.
Thank you, this seems to be what I wanted!

One question though - mostly for my own learning: After running the query, the columns "Generation" and "Relationship to Husband" is blank for all resulting rows in the result set. It's not important for my usage, but would be nice to know why...
User avatar
tatewise
Megastar
Posts: 28594
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Custom query to export subset to GEDCOM

Post by tatewise »

Those columns should show the Ancestral (-ve) and Descendant (+ve) Generation number and the descriptive relationship relative to the Husband you entered.
You say all resulting rows in the result set had those entries missing but did you scroll down?

However, it does assume that the Husband and Wife you entered are spouses.

If they are not spouses then many of the relationships may not be able to be deduced by FH.

Even if the Husband and Wife are spouses, some Ancestors of Spouses of Ancestors may not be deduced.

Have you scrolled down through the Result Set to check entries nearer the Husband and Wife?

Also, try using relatively small values for Ancestor Generations and Descendant Generations.
( What values did you use originally? )

Do you still get no entries in those columns?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
torivar
Gold
Posts: 13
Joined: 16 Jan 2024 06:48
Family Historian: V7

Re: Custom query to export subset to GEDCOM

Post by torivar »

Hi,
I really appreciate you effort helping me getting up to speed using FH :)

The couple I enter is married (GEDCOM MARR)

It looks like there are som issues with the query:
- I select 2 both for "Ancestor generations" and "Descendant generations"
- The "Result Set" contains 3367 individuals. Way too many
- My bad about all rows empty for "Generation" and "Relationship to Husband". They are correct for all within the limits set by the two numeric parameters (# ancestor gen & # desc gen). e.g. [-2, 2] for generation. BUT, both columns are empty for all the rows wrongly being in the result set. (I wrongly thought I could click on the column header and sort asc/desc just by clicking...)

Thanks again!
User avatar
tatewise
Megastar
Posts: 28594
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Custom query to export subset to GEDCOM

Post by tatewise »

You can click on a column header in the Result Set (and similarly in the Records Window) to sort on that column.
To reverse the sort hold down the Alt key while clicking.

I think I have found the problem.
Currently, the plugin initially finds all ancestral & descendant generations.
Then it excludes entries where the Generation number is outside the limits.
BUT it does not deal with the entries with no Generation number, so they are all retained by mistake.

The only solution I can think of is to simply exclude all entries with no Generation number.
However, that may exclude some Ancestors of Spouses of Ancestors you might consider part of the focus group.
The attached query implements that strategy and should overwrite the previous version.
Attachments
Focus Group.fhq
(2.3 KiB) Downloaded 85 times
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
torivar
Gold
Posts: 13
Joined: 16 Jan 2024 06:48
Family Historian: V7

Re: Custom query to export subset to GEDCOM

Post by torivar »

Thank you for the updated query-example.
This works for me, and is a nice introduction to the query-system and further "tweaks".

I've also used the query to generate a named list, and experiemented with the "Export Gedcom File"-plugin.
I now have a workflow exporting data from the FH DB to TNG for wider dissemination.

However, I think the workflow could be a lot simpler and quicker if it was possible to use a named list as input to the export gedcom file plugin. Does anyone know it that could be possible?
I'm thinking of something similar to the functionality availavble for the "standard" gedcom export, i.e. File > Import/Export > Export > Gedcom file... --> Select... -> Named Lists ....

I like the flexibility of the export gedcom file plugin, so this would be highly appreciated if possible.
User avatar
tatewise
Megastar
Posts: 28594
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Custom query to export subset to GEDCOM

Post by tatewise »

Sorry, that is not feasible. That feature has been requested before.
The plugin has to work directly with the GEDCOM file for many of the conversions because some data is just not available through the FH database API. It is simply not feasible to filter the GEDCOM file records and exclude not just Individual records but also all the other records that need to be excluded.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Post Reply