[OPEN-ILS-DEV] TCN value question related to Keeping bib / auth / MFHD / record identifiers in sync post

Dan Scott dan at coffeecode.net
Fri Nov 20 10:10:58 EST 2009


On Fri, 2009-11-20 at 08:46 -0500, Jason Stephenson wrote:
> Quoting Alan Rykhus <alan.rykhus at mnsu.edu>:
> 
> > Hello,
> >
> > I've read the 4 posts related to the Dan Scott's post on keeping the 001
> > field in sync with the EG record_entry id and it brings up a question
> > for me.
> 
> I read those posts, also, and was thinking of replying, but saw your  
> question and thought my reply would fit nicely in your thread.

Hey, great to hear from other people on the subject! I have a quick
response to the source of the tcn_source / tcn_value columns, at least
outside of bulk imports, below...

> 
> >
> > What exactly is the real purpose of the tcn_source and tcn_value columns
> > in the biblio.record_entry table?
> 
> My understanding is that the tcn_value column is meant to hold the tcn  
> value from the MARC 001 field and tcn_source is the id if the record  
> source from the config.bib_source table. I could be mistaken but  
> that's what I discerned from reading the code.

Well, the database schema just defines biblio.record_entry.tcn_source as
a non-null TEXT column with a default value of "AUTOGEN" - no further
constraints. So it's not tied to the config.bib_source table.

In the _find_tcn_info() subroutine in
OpenILS/Application/Cat/BibCommon.pm, the tcn_value is derived from 001,
and the tcn_source is derived from 003. 

If there's no 003, then the tcn_source is set to "System Local". 

If the tcn_value that was found already exists, then the find_free_tcn()
subroutine is invoked that attempts to derive the tcn_value / tcn_source
from the following subfields in order, stopping if a tcn_value is found:

  * 901a / 901b
  * 039a / 039b (or "System Local" if no tcn_source was retrieved)

The system then checks to see if the tcn_value already exists in the
system; if so, or if a tcn_value wasn't found in one of these subfields,
then it tries again, processing the following tcn_value / tcn_source in
order and checking to see if the tcn_value already exists after each
pair; if it exists, then it moves on to the next match possibility:

  * 020a / "ISBN"
  * 022a / "ISSN"
  * 010 / "LCCN"
  * 035a / "System Legacy"
  * return undef

The tcn_source is set to the text string (such as "ISBN") if the
corresponding tcn_value is found.

Hopefully that helps determine where the TCN value and source are
derived from, at least in the current trunk code, outside of bulk
imports.



More information about the Open-ils-dev mailing list