* Export to GEDCOM: _QUAY values

Questions about exporting information from FH to other programs and websites
Post Reply
User avatar
kathykult
Gold
Posts: 17
Joined: 17 Aug 2006 15:07
Family Historian: V7
Location: Belvidere, IL
Contact:

Export to GEDCOM: _QUAY values

Post by kathykult »

Does anyone have a list (or know where such a list resides) of all possible values for the "_QUAY" and what they mean? When I export to GEDCOM natively (i.e., not via Mike Tate's excellent "Export GEDCOM File" plugin), I get values in the _QUAY as HEX values (the following is testing the same source using different Assessment combos from the 'Citation Assessment' option box):

This is how the values look in FH:
Image

Here is the GEDCOM for those options:

Code: Select all

2 SOUR @S655@
3 _QUAY 0x08
2 SOUR @S655@
3 _QUAY 0xa0
2 SOUR @S655@
3 _QUAY 0xa8
2 SOUR @S655@
3 _QUAY 0xaa
So I'm looking for a list that tells me which HEX values belong to which assessment choices in FH, something like this:

Direct = 0x08
Original Primary = 0xa0
Original Primary Direct = 0xa8
Original Primary Direct Questionable = 0xaa
etc.

Or does such a list even exist? I'm looking to incorporate these into my citations/endnotes on my TNG website. I guess I could try to figure out all of the possible combinations of the assessment values, but I thought I'd ask if anyone has a list first before doing all of that! ;)

Any info is very much appreciated!
Kathy Kult
User avatar
Mark1834
Megastar
Posts: 2414
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Export to GEDCOM: _QUAY values

Post by Mark1834 »

I haven’t studied the _QUAY values, but a common technique for storing this type of data is to have different bits representing the various parameters. In more familiar base 10 numbers, that would mean the parameters are represented as 1, 2, 4, 8, etc. Every possible combination can therefore be represented by a unique number if the various contributions are summed together.

Individual values can be extracted very easily with the appropriate bit operation. Somebody is bound to have reverse engineered the details… :)
Mark Draper
User avatar
tatewise
Megastar
Posts: 28158
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Export to GEDCOM: _QUAY values

Post by tatewise »

Kathy, I suggest you ask Calico Pie for the list of values which must exist in their program documentation for FH.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
NickWalker
Megastar
Posts: 2554
Joined: 02 Jan 2004 17:39
Family Historian: V7
Location: Lancashire, UK
Contact:

Re: Export to GEDCOM: _QUAY values

Post by NickWalker »

It depends on which of these options are set. If they are set then add the number to the total.

Unreliable = 1
Questionable = 2
Indirect = 4
Direct = 8
Secondary = 16
Primary = 32
Derivative = 64
Original = 128

e.g. Questionable Primary and Indirect would be 2+4+32 = 40 (Edit: actually 38 as Kathy points out below :D)

This then needs to be converted to Hexadecimal. If you're not familiar with that then just type "Convert 40 to Hexadecimal" into Google. The answer is 28 so this is written as 0x28

So you would reverse this process to convert a Hexadecimal _QUAY value to the different options.

Looking at this another way, this is really using binary so put the headings and write a 1 or 0 under each to indicate if the option is set or not:

Code: Select all

128 64 32 16 8 4 2 1
O   D  P  S  D I Q U
0   0  1  0  0 1 1 0
So if you were to convert the _QUAY hexadecimal value to binary you could see which settings are On.

This may be a bit technical but the way I do it is to do a bitwise AND of the value with each option. So, e.g. if the Code ANDed with 16 is not zero then that Secondary is one of the options. If the code ANDed with 32 is not zero then Primary is one of the options, etc.

Going back to the original poster's question... Some of the possible options don't make sense so there are not as many different combinations as you might think. e.g. It wouldn't make sense to have '12' (Hex: C) (Indirect and Direct). So it wouldn't be too difficult a job I think to turn all the sensible combinations into a list as you suggested.
Nick Walker
Ancestral Sources Developer

https://fhug.org.uk/kb/kb-article/ancestral-sources/
User avatar
kathykult
Gold
Posts: 17
Joined: 17 Aug 2006 15:07
Family Historian: V7
Location: Belvidere, IL
Contact:

Re: Export to GEDCOM: _QUAY values

Post by kathykult »

Thanks Mike!

Since I have your ear :D would it be possible to add an option to enable/disable the "doAssess" function in your Export GEDFILE plugin (for TNG)? I'm still using it to convert FH to TNG, but since I plan to start using the advanced settings for citation assessments, I'd like to carry them over to TNG and use them in my citations there as well.
Kathy Kult
User avatar
kathykult
Gold
Posts: 17
Joined: 17 Aug 2006 15:07
Family Historian: V7
Location: Belvidere, IL
Contact:

Re: Export to GEDCOM: _QUAY values

Post by kathykult »

Thanks Nick! That makes sense. I am familiar with converting HEX, OCT, DEC, Binary back and forth - LOL... but I had that class in college many, many, many moons ago. I haven't had to use HEX in awhile.... I'm retired now and haven't been programming much, it's amazing how much info just leaves the ol' brain once you retire and don't use that info anymore!

Oh, wait a sec... you said:
e.g. Questionable Primary and Indirect would be 2+4+32 = 40
2+4 is 6... plus 32 is 38, not 40... then 38 in hex would be 0x26, which is what I get when I choose Questionable, Primary, and Indirect in FH and save the .ged:

3 _QUAY 0x26

Thanks for the explanation!

Now to figure out all of the combos.... because I want to make the citations assessments into something more readable than "0x26" to the non-programmer peeps who read my website. So now I have to translate:
3 _QUAY 0x26

to something like:
_QUAY-STMT "ASSESSMENT: This is a primary source with indirect evidence, but has questionable reliability".

Or something like that. This'll give me something to do for the next few days!
Kathy Kult
User avatar
NickWalker
Megastar
Posts: 2554
Joined: 02 Jan 2004 17:39
Family Historian: V7
Location: Lancashire, UK
Contact:

Re: Export to GEDCOM: _QUAY values

Post by NickWalker »

Sorry quite right 38 not 40
Nick Walker
Ancestral Sources Developer

https://fhug.org.uk/kb/kb-article/ancestral-sources/
User avatar
Mark1834
Megastar
Posts: 2414
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Export to GEDCOM: _QUAY values

Post by Mark1834 »

There is an extra wrinkle to be aware of if you want to capture all quality assessments. GEDCOM 5.5.1 permits only a single value, of unreliable (0), questionable (1), secondary (2), or primary (3). Here, there is no need for any bit operations, as only a single value is permitted.

The system Nick and I described allows multiple values to be stored in one number, but is not GEDCOM-compliant, hence the use of the _QUAY tag to indicate a local customisation.

However, where the user enters a single GEDCOM-compliant value (e.g., secondary), this is stored as 3 QUAY 2, not 3 _QUAY 0x10. To capture all the quality assessments, you will have to read both the QUAY and _QUAY tags, and interpret them using two separate methods... :?
Mark Draper
User avatar
kathykult
Gold
Posts: 17
Joined: 17 Aug 2006 15:07
Family Historian: V7
Location: Belvidere, IL
Contact:

Re: Export to GEDCOM: _QUAY values

Post by kathykult »

Got it Mark, thank you so much for pointing that out!
Kathy Kult
User avatar
tatewise
Megastar
Posts: 28158
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Export to GEDCOM: _QUAY values

Post by tatewise »

kathykult wrote: 04 Jul 2023 21:29 Thanks Mike!

Since I have your ear :D would it be possible to add an option to enable/disable the "doAssess" function in your Export GEDFILE plugin (for TNG)? I'm still using it to convert FH to TNG, but since I plan to start using the advanced settings for citation assessments, I'd like to carry them over to TNG and use them in my citations there as well.
The plugin is focused on exporting GEDCOM compliant data.
However, I will add the option to leave _QUAY values unaltered in the Other Options tab of the next version of the plugin.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Post Reply