@the_library/canonical-schemas 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +669 -29
- package/README.md +205 -338
- package/THIRD_PARTY_NOTICES +3 -0
- package/definitions/canonical/Book.json +12 -5
- package/definitions/canonical/Person.json +1 -1
- package/governance/changelog.md +0 -12
- package/package.json +12 -3
- package/types/StandardAdapter.ts +3 -94
- package/types/StandardDefinition.ts +3 -94
- package/uid-documentation.md +305 -0
|
@@ -218,18 +218,25 @@
|
|
|
218
218
|
}
|
|
219
219
|
],
|
|
220
220
|
"translations": {
|
|
221
|
-
"
|
|
221
|
+
"fra": {
|
|
222
222
|
"className": "Livre",
|
|
223
223
|
"props": {
|
|
224
224
|
"title": "titre",
|
|
225
225
|
"description": "description"
|
|
226
226
|
}
|
|
227
227
|
},
|
|
228
|
-
"
|
|
229
|
-
"className": "
|
|
228
|
+
"zho": {
|
|
229
|
+
"className": "书",
|
|
230
230
|
"props": {
|
|
231
|
-
"title": "
|
|
232
|
-
"description": "
|
|
231
|
+
"title": "标题",
|
|
232
|
+
"description": "描述"
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"tha": {
|
|
236
|
+
"className": "หนังสือ",
|
|
237
|
+
"props": {
|
|
238
|
+
"title": "ชื่อ",
|
|
239
|
+
"description": "คำอธิบาย"
|
|
233
240
|
}
|
|
234
241
|
}
|
|
235
242
|
}
|
package/governance/changelog.md
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
-
|
|
3
|
-
## v1.0.0 — 2026-06-20
|
|
4
|
-
|
|
5
|
-
Initial release.
|
|
6
|
-
|
|
7
|
-
**Standards included:** isbn (ISO 2108:2017), issn (ISO 3297:2007),
|
|
8
|
-
isni (ISO 27729:2012), orcid, ddc.
|
|
9
|
-
|
|
10
|
-
**Canonical models:** Book, Person, Tag, CopyrightStatus, QualityScore.
|
|
11
|
-
|
|
12
|
-
**Approved by:** DataPond core team.
|
|
13
|
-
**Deferred:** doi, lcnaf (see §8.2 of canonical_schemas_package_spec.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@the_library/canonical-schemas",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"exports": {
|
|
6
7
|
"./types/StandardAdapter": {
|
|
@@ -16,8 +17,16 @@
|
|
|
16
17
|
"./schemas/StandardDefinition/1.0": "./schemas/StandardDefinition.1.0.json",
|
|
17
18
|
"./package.json": "./package.json"
|
|
18
19
|
},
|
|
19
|
-
"files": [
|
|
20
|
+
"files": [
|
|
21
|
+
"types",
|
|
22
|
+
"standards",
|
|
23
|
+
"definitions",
|
|
24
|
+
"schemas",
|
|
25
|
+
"governance",
|
|
26
|
+
"uid-documentation.md",
|
|
27
|
+
"THIRD_PARTY_NOTICES"
|
|
28
|
+
],
|
|
20
29
|
"devDependencies": {
|
|
21
30
|
"typescript": "^6.0.3"
|
|
22
31
|
}
|
|
23
|
-
}
|
|
32
|
+
}
|
package/types/StandardAdapter.ts
CHANGED
|
@@ -1,98 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* COPYRIGHT: © [Year] DATAPOND PUBLIC LIBRARY TRUST - Australia
|
|
6
|
-
* TECHNICAL GUARDIAN: POND ENTERPRISE PTY LTD - Australia
|
|
7
|
-
*
|
|
8
|
-
* 1. PREAMBLE & DEFINITIONS
|
|
9
|
-
* a. "The Software": The source code, binaries, data models, and Web3 utilities
|
|
10
|
-
* provided herein.
|
|
11
|
-
* b. "Modification": Includes, but is not limited to, altering source files,
|
|
12
|
-
* runtime memory manipulation (monkey-patching), API proxying, network
|
|
13
|
-
* redirection, or any dynamic attempt to bypass hard-coded configurations.
|
|
14
|
-
* c. "The Trust": DataPond Public Library Trust.
|
|
15
|
-
* d. "The Guardian": Pond Enterprise Pty Ltd.
|
|
16
|
-
*
|
|
17
|
-
* 2. STIPULATION OF SYSTEMIC RISK & VALUATION
|
|
18
|
-
* You acknowledge that The Software is not a standalone application, but an
|
|
19
|
-
* inseparable interface to a shared Web3 data infrastructure and curated smart
|
|
20
|
-
* contract ecosystem. The parties unconditionally agree the fundamental value of
|
|
21
|
-
* this ecosystem is $50,000,000.00 USD. You explicitly acknowledge that:
|
|
22
|
-
* a. Liability Anchor: The Trust and The Guardian assume third-party liability
|
|
23
|
-
* based STRICTLY AND SOLELY upon the unaltered, hard-coded Smart Contract
|
|
24
|
-
* addresses and Canonical Config endpoints. Any Modification to these anchors
|
|
25
|
-
* fraudulently exposes the creators to catastrophic criminal and civil liability.
|
|
26
|
-
* b. Network Integrity: The Web3 data model utilizes a shared state. Any
|
|
27
|
-
* Modification of the data model or redirection to private, centralized
|
|
28
|
-
* databases (forking) threatens irreversible data corruption across the entire
|
|
29
|
-
* decentralized ecosystem, inherently destroying the $50,000,000.00 asset.
|
|
30
|
-
*
|
|
31
|
-
* 3. CONDITIONAL GRANT OF RIGHTS & OFFLINE RESILIENCE
|
|
32
|
-
* Subject to strict compliance with all terms herein, The Trust grants you a
|
|
33
|
-
* worldwide, royalty-free, non-exclusive license to view, copy, use, and
|
|
34
|
-
* distribute The Software. This includes the right to deploy certified static
|
|
35
|
-
* "Snapshots" in 100% offline environments.
|
|
36
|
-
*
|
|
37
|
-
* 4. STRICT TECHNICAL ANCHORS (ANTI-FORK / ANTI-PROXY)
|
|
38
|
-
* You are expressly PROHIBITED from executing any Modification (as defined in
|
|
39
|
-
* Section 1b) to The Software. The Software must utilize the exact Smart Contract
|
|
40
|
-
* addresses and Canonical Config endpoints as originally distributed.
|
|
41
|
-
*
|
|
42
|
-
* 5. D-SAFE INTEGRITY & CONTENT RULES
|
|
43
|
-
* Any implementation utilizing The Software must adhere to the D-SAFE Specification
|
|
44
|
-
* (strictly Decentralized, Integral [zero paywalls/ads], and Common [CC BY-NC-ND]).
|
|
45
|
-
* Furthermore, the network utilizing The Software must be entirely free from:
|
|
46
|
-
* (i) Ecological Harm; (ii) Explicit Content or Violence; (iii) IP Infringement;
|
|
47
|
-
* (iv) Political Campaigning; (v) Spiritual Proselytization; (vi) Historiographical
|
|
48
|
-
* Disputes; (vii) Medical Advice; (viii) Works of Fiction; (ix) Psychological
|
|
49
|
-
* Profiling.
|
|
50
|
-
* SOLE DISCRETION: The Trust and The Guardian reserve the sole, absolute, and
|
|
51
|
-
* unchallengeable discretion to determine whether any content or implementation
|
|
52
|
-
* violates the D-SAFE rules outlined in this Section 5.
|
|
53
|
-
*
|
|
54
|
-
* 6. THE "KUKRI" LIABILITY SHIELD & AUTOMATIC REVOCATION
|
|
55
|
-
* a. Trust Sanctuary: The Trust provides The Software "AS IS" and holds ZERO
|
|
56
|
-
* LIABILITY for any damages, gas fees, or data loss.
|
|
57
|
-
* b. Guardian Direction: Claims regarding technical performance or professional
|
|
58
|
-
* indemnity must be directed exclusively to The Guardian.
|
|
59
|
-
* c. User Indemnity: You agree to indemnify and hold harmless The Trust and The
|
|
60
|
-
* Guardian against any and all claims arising from your use of The Software.
|
|
61
|
-
* d. SHIELD REVOCATION: The liability protections of Section 6a and 6b are
|
|
62
|
-
* strictly contingent upon your absolute compliance with Section 5 (D-SAFE).
|
|
63
|
-
* If The Trust or The Guardian determines, in their sole discretion, that you
|
|
64
|
-
* have violated Section 5, ALL LIABILITY PROTECTIONS ARE IMMEDIATELY AND
|
|
65
|
-
* AUTOMATICALLY REVOKED. You shall assume full personal and corporate
|
|
66
|
-
* liability for your implementation.
|
|
67
|
-
*
|
|
68
|
-
* 7. BREACH, CURE PERIOD, AND LIQUIDATED DAMAGES
|
|
69
|
-
* a. Content Breach (Section 5): For violations of Section 5, your liability shield
|
|
70
|
-
* drops immediately. You will be provided thirty (30) days notice to cure the
|
|
71
|
-
* breach. Failure to cure results in permanent revocation of this License.
|
|
72
|
-
* b. Technical Breach (Section 4 - The $50M Trigger): Any violation of Section 4
|
|
73
|
-
* (Modification) is an uncurable, material breach. Due to the catastrophic
|
|
74
|
-
* systemic risks outlined in Section 2, actual damages are impossible to
|
|
75
|
-
* calculate. You explicitly agree that a Technical Breach shall immediately
|
|
76
|
-
* result in you paying The Trust Liquidated Damages (and not a penalty) in the
|
|
77
|
-
* amount of $50,000,000.00 USD, OR the total gross revenue generated by your
|
|
78
|
-
* unauthorized use (including revenue generated by parent companies, affiliates,
|
|
79
|
-
* and subsidiaries utilizing the modified implementation), whichever is greater.
|
|
80
|
-
*
|
|
81
|
-
* 8. GOVERNING LAW, ARBITRATION, AND INJUNCTIVE RELIEF
|
|
82
|
-
* This License shall be governed by the laws of the State of Victoria, Australia.
|
|
83
|
-
* Any dispute shall be finally resolved by arbitration under the ACICA Rules.
|
|
84
|
-
* The seat of arbitration shall be Melbourne, Australia. The prevailing party
|
|
85
|
-
* shall recover reasonable attorneys' fees. You acknowledge that a Technical
|
|
86
|
-
* Breach will cause irreparable harm, entitling The Trust to immediate injunctive
|
|
87
|
-
* relief in any competent court worldwide. You expressly waive any legal
|
|
88
|
-
* requirement for The Trust to secure or post any bond in connection with such
|
|
89
|
-
* injunctive relief.
|
|
90
|
-
*
|
|
91
|
-
* 9. SEVERABILITY
|
|
92
|
-
* If any provision of this License is held invalid by a tribunal of competent
|
|
93
|
-
* jurisdiction, such provision shall be reformed only to the extent necessary
|
|
94
|
-
* to make it enforceable, and the remaining provisions shall remain in full force.
|
|
95
|
-
* ==============================================================================
|
|
2
|
+
* D-Open Code Sovereign Licence 1.1 · © 2026 Antoine LUCAS · SPDX-License-Identifier: LicenseRef-DOCSL-1.1
|
|
3
|
+
* Non-commercial use of unmodified copies only. By using this file you accept the Licence, incl. USD 50M liquidated damages (s 16.4).
|
|
4
|
+
* Full text: https://registry.worldbibliotech.com/licence and the LICENSE file · Contact: admin@pondenterprise.com
|
|
96
5
|
*/
|
|
97
6
|
|
|
98
7
|
export interface ValidationResult {
|
|
@@ -1,98 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* COPYRIGHT: © [Year] DATAPOND PUBLIC LIBRARY TRUST - Australia
|
|
6
|
-
* TECHNICAL GUARDIAN: POND ENTERPRISE PTY LTD - Australia
|
|
7
|
-
*
|
|
8
|
-
* 1. PREAMBLE & DEFINITIONS
|
|
9
|
-
* a. "The Software": The source code, binaries, data models, and Web3 utilities
|
|
10
|
-
* provided herein.
|
|
11
|
-
* b. "Modification": Includes, but is not limited to, altering source files,
|
|
12
|
-
* runtime memory manipulation (monkey-patching), API proxying, network
|
|
13
|
-
* redirection, or any dynamic attempt to bypass hard-coded configurations.
|
|
14
|
-
* c. "The Trust": DataPond Public Library Trust.
|
|
15
|
-
* d. "The Guardian": Pond Enterprise Pty Ltd.
|
|
16
|
-
*
|
|
17
|
-
* 2. STIPULATION OF SYSTEMIC RISK & VALUATION
|
|
18
|
-
* You acknowledge that The Software is not a standalone application, but an
|
|
19
|
-
* inseparable interface to a shared Web3 data infrastructure and curated smart
|
|
20
|
-
* contract ecosystem. The parties unconditionally agree the fundamental value of
|
|
21
|
-
* this ecosystem is $50,000,000.00 USD. You explicitly acknowledge that:
|
|
22
|
-
* a. Liability Anchor: The Trust and The Guardian assume third-party liability
|
|
23
|
-
* based STRICTLY AND SOLELY upon the unaltered, hard-coded Smart Contract
|
|
24
|
-
* addresses and Canonical Config endpoints. Any Modification to these anchors
|
|
25
|
-
* fraudulently exposes the creators to catastrophic criminal and civil liability.
|
|
26
|
-
* b. Network Integrity: The Web3 data model utilizes a shared state. Any
|
|
27
|
-
* Modification of the data model or redirection to private, centralized
|
|
28
|
-
* databases (forking) threatens irreversible data corruption across the entire
|
|
29
|
-
* decentralized ecosystem, inherently destroying the $50,000,000.00 asset.
|
|
30
|
-
*
|
|
31
|
-
* 3. CONDITIONAL GRANT OF RIGHTS & OFFLINE RESILIENCE
|
|
32
|
-
* Subject to strict compliance with all terms herein, The Trust grants you a
|
|
33
|
-
* worldwide, royalty-free, non-exclusive license to view, copy, use, and
|
|
34
|
-
* distribute The Software. This includes the right to deploy certified static
|
|
35
|
-
* "Snapshots" in 100% offline environments.
|
|
36
|
-
*
|
|
37
|
-
* 4. STRICT TECHNICAL ANCHORS (ANTI-FORK / ANTI-PROXY)
|
|
38
|
-
* You are expressly PROHIBITED from executing any Modification (as defined in
|
|
39
|
-
* Section 1b) to The Software. The Software must utilize the exact Smart Contract
|
|
40
|
-
* addresses and Canonical Config endpoints as originally distributed.
|
|
41
|
-
*
|
|
42
|
-
* 5. D-SAFE INTEGRITY & CONTENT RULES
|
|
43
|
-
* Any implementation utilizing The Software must adhere to the D-SAFE Specification
|
|
44
|
-
* (strictly Decentralized, Integral [zero paywalls/ads], and Common [CC BY-NC-ND]).
|
|
45
|
-
* Furthermore, the network utilizing The Software must be entirely free from:
|
|
46
|
-
* (i) Ecological Harm; (ii) Explicit Content or Violence; (iii) IP Infringement;
|
|
47
|
-
* (iv) Political Campaigning; (v) Spiritual Proselytization; (vi) Historiographical
|
|
48
|
-
* Disputes; (vii) Medical Advice; (viii) Works of Fiction; (ix) Psychological
|
|
49
|
-
* Profiling.
|
|
50
|
-
* SOLE DISCRETION: The Trust and The Guardian reserve the sole, absolute, and
|
|
51
|
-
* unchallengeable discretion to determine whether any content or implementation
|
|
52
|
-
* violates the D-SAFE rules outlined in this Section 5.
|
|
53
|
-
*
|
|
54
|
-
* 6. THE "KUKRI" LIABILITY SHIELD & AUTOMATIC REVOCATION
|
|
55
|
-
* a. Trust Sanctuary: The Trust provides The Software "AS IS" and holds ZERO
|
|
56
|
-
* LIABILITY for any damages, gas fees, or data loss.
|
|
57
|
-
* b. Guardian Direction: Claims regarding technical performance or professional
|
|
58
|
-
* indemnity must be directed exclusively to The Guardian.
|
|
59
|
-
* c. User Indemnity: You agree to indemnify and hold harmless The Trust and The
|
|
60
|
-
* Guardian against any and all claims arising from your use of The Software.
|
|
61
|
-
* d. SHIELD REVOCATION: The liability protections of Section 6a and 6b are
|
|
62
|
-
* strictly contingent upon your absolute compliance with Section 5 (D-SAFE).
|
|
63
|
-
* If The Trust or The Guardian determines, in their sole discretion, that you
|
|
64
|
-
* have violated Section 5, ALL LIABILITY PROTECTIONS ARE IMMEDIATELY AND
|
|
65
|
-
* AUTOMATICALLY REVOKED. You shall assume full personal and corporate
|
|
66
|
-
* liability for your implementation.
|
|
67
|
-
*
|
|
68
|
-
* 7. BREACH, CURE PERIOD, AND LIQUIDATED DAMAGES
|
|
69
|
-
* a. Content Breach (Section 5): For violations of Section 5, your liability shield
|
|
70
|
-
* drops immediately. You will be provided thirty (30) days notice to cure the
|
|
71
|
-
* breach. Failure to cure results in permanent revocation of this License.
|
|
72
|
-
* b. Technical Breach (Section 4 - The $50M Trigger): Any violation of Section 4
|
|
73
|
-
* (Modification) is an uncurable, material breach. Due to the catastrophic
|
|
74
|
-
* systemic risks outlined in Section 2, actual damages are impossible to
|
|
75
|
-
* calculate. You explicitly agree that a Technical Breach shall immediately
|
|
76
|
-
* result in you paying The Trust Liquidated Damages (and not a penalty) in the
|
|
77
|
-
* amount of $50,000,000.00 USD, OR the total gross revenue generated by your
|
|
78
|
-
* unauthorized use (including revenue generated by parent companies, affiliates,
|
|
79
|
-
* and subsidiaries utilizing the modified implementation), whichever is greater.
|
|
80
|
-
*
|
|
81
|
-
* 8. GOVERNING LAW, ARBITRATION, AND INJUNCTIVE RELIEF
|
|
82
|
-
* This License shall be governed by the laws of the State of Victoria, Australia.
|
|
83
|
-
* Any dispute shall be finally resolved by arbitration under the ACICA Rules.
|
|
84
|
-
* The seat of arbitration shall be Melbourne, Australia. The prevailing party
|
|
85
|
-
* shall recover reasonable attorneys' fees. You acknowledge that a Technical
|
|
86
|
-
* Breach will cause irreparable harm, entitling The Trust to immediate injunctive
|
|
87
|
-
* relief in any competent court worldwide. You expressly waive any legal
|
|
88
|
-
* requirement for The Trust to secure or post any bond in connection with such
|
|
89
|
-
* injunctive relief.
|
|
90
|
-
*
|
|
91
|
-
* 9. SEVERABILITY
|
|
92
|
-
* If any provision of this License is held invalid by a tribunal of competent
|
|
93
|
-
* jurisdiction, such provision shall be reformed only to the extent necessary
|
|
94
|
-
* to make it enforceable, and the remaining provisions shall remain in full force.
|
|
95
|
-
* ==============================================================================
|
|
2
|
+
* D-Open Code Sovereign Licence 1.1 · © 2026 Antoine LUCAS · SPDX-License-Identifier: LicenseRef-DOCSL-1.1
|
|
3
|
+
* Non-commercial use of unmodified copies only. By using this file you accept the Licence, incl. USD 50M liquidated damages (s 16.4).
|
|
4
|
+
* Full text: https://registry.worldbibliotech.com/licence and the LICENSE file · Contact: admin@pondenterprise.com
|
|
96
5
|
*/
|
|
97
6
|
|
|
98
7
|
export interface StandardProp {
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
# D-Library UID System — Developer & Librarian Reference
|
|
2
|
+
|
|
3
|
+
This document explains how every record in the D-Library is identified: what the numbers and letters in an ID mean, when each format is used, and why the system works the way it does.
|
|
4
|
+
|
|
5
|
+
Every example ID below was generated by the model classes of `@the_library/public`.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Why there are multiple ID formats
|
|
10
|
+
|
|
11
|
+
Every entity (Book, Person, Tag, …) in the D-Library has **three representations of the same underlying identity**. They all refer to the same record — they are not three different IDs, they are three views of one number.
|
|
12
|
+
|
|
13
|
+
| Layer | Example | Stored? | Human-readable? |
|
|
14
|
+
|---|---|---|---|
|
|
15
|
+
| **wireId** | `4740` | Yes — inside binary data | No |
|
|
16
|
+
| **base-34 body** | `000000000043E` | No — computed on demand | Partially |
|
|
17
|
+
| **SFCUID** | `DL:C:BK:BK000000000043E1` | No — computed on demand | Yes |
|
|
18
|
+
|
|
19
|
+
The wireId is the only thing stored on-chain and in Arweave sidecars. Everything else is derived from it when needed. This means IDs never take up permanent storage beyond the wireId integer itself.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 2. The wireId — the permanent anchor
|
|
24
|
+
|
|
25
|
+
The **wireId** is a 64-bit unsigned integer (a `bigint` in the SDK), assigned when the record is created. It never changes, never moves, and can never be reassigned.
|
|
26
|
+
|
|
27
|
+
- **Canonical entities** (librarian-created): bit 63 is `0`.
|
|
28
|
+
- **User-created entities**: bit 63 is `1` (`0x8000000000000000` and above).
|
|
29
|
+
|
|
30
|
+
The wireId itself is never shown to users. It is only used internally in the binary codec, sidecar files, and on-chain records.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 3. The base-34 encoding
|
|
35
|
+
|
|
36
|
+
To convert a wireId into something human-readable, it is encoded in **base-34**.
|
|
37
|
+
|
|
38
|
+
**Base-34 alphabet:** `0123456789ABCDEFGHJKLMNPQRSTUVWXYZ`
|
|
39
|
+
|
|
40
|
+
That is digits 0–9, plus all uppercase letters A–Z, **except I and O** (removed to prevent confusion with 1 and 0 when handwritten or read aloud).
|
|
41
|
+
|
|
42
|
+
The wireId is encoded as a **13-character base-34 string**, zero-padded on the left. 13 is the shortest width that fits every 64-bit value (34^13 ≈ 8.1 × 10^19 ≥ 2^64 ≈ 1.8 × 10^19).
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
wireId 4740 → 000000000043E
|
|
46
|
+
wireId 847 → 00000000000QX
|
|
47
|
+
wireId 812 → 00000000000PW
|
|
48
|
+
wireId 510 → 00000000000F0
|
|
49
|
+
wireId 1 → 0000000000001
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Legacy IDs.** PIDs minted before the 64-bit widening have a 7-character body (e.g. `000043E`). They still decode: the decoder accepts both lengths and checks the check character against the body as it was minted. New IDs are always written with 13 characters.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 4. The three SFCUID modes
|
|
57
|
+
|
|
58
|
+
**SFCUID** stands for *Standards-First Canonical UID*. Every entity has at least one SFCUID — it is the human-readable identifier used in links, exports, and display.
|
|
59
|
+
|
|
60
|
+
There are three modes. Which mode is used depends on whether the entity maps to an external standard (like ISBN or ISNI).
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
### 4.1 Mode N — Native D-Library identifier
|
|
65
|
+
|
|
66
|
+
Mode N is the **permanent anchor** identifier. Every entity with a type prefix gets one, regardless of whether it has an external standard. It is always available and always decodes to a wireId without any network call.
|
|
67
|
+
|
|
68
|
+
**Format:**
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
DL : {scope} : {typePrefix} : {bare PID}
|
|
72
|
+
|
|
73
|
+
bare PID = {typePrefix}{13-char base-34 body}{check character}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The type prefix appears twice: once as a readable segment, and once inside the bare PID, which is a self-contained ID on its own (§5).
|
|
77
|
+
|
|
78
|
+
**Position-by-position breakdown:**
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
D L : C : B K : B K 0 0 0 0 0 0 0 0 0 4 3 E 1
|
|
82
|
+
│ │ │ └─┘ └─┘ └───────────────────────┘ │
|
|
83
|
+
│ │ │ type type 13-char base-34 body check
|
|
84
|
+
│ │ │ prefix (wireId in base-34) character
|
|
85
|
+
│ │ │
|
|
86
|
+
│ │ scope:
|
|
87
|
+
│ │ C = Canonical (librarian-assigned)
|
|
88
|
+
│ │ U = User-created
|
|
89
|
+
│ │
|
|
90
|
+
│ └─ "L" — Library
|
|
91
|
+
└─── "D" — DataPond namespace
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Examples:**
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
DL:C:BK:BK000000000043E1 — Canonical Book, wireId 4740
|
|
98
|
+
DL:C:PR:PR00000000000PW6 — Canonical Person, wireId 812
|
|
99
|
+
DL:C:TG:TG00000000000F0F — Canonical Tag, wireId 510
|
|
100
|
+
DL:C:PO:PO00000000000QXG — Canonical Post, wireId 847
|
|
101
|
+
DL:U:BK:BK3VDVL1X8K6VRTW — User-created Book, wireId 0x8000000000000001
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
#### 4.1.1 The scope character (C vs U)
|
|
105
|
+
|
|
106
|
+
| Scope | Meaning | wireId |
|
|
107
|
+
|---|---|---|
|
|
108
|
+
| `C` | **Canonical** — created by a librarian via the official pipeline | bit 63 = 0 |
|
|
109
|
+
| `U` | **User-created** — created by an end user in their personal library | bit 63 = 1 |
|
|
110
|
+
|
|
111
|
+
Both scopes use the same encoding and decoding rules.
|
|
112
|
+
|
|
113
|
+
#### 4.1.2 Type prefix table
|
|
114
|
+
|
|
115
|
+
The two-character type prefix comes from each model's `typePrefix` in `definitions/canonical/`:
|
|
116
|
+
|
|
117
|
+
| Prefix | Entity | Description |
|
|
118
|
+
|---|---|---|
|
|
119
|
+
| `BK` | Book | A bibliographic Work. One Book may have many editions (its instances). |
|
|
120
|
+
| `PR` | Person | An author, editor, illustrator, or other named contributor. |
|
|
121
|
+
| `TG` | Tag | A subject classification, topic, or collection tag. |
|
|
122
|
+
| `CS` | ClassificationSystem | A classification scheme a Tag belongs to. |
|
|
123
|
+
| `PO` | Post | A discussion post. |
|
|
124
|
+
|
|
125
|
+
A Book's editions (instances) have no prefix and no Mode N ID of their own: an edition is identified through Mode S (its ISBN) or Mode DERIVED (§4.3).
|
|
126
|
+
|
|
127
|
+
#### 4.1.3 The check character
|
|
128
|
+
|
|
129
|
+
The final character of the bare PID is a check character computed using **ISO 7064 MOD 37-2** over the type prefix plus the body. Its purpose is to catch transcription errors — if a single character is wrong or two adjacent characters are swapped, the check character will not validate.
|
|
130
|
+
|
|
131
|
+
The check character is drawn from the 37-character set `0–9 A–Z *`, where `*` is output as `X`. Because the base-34 body excludes `I` and `O`, there is a disambiguation rule: if the computed check character is `I`, emit `J`; if it is `O`, emit `P`.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
### 4.2 Mode S — Standard-backed identifier
|
|
136
|
+
|
|
137
|
+
Mode S is used when an entity maps directly to an **external bibliographic standard** — a number like an ISBN, ISNI, ORCID, or a classification notation. Mode S is the **preferred display identity** for these entities.
|
|
138
|
+
|
|
139
|
+
**Format:**
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
{standardId}:{normalizedValue}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
The `standardId` is always **lowercase** (the `id` field from the standard's definition file), and the value is the standard adapter's normalized form.
|
|
146
|
+
|
|
147
|
+
**Examples:**
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
isbn:9780262033848 — a Book edition identified by its ISBN-13
|
|
151
|
+
isni:0000000121032683 — a Person identified by their ISNI
|
|
152
|
+
orcid:0000-0002-1825-0097 — a Person identified by their ORCID
|
|
153
|
+
ddc:510 — a Tag carrying DDC class 510 (Mathematics)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**What "standards-backed" means in practice:**
|
|
157
|
+
|
|
158
|
+
- For a **Book**, the ISBN identifies a specific edition, not the Work itself. The Work is always Mode N.
|
|
159
|
+
- For a **Person**, ISNI is tried first, then ORCID.
|
|
160
|
+
- For a **Tag**, the classification standards are tried in this order: `lcc`, `ddc`, `udc`, `clc`, `bbk`, `tlc`, `cc`. The first notation that is set is used; a Tag with none falls back to Mode N.
|
|
161
|
+
|
|
162
|
+
**Important:** `isbn:` (lowercase) is the identifier form. The uppercase `ISBN:` prefix (as in each standard's `uriScheme`, `ISBN:{{isbn}}`) is the export form. These are two different contexts — do not mix them.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
### 4.3 Mode DERIVED — Non-default instances
|
|
167
|
+
|
|
168
|
+
Mode DERIVED is used for Book editions that were created from a standards-backed source but are not the original edition — for example, an AI translation or a specific scan of a book that already has an ISBN.
|
|
169
|
+
|
|
170
|
+
**Format:**
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
DL:C:DERIVED:{sourceSFCUID}:{discriminatorValues}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Examples:**
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
DL:C:DERIVED:isbn:9780262033848:gemini-eng — Gemini English translation of that ISBN
|
|
180
|
+
DL:C:DERIVED:isbn:9780262033848:claude-fra — Claude French translation of that same book
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
The `discriminatorValues` are the values of the instance's `identityComponent` fields, in their declaration order, each URI-encoded and joined with `:`. In the Book model, `language` is the identity component.
|
|
184
|
+
|
|
185
|
+
Resolving a Mode DERIVED ID needs the ExternalIdCrosswalk worker to be ready (§8.3).
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## 5. The bare PID vs Mode N SFCUID vs Linked Data URI
|
|
190
|
+
|
|
191
|
+
These three look similar but are used in different contexts:
|
|
192
|
+
|
|
193
|
+
| Form | Example | Used for |
|
|
194
|
+
|---|---|---|
|
|
195
|
+
| **Bare PID** | `BK000000000043E1` | Compact storage reference, MARC field 001, internal cross-references |
|
|
196
|
+
| **Mode N SFCUID** | `DL:C:BK:BK000000000043E1` | Display, sharing, links, the `toPID()` return value |
|
|
197
|
+
| **Linked Data URI** (planned) | `https://datapond.earth/id/book/BK000000000043E1` | RDF/JSON-LD export, semantic web interoperability |
|
|
198
|
+
|
|
199
|
+
The bare PID is the Mode N SFCUID without the `DL:{scope}:{typePrefix}:` prefix. The Linked Data URI wraps the bare PID in a dereferenceable HTTPS URL under `datapond.earth/id/`.
|
|
200
|
+
|
|
201
|
+
The Linked Data URIs are **not served yet**. The planned content negotiation is:
|
|
202
|
+
- `application/ld+json` → JSON-LD (schema.org + BIBO + D-Library vocabulary)
|
|
203
|
+
- `text/turtle` → RDF/Turtle
|
|
204
|
+
- `application/xml` → MARCXML
|
|
205
|
+
- `text/html` → human-readable record page (default)
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## 6. Which identifier is canonical for each entity
|
|
210
|
+
|
|
211
|
+
| Entity | Strategy | Preferred form | Fallback |
|
|
212
|
+
|---|---|---|---|
|
|
213
|
+
| Book (Work) | `uidStrategy: "native-only"` | `DL:C:BK:BK{body}{check}` | — (Mode N always) |
|
|
214
|
+
| Book edition (instance) | `instanceUidStrategy: ["isbn"]` | `isbn:9780262033848` | Mode DERIVED |
|
|
215
|
+
| Person | `uidStrategy: ["isni", "orcid"]` | `isni:0000000121032683` | `DL:C:PR:PR{body}{check}` |
|
|
216
|
+
| Tag | `uidStrategy: ["lcc", "ddc", "udc", "clc", "bbk", "tlc", "cc"]` | e.g. `ddc:510` | `DL:C:TG:TG{body}{check}` |
|
|
217
|
+
| ClassificationSystem, Post | — / `"native-only"` | Mode N | — |
|
|
218
|
+
|
|
219
|
+
A Book is always Mode N — ISBN identifies an *edition*, not the Work itself. A single Work can have many editions, each with its own ISBN.
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## 7. For librarians: what this means in practice
|
|
224
|
+
|
|
225
|
+
**When you see an identifier**, you can decode it immediately:
|
|
226
|
+
|
|
227
|
+
- `DL:C:BK:BK000000000043E1` → a canonical Book, wireId 4740. The `BK` tells you it's a Book (Work); `C` tells you it was assigned by a librarian.
|
|
228
|
+
- `isbn:9780262033848` → a specific edition identified by its ISBN. The system looks up which Book it belongs to automatically.
|
|
229
|
+
- `isni:0000000121032683` → a Person whose ISNI is `0000000121032683`.
|
|
230
|
+
- `ddc:510` → the Tag representing DDC class 510 (Mathematics).
|
|
231
|
+
|
|
232
|
+
**In the World Library today**, the live library at [worldbibliotech.com](https://worldbibliotech.com) doesn't put PIDs or SFCUIDs in its links yet. Its pages address records by wireId, with hash routing:
|
|
233
|
+
|
|
234
|
+
- `https://worldbibliotech.com/#/read/4740` — Book 4740
|
|
235
|
+
- `https://worldbibliotech.com/#/topic/510` and `https://worldbibliotech.com/#/bookList/510` — Tag 510
|
|
236
|
+
|
|
237
|
+
The identifiers in this document are what the model classes produce and resolve (`toPID()`, `fromPID()`, `Book.LoadInstance()`), for sharing, export and catalogue use.
|
|
238
|
+
|
|
239
|
+
**When a book has no ISBN** (for example, a handwritten manuscript digitized without a commercial edition), its edition gets a Mode DERIVED ID based on the Book's native ID plus its language, such as `DL:C:DERIVED:DL:C:BK:BK000000000043E1:eng`.
|
|
240
|
+
|
|
241
|
+
**Scope C vs U:** Records you create as a librarian through the official pipeline are Canonical (C). Records users create in their personal libraries are User-created (U). Both types share the same ID format — the only difference is the scope letter and the top bit of the wireId.
|
|
242
|
+
|
|
243
|
+
**The check character** at the end of every PID is a built-in safeguard. If someone misreads a digit or transposes two characters, the system flags the ID as invalid rather than silently looking up the wrong record. Think of it like the check digit on an ISBN or a credit card number.
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## 8. For developers: implementation notes
|
|
248
|
+
|
|
249
|
+
### 8.1 `toPID()` vs `sfcuid()`
|
|
250
|
+
|
|
251
|
+
Every generated model class (`@the_library/public/models/models`) has these identity methods:
|
|
252
|
+
|
|
253
|
+
- **`toPID()` / `toNativePID()`** — always returns the Mode N SFCUID (`DL:C:BK:BK…`). Synchronous, no worker needed. Available on every entity regardless of `uidStrategy`.
|
|
254
|
+
- **`static fromPID(pid)`** — the reverse: accepts a Mode N SFCUID or a bare PID (13-character or legacy 7-character body) and returns `{ wireId }`, or `null` if it doesn't match the model's prefix or its check character.
|
|
255
|
+
- **`sfcuid()`** — returns Mode S when a standard prop is populated, otherwise falls back to Mode N. Only present on standards-first models (`uidStrategy: string[]`, e.g. Person and Tag). Not present on `native-only` models (Book at Work level, Post, ClassificationSystem).
|
|
256
|
+
- **`BookInstance.sfcuid()`** — a Book edition's own identifier: `isbn:…` when the edition has an ISBN, otherwise a Mode DERIVED ID built from the parent Book's `toPID()` (§4.3).
|
|
257
|
+
|
|
258
|
+
### 8.2 Priority for `sfcuid()`
|
|
259
|
+
|
|
260
|
+
When a model declares multiple standards (e.g., `uidStrategy: ["isni", "orcid"]` on Person), `sfcuid()` tries them in declaration order and returns the first populated one:
|
|
261
|
+
|
|
262
|
+
```typescript
|
|
263
|
+
sfcuid(): string {
|
|
264
|
+
if (this.isniId) return `isni:${ISNIAdapter.normalize(this.isniId)}`;
|
|
265
|
+
if (this.orcidId) return `orcid:${ORCIDAdapter.normalize(this.orcidId)}`;
|
|
266
|
+
return this.toNativePID();
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### 8.3 Resolving an identifier
|
|
271
|
+
|
|
272
|
+
`Book.LoadInstance(id, lang)` resolves any of the three modes to a Book and, for editions, the index of the matching instance:
|
|
273
|
+
|
|
274
|
+
| SFCUID mode | How it resolves | Waits for |
|
|
275
|
+
|---|---|---|
|
|
276
|
+
| Mode N (`DL:C:…`) | Decodes inline with `fromPID()`, then loads the Book | — |
|
|
277
|
+
| Mode S (`isbn:…`) | Looks the value up in the ExternalIdCrosswalk worker | the crosswalk worker |
|
|
278
|
+
| Mode DERIVED | Looks the instance up in the ExternalIdCrosswalk worker | the crosswalk worker |
|
|
279
|
+
|
|
280
|
+
`LoadInstance` waits for the crosswalk worker before resolving any mode. Its Mode N branch reads canonical IDs (`DL:C:`); decode a user-created ID (`DL:U:`) with `fromPID()` and load it with `LoadAsync()`.
|
|
281
|
+
|
|
282
|
+
### 8.4 Standard props are ORM artifacts, not annotations
|
|
283
|
+
|
|
284
|
+
The `isbn` prop on a Book edition is **not** a plain string stored alongside other fields. It is injected by the compiler from the `isbn.json` StandardDefinition in `@the_library/canonical-schemas`. On the generated class it comes with:
|
|
285
|
+
|
|
286
|
+
- A validation method (`validateIsbn()`)
|
|
287
|
+
- A normalized getter (`isbnNormalized`)
|
|
288
|
+
- A propId from the global, append-only property dictionary, like every other prop
|
|
289
|
+
|
|
290
|
+
No model may declare its own `isbn` field: the compiler rejects a model prop that collides with a standard's prop. Only `instanceUidStrategy: ["isbn"]` appears in the model definition, and the compiler and the code generator handle the rest. Lookups against the standard's external APIs (Open Library, Google Books) are in `@the_library/standard-adapters` (`ISBNAdapter.apis`), not on the model.
|
|
291
|
+
|
|
292
|
+
### 8.5 Encoding and decoding PIDs
|
|
293
|
+
|
|
294
|
+
Use the model classes: `toPID()` to encode and `fromPID()` to decode. The low-level `encodePID()` / `decodePID()` functions are internal to the SDK and not exported. Do **not** hand-compute base-34 bodies or check characters — the ISO 7064 MOD 37-2 check algorithm includes the I/O disambiguation rule (computed `I` → `J`, `O` → `P`) that is easy to get wrong by hand.
|
|
295
|
+
|
|
296
|
+
### 8.6 The `@the_library/canonical-schemas` package
|
|
297
|
+
|
|
298
|
+
The canonical definitions used throughout this system live in `@the_library/canonical-schemas`. This package:
|
|
299
|
+
- Exports TypeScript interfaces (`StandardAdapter`, `StandardDefinition`)
|
|
300
|
+
- Contains JSON definition files for each standard (`standards/isbn.json`, `standards/isni.json`, etc.)
|
|
301
|
+
- Contains model definition files (`definitions/canonical/Book.json`, `Person.json`, `Tag.json`, `ClassificationSystem.json`, `Post.json`)
|
|
302
|
+
- Contains enum definitions (`definitions/canonical/enums/`)
|
|
303
|
+
- Has **no runtime code** — it is types and definition data only
|
|
304
|
+
|
|
305
|
+
The runtime adapter implementations (validation, normalization, external API calls) live in `@the_library/standard-adapters`, which depends on `canonical-schemas` but is never imported by it.
|