User talk:Rich Farmbrough/ISBN/Template:Auto isbn

ISBN Change over
ISBN format changes at midnight 31 December 2006 from a 10 digit to a 13 digit format.

The idea is to (robotically) use this template to ensure that as many ISBNs as possible "roll over" smoothly.

Afterwards the template will be simplified (since time won't go backwards, we hope) and then "subst:"ed out (the "substing" is easy but not trivial).

Rich Farmbrough 21:32 30 August 2006 (GMT).

Bug
The check-digit calculation for ISBN-13 is wrong. The correct translation of "0-593-01518-5" is "978-0-593-01518-6", not "978-0-593-01518-4". I have already given you the correct calculation on your user talk page. --KSmrqT 22:35, 1 September 2006 (UTC)

Thanks, I was doing this from memory, and didn't checksum the 978, fortunately this means +2 so it's a trivial fix. Rich Farmbrough, 21:52 2 September 2006 (GMT).


 * That didn't fix it. The check digit must be computed modulo 10, not modulo 9 (which I've changed); the digit must be such that the weighted sum including the check is 0 (which requires a subtraction); and the first three digits for ISBN-13 need not be "978" (also possible is "979" ). You really need to run the template against an assortment of examples to be confident in its results. For example, try this list from your user talk page:
 * 99921-58-10-7
 * 9971-5-0210-0
 * 960-87363-3-1
 * 80-86119-13-0
 * 4-8457-0667-9
 * 0-14-015098-6
 * 0-446-60098-9
 * 0-8044-2957-X
 * <tt>0-85386-070-X</tt>
 * <tt>0-901690-54-6</tt>
 * <tt>0-9500000-0-0</tt>
 * Here again is the check digit calculation for ISBN-13 data. --KSmrqT 07:48, 6 September 2006 (UTC)
 * Thanks, the mod 10 was the soln, I don't intend that the template be still in use for long after Jan 1, 979 numbers should go straight to the raw wayof doing things.  My current problem is that the ifeq: isn't doing what I want to put the X in.  See User:Rich Farmbrough/notebook. Rich Farmbrough, 21:55 6  September 2006 (GMT).
 * Fixed by moving to ifexpr: Rich Farmbrough, 21:55 6 September 2006 (GMT).
 * And fixed algorithm, sorry for being dense. Rich Farmbrough, 22:29 6 September 2006 (GMT).

Another thing to be wary of is the placement of hyphens. For example, "978-80-86119-13-7" and "978-2-86274-486-5" and "978-0-446-60098-9" are all correct; the proper hyphenation depends on the number. See here. --KSmrqT 03:31, 2 September 2006 (UTC)

Yes, that's why the template doesn't try to hyphenate. My regular expressions for hyphenating use over 2000 lines (although they could be reduced), far to much complexity to build into a template. Thanks for the feedback. Rich Farmbrough, 21:52 2 September 2006 (GMT).

Possibilities
It would be possible to go through more than two stages,

E.G.  now -  1 Dec  display 10 digit 1 Dec - 31 Dec display 10 digit followed by 13 1 Jan - 31 Jan display 13 digit followed by 10 1 Feb - future display 13 digit

Comments?

bugs?
Didn't seem to work. Tried using on Alisa Kwitney and it put an X at the end (it ends in 3 for the 10 digit, not X) Kevin_b_er 21:20, 6 September 2006 (UTC)
 * Hi Kevin, should work now. Rich Farmbrough, 22:28 6 September 2006 (GMT).

Bad idea
Using this template in Wikipedia articles must surely be the wrong way to address the problem. It makes pages much harder to edit. --LA2 20:33, 7 September 2006 (UTC)

Dangerous to modify references to use 13-digit instead of 10-digit
It's questionable whether we should be converting 10-digit ISBNs to 13-digit ISBNs for linking. That will probably work for vendor maintained databases, such as WorldCat, or for major catalogs, such as LoC or British Library. But I seriously doubt that most libraries are going to scan their DBs to reindex their 10-digit ISBNs as 13-digit. It will also probably require a software upgrade on a library's part for their OPAC to understand the incoming 13-digit '978' as a valid 10-digit.

In addition, if the book has a 10-digit on the back and that's what the user put in their reference, that seems like the correct ISBN to display in the reference. 10-digits should still work for linking for the forseeable future, otherwise OPAC vendors would break almost every ISBN link into their OPAC.

Thanks, RainbowCrane | Talk 15:23, 8 September 2006 (UTC)


 * Hi Rainbow, the "sunrise" for 13 digit ISBNs was 1 January 2005. As to the support of 979s, I hope and believe this present exercise (with ISBNs, not Wikipedia) will be long out of the way before we need worry about them. I'm sure that most systems will continue ot support 10 digit ISBNS for a long time, but they are not required to.  In terms of supporting 13 digit ISBNs all significant systems will need to support them natively, legacy data can be dealt with in two ways, either by checking the converted number as well as the input number (which is a trivial piece of programming) or by running a conversion routine on the data, which is almost as trivial, the hard part, potentially, being the change to allow longer numbers, which will have been needed anyway.  Regardless we need to keep thinking about the best process, as I say "auto isbn" can be used in a number of different ways. Rich Farmbrough, 16:32 8  September 2006 (GMT).

Further to my subsequent note says: Data processing systems in the book distribution and supply chain will convert to carry 13-digit ISBNs for all items in their catalogs by 2007. Because customers, including libraries, will have books or bibliographic records that carry only the original 10-digit ISBN it is anticipated that for the foreseeable future these systems will need to accept queries with either 10- or 13-digit ISBNs for the older materials. Queries with 10-digit ISBNs can be algorithmically converted to their 13-digit equivalent in the search process. For communication with legacy data, it is also possible to convert a 13-digit ISBN beginning with “978” to a 10-digit ISBN. However, the presence of “978” at the beginning of an ISBN will not guarantee that the ISBN was ever issued as a 10-digit number: some ISBNs with prefix 978 will be created after 2007 because publishers will continue to use the ISBNs that have been assigned to them previously until all have been used. and also has other interesting things to say on the subject. Rich Farmbrough, 16:31 8 September 2006 (GMT).

E.G. "ISBN data output – general considerations All external transmission of the ISBN should utilise the 13-digit manifestation after 1 January 2007." Rich Farmbrough, 09:07 16 October 2006 (GMT).