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.

Domain
identity
Category
commerce
Casts to
VARCHAR
Scope
Universal

Try it

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

DuckDB

Detect
SELECT finetype('978-0-13-110362-7');
-- → 'identity.commerce.isbn'
Cast expression
CAST({col} AS VARCHAR)
Safe cast pipeline
-- Normalise and cast in one step
SELECT TRY_CAST(finetype_cast(my_column) AS VARCHAR) AS clean_value
FROM my_table
WHERE finetype(my_column) = 'identity.commerce.isbn';

Struct Expansion

Expression
isbn_version: CASE WHEN LENGTH(REGEXP_REPLACE({col}, '-', '')) = 10 THEN 'ISBN-10' ELSE 'ISBN-13' END

JSON Schema

finetype schema identity.commerce.isbn
{
  "$id": "https://meridian.online/schemas/identity.commerce.isbn",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "International Standard Book Number. ISBN-10 (10 digits with check digit) or ISBN-13 (13 digits with check digit). Also accepts with hyphens.",
  "examples": [
    "978-0-13-110362-7",
    "0-13-110362-9",
    "9780131103627"
  ],
  "pattern": "^(?: 97[89]-)?[0-9]{1,5}-[0-9]+-[0-9]+-[0-9X]$|^[0-9]{9}[0-9X]$|^[0-9]{13}$",
  "title": "ISBN",
  "type": "string",
  "x-finetype-broad-type": "VARCHAR",
  "x-finetype-transform": "CAST({col} AS VARCHAR)"
}

Examples

978-0-13-110362-70-13-110362-99780131103627