Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Create and individual with a specific xref?

4 views
Skip to first unread message

Stephen Woodbridge

unread,
Jan 11, 2013, 9:46:19 AM1/11/13
to gedcom List
Hi All,

Is it possible to create and individual and set the xref to a specific
value?

The use case for this is to maintain consistent references between
various files and/or when the xref is used as a persistent reference for
a web application.

For example, I am parsing some web pages that use the xref for
individuals in the url. I would like to maintain these in the Gedcom
file I create so when I later regenerate the pages I can maintain the
same url to individuals relationship.

Thoughts?

-Steve

Mikkel Eide Eriksen

unread,
Jan 11, 2013, 2:07:08 PM1/11/13
to Stephen Woodbridge, gedcom List
Hi Steve

AFAIK the gedcom standard does not impose any restrictions on whether an app may modify an xref, so there's no guarantee that an xref will survive being opened in "some app". You're probably only using your own code for these files, though, so that might not be an issue. Anyway, maybe you can use one of the following tags:

+1 RFN <PERMANENT_RECORD_FILE_NUMBER> {0:1}
+1 REFN <USER_REFERENCE_NUMBER> {0:M}
+2 TYPE <USER_REFERENCE_TYPE> {0:1}
+1 RIN <AUTOMATED_RECORD_ID> {0:1}

Regards,
Mikkel

Paul Johnson

unread,
Jan 11, 2013, 3:29:48 PM1/11/13
to Mikkel Eide Eriksen, Stephen Woodbridge, gedcom List
But if you're talking about Gedcom.pm, in versions previous to 1.17 you
could add a parameter to add_individual which would be the xref you
wanted.

Now forget all that. I had never documented it, and in 1.17 I changed
it and added some documentation:

Normally you will not want to pass any arguments to the function. Those
functions which have an xref (ie not header or trailer) accept an optional
first argument { xref => $x } which will use $x as the xref rather than
letting the module automatically choose the xref.

So now you can call:

my $individual = $ged->add_individual({ xref => "I123" });

There's an example using add_note() in t/ged_create.t

This is less than a fortnight old, so if you go this way you may be the
first person to use this feature.

--
Paul Johnson - pa...@pjcj.net
http://www.pjcj.net

Stephen Woodbridge

unread,
Jan 11, 2013, 5:17:11 PM1/11/13
to perl-...@perl.org
Paul,

Awesome! I just installed Gedcom 1.17, modified my script, and kicked
off another run. This will read 1345 html pages with 30 individuals with
their related family groups per page and builds a gedcom file from all
of that with over 40000 people in it.

It takes 1.5GB of memory and about 1.5 hours to process it all and
generate the gedcom file. I think the only thing that I have left to do
with this is to add the source definition and then link the source to
all the individuals, family groups and notes.

It is designed to parse a "Second Site" generated web site[1], but I'm
sure there are additional bells and widgets that can be added to this
that the site I'm grabbing does not use.

I think it would be great to create another program that, can read a
gedcom file and generate a "Second Site" like set of html pages. I have
a genealogy website the I build for my data [1][2], but it is all
dynamically generated pages from a database. I use Gedcom.pm to load my
database. But generating linked static pages that can be put on a DVD
for distribute has a lot of value. So I might tackle this in the near
future.

Thanks,
-Steve

[1] http://www.nantuckethistoricalassociation.net/bgr/BGR-o/index.htm
[2] http://swoodbridge.com/family/Woodbridge/
[3] http://swoodbridge.com/family/WoodbridgeRecord/

Stephen Woodbridge

unread,
Jan 11, 2013, 7:34:21 PM1/11/13
to perl-...@perl.org
Paul,

FYI, that worked great! If anyone is interested in the script or the
gedcom file let me know and I can post a link for it.

Thanks,
-Steve
0 new messages