[OPEN-ILS-DEV] Holdings Import Program
Dan Scott
denials at gmail.com
Wed Nov 14 10:10:20 EST 2007
On 14/11/2007, Travis Schafer <tschafer at carsoncity.k12.mi.us> wrote:
>
>
> Following a conversation with Jason yesterday (yeah, I'm trying to use him
> as an excuse for barging in on the list... sorry Jason), I thought that I
> would post the attached program here.
>
> It's a small C program that I whipped up to import holdings information to
> Evergreen from a MARC XML file. I am sure that it could use some improvement
> (the optimization was for programmer time), but it has worked well and is
> thoroughly documented with comments. Obviously, it needs to be compiled
> against libxml2 and the Postgres library.
>
> Anyway, I hope that it's useful for someone else. If it isn't, it isn't...
> and I'm always open to suggestions.
>
> Thanks for your time, and sorry for the interruption!
>
> Travis Schafer
> Technology Director
> Carson City - Crystal Area Schools
>
Travis:
You (and any others lurking about) are more than welcome on the list!
Feel free to barge in any time, and please stick around...
This looks really nice, actually - it's always good to have examples
of well-documented code that make the import process more explicit! As
xmlReadFile() reads the whole XML document into memory, I suppose it
would make sense for large libraries interested in using this approach
to chunk the blocks of records up into reasonable sizes (50K records
per file or so). import_holdings.pl, which I reworked a bit in trunk,
suffers from the same affliction, but what are you gonna do?
The one challenge I've noticed with the two-step approach of importing
the biblio records, then importing the holdings for those records, is
that synchronizing the TCN between the two steps can be a bit of a
pain. Our system, for example, quite happily allows duplicate 001
fields (arggh!). I've been considering moving the basic logic from
import_holdings.pl into marc2bre.pl so that we can ensure that the
TCNs are perfectly synchronized for the bib records and the
corresponding holdings. It will mean an additional set of command-line
flags, but hey - it's not like you have to migrate legacy records
every day.
As far as your code goes, if you want to contribute it to the code
repository there's one more step to take - as this is a substantial
contribution, you need to attach a copy of the Developer's Certificate
of Origin (DCO) 1.1 as mentioned in
http://open-ils.org/documentation/contributing.html
If you have any other utilities that you whip up that you think might
be useful to the project, keep 'em coming!
--
Dan Scott
Laurentian University
More information about the Open-ils-dev
mailing list