Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returning the @Identifier of a .Parents field only returns a single value, not two #321

Open
jexp opened this issue Jan 18, 2022 · 1 comment

Comments

@jexp
Copy link

jexp commented Jan 18, 2022

I'm confused when I'm looking at a .Parents or .Spouses field then returning the raw data returns everything in an odd textual format

but if I ask for the .Identifier, I get only one

./gedcom query -format csv -gedcom ~/Downloads/pres2020.ged '.Individuals | { name: .Name | .String, born: .Birth | .String, died: .Death | .String, id: .Identifier, sex:.Sex, parents:.Parents | .Identifier, parentNames:.Parents }' | head -3
born,died,id,name,parentNames,parents,sex
,,@I2184@,Paul Stobbe,[],[],Male
19 Aug 1946,,@I1@,William Jefferson Clinton,"[William Jefferson Blythe II (b. 27 Feb 1918, d. 17 May 1946) ⚭ Virginia Dell Cassidy (b. 6 Jun 1923, d. Jan 1994)]",[@F2@],Male

Any ideas what I'm doing wrong?

@elliotchance
Copy link
Owner

elliotchance commented Jan 18, 2022

.Parents returns a slice FamilyNode. Each FamilyNode is formatted with marriage/divorce symbols between the Individuals (see https://github.com/elliotchance/gedcom/blob/v38.0.0/family_node.go#L355-L368), so it's string representation of saying "William (born in 1918) is married to Virginia (born in 1923)"

Edit: [@F2@] actually means a list with one item of @F2@. If there were two families it might look like [@F2@,@F3@].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants