MeridianMERIDIAN

ISBN

identity.commerce.isbn

International Standard Book Number. ISBN-10 (10 digits with check digit) or ISBN-13 (13 digits with check digit). Also accepts with hyphens.

Worked samples

DuckDB 1.5.5 · finetype 0.6.64

ValueAs VARCHARisbn_version
978-0-13-110362-7978-0-13-110362-7ISBN-13
0-13-110362-80-13-110362-8ISBN-10
97801311036279780131103627ISBN-13
Check digit
ISBN mod 10 / mod 11

Shape

Pattern
^(?:97[89]-)?[0-9]{1,5}-[0-9]+-[0-9]+-[0-9X]$|^[0-9]{9}[0-9X]$|^[0-9]{13}$
ValueLengthShape
978-0-13-110362-717matches
0-13-110362-813matches
978013110362713matches
978-0-13-110362-16rejected: one character short

Told apart

Going the other way, this type's own rule accepts 2 of 3 samples of EAN.

Background

Origin

The need for an international numbering system for books was first discussed at the Third International Conference on Book Market Research and Rationalisation in the Book Trade, held in November 1966 in Berlin.[1] At that time, a number of European publishers and book distributors were considering the use of computers for order processing and inventory control.[1] The ISBN system was developed out of the book numbering system introduced in the United Kingdom in 1967 by J. Whitaker & Sons, Ltd.[1] It also grew out of the book numbering system introduced in the United States in 1968 by R. R. Bowker.[1] ISO Technical Committee 46 on Information and Documentation set up a working party to investigate adapting the British system for international use.[1] The ISBN was approved as ISO standard 2108 in 1970.[1]

The original standard was revised in 1978, 1992 and 2005.[1] Over those revisions the original 10-digit ISBN was extended to 13 digits.[1] ISBNs were 10 digits in length up to the end of December 2006, and since 1 January 2007 they always consist of 13 digits.[2] The fifth and latest edition of the ISBN Standard was published in December 2017.[3] ISO has appointed the International ISBN Agency to act as the global registration authority for the ISBN Standard and system.[4]

A 13-digit ISBN has five elements: a prefix, a registration group element, a registrant element, a publication element and a check digit.[2] The prefix is a three-digit number made available by GS1, formerly EAN International.[1] Prefixes that have already been made available by GS1 are 978 and 979.[1] The registration group element identifies a country, geographical region or language area, and may comprise up to 5 digits.[1] The registrant element identifies a particular publisher or imprint, and may comprise up to 7 digits.[1] Publishers with the largest expected title outputs are assigned the shortest registrant elements.[1] The publication element identifies a specific edition of a publication by a specific publisher, and may comprise up to 6 digits.[1] The ISBN-13 check digit is calculated using a modulus 10 system with alternate weights of 1 and 3.[2] The ISBN-10 check digit ranges from 0 to 10, and the symbol X is used for 10.[5]

Use

An ISBN is a product identifier used by publishers, booksellers, libraries, internet retailers and other supply chain participants for ordering, listing, sales records and stock control.[2] Each different product form of a book, such as paperback, EPUB or .pdf, should be identified separately.[2] So an ISBN column identifies editions and formats, not works: expect several ISBNs for one title, and group on something else if you want to count books. (Meridian's view) Once assigned, an ISBN can never be reused to identify another monographic publication, even if it was assigned in error.[1] Occasionally, publishers erroneously assign an ISBN to more than one title.[5] Treat an ISBN as a strong hint about a book rather than a guaranteed unique key, and check the title alongside it when a join matters. (Meridian's view)

The use of hyphens or spaces has no lexical significance and is purely to enhance readability.[1] In MARC 21 bibliographic records, field 020 holds the ISBN, and the embedded hyphens are not carried in the record.[6] MARC 21 keeps a cancelled or invalid ISBN in a separate subfield, $z, apart from the valid ISBN in $a.[6] Strip hyphens, spaces and any leading ISBN label before comparing values, and store the bare digits as text so leading zeros and a trailing X survive. (Meridian's view)

A 10-digit ISBN is converted to a 13-digit ISBN by prepending 978 and recalculating the check digit with the ISBN-13 algorithm.[5] ISBNs beginning with a prefix other than 978, currently only 979, have no 10-digit equivalent.[5] When a file mixes both lengths, convert everything to ISBN-13 before joining, since that direction always works. (Meridian's view) The ISBN is machine-readable in the form of a 13-digit EAN-13 bar code.[1] The ISBN is now fully compatible with GTIN-13.[1] That compatibility means a 13-digit ISBN can sit in a column of retail barcode numbers looking no different from them, so look at the prefix before treating a value as a book. (Meridian's view) Verify the check digit before trusting a column of 10- or 13-digit numbers as ISBNs, since other long numeric identifiers share the same lengths. (Meridian's view)

Where you'll meet it

Open Library's ISBN API looks up a book by a path of /isbn followed by a valid ISBN 10 or 13.[7] Open Library's legacy Books API returns an identifiers object with isbn_10 and isbn_13 arrays.[7]

Detection notes

v1 migration: Was code.isbn. Pattern accepts ISBN-10 and ISBN-13 with or without hyphens. Decompose infers version based on length. The `checksum: isbn` directive drives the model's checksum_substance_guard, which demotes a column of same-length integers that fail the ISBN check digit (e.g. a financial figure like marketCap) off the isbn label.

Use it

CLI · DuckDB
$ finetype infer -i "978-0-13-110362-7" --mode column
→ identity.commerce.isbn

SELECT ft_infer('978-0-13-110362-7');
-- → 'identity.commerce.isbn'
Cast expression
CAST({col} AS VARCHAR)

Schema

https://meridian.online/schemas/identity.commerce.isbn · Frictionless type string

finetype taxonomy identity.commerce.isbn -o json-schema

Type Registry