tbx 0.1.1 → 0.1.2

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.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +1 -1
  3. data/CHANGELOG.md +32 -0
  4. data/CLAUDE.md +21 -1
  5. data/README.adoc +365 -19
  6. data/lib/tbx/admin.rb +24 -11
  7. data/lib/tbx/admin_grp.rb +5 -0
  8. data/lib/tbx/admin_note.rb +14 -6
  9. data/lib/tbx/back.rb +5 -0
  10. data/lib/tbx/body.rb +3 -0
  11. data/lib/tbx/change.rb +6 -0
  12. data/lib/tbx/concept_entry.rb +10 -0
  13. data/lib/tbx/data_element.rb +50 -0
  14. data/lib/tbx/date.rb +6 -0
  15. data/lib/tbx/descrip.rb +23 -11
  16. data/lib/tbx/descrip_grp.rb +7 -0
  17. data/lib/tbx/descrip_note.rb +6 -6
  18. data/lib/tbx/document.rb +12 -0
  19. data/lib/tbx/ec.rb +16 -0
  20. data/lib/tbx/encoding_desc.rb +3 -0
  21. data/lib/tbx/file_desc.rb +6 -0
  22. data/lib/tbx/foreign.rb +6 -0
  23. data/lib/tbx/hi.rb +18 -0
  24. data/lib/tbx/item.rb +6 -0
  25. data/lib/tbx/item_grp.rb +6 -0
  26. data/lib/tbx/item_set.rb +6 -0
  27. data/lib/tbx/lang_sec.rb +6 -0
  28. data/lib/tbx/modules/basic.rb +92 -0
  29. data/lib/tbx/modules/core_types.rb +23 -0
  30. data/lib/tbx/modules/linguist.rb +46 -0
  31. data/lib/tbx/modules/min.rb +46 -0
  32. data/lib/tbx/namespace.rb +5 -0
  33. data/lib/tbx/note.rb +9 -0
  34. data/lib/tbx/p.rb +9 -0
  35. data/lib/tbx/ph.rb +6 -0
  36. data/lib/tbx/publication_stmt.rb +3 -0
  37. data/lib/tbx/ref.rb +17 -6
  38. data/lib/tbx/ref_object.rb +6 -0
  39. data/lib/tbx/ref_object_sec.rb +6 -0
  40. data/lib/tbx/revision_desc.rb +3 -0
  41. data/lib/tbx/sc.rb +9 -6
  42. data/lib/tbx/source_desc.rb +3 -0
  43. data/lib/tbx/tbx_header.rb +7 -0
  44. data/lib/tbx/term.rb +6 -0
  45. data/lib/tbx/term_comp.rb +26 -0
  46. data/lib/tbx/term_comp_grp.rb +24 -0
  47. data/lib/tbx/term_comp_sec.rb +45 -0
  48. data/lib/tbx/term_note.rb +44 -11
  49. data/lib/tbx/term_note_grp.rb +7 -0
  50. data/lib/tbx/term_sec.rb +8 -0
  51. data/lib/tbx/text_element.rb +5 -0
  52. data/lib/tbx/title.rb +6 -0
  53. data/lib/tbx/title_stmt.rb +3 -0
  54. data/lib/tbx/transac.rb +17 -6
  55. data/lib/tbx/transac_grp.rb +6 -0
  56. data/lib/tbx/transac_note.rb +17 -6
  57. data/lib/tbx/version.rb +1 -1
  58. data/lib/tbx/xref.rb +16 -0
  59. data/lib/tbx.rb +13 -0
  60. data/reference-docs/README.adoc +109 -0
  61. data/reference-docs/schemas/Basic_Module_Definition.pdf +0 -0
  62. data/reference-docs/schemas/Min_Module_Definition.pdf +0 -0
  63. data/reference-docs/schemas/TBX-Basic_ImplementationGuide/TBX-Basic_ImplementationGuide.pdf +0 -0
  64. data/reference-docs/schemas/TBX-Core_dialect/Schemas/Example_Astronomy_DCA_VALID.tbx +710 -0
  65. data/reference-docs/schemas/TBX-Core_dialect/Schemas/TBX-Core.sch +47 -0
  66. data/reference-docs/schemas/TBX-Core_dialect/Schemas/TBXcoreStructV03_TBX-Core_integrated.rng +1171 -0
  67. data/reference-docs/schemas/TBX-Core_dialect/TBX-Core Definition.pdf +0 -0
  68. data/reference-docs/schemas/TBX-Linguist_dialect/DCA/Example_Astronomy_DCA_VALID.tbx +4028 -0
  69. data/reference-docs/schemas/TBX-Linguist_dialect/DCA/TBX-Linguist_DCA.sch +146 -0
  70. data/reference-docs/schemas/TBX-Linguist_dialect/DCA/TBXcoreStructV03_TBX-Linguist_integrated.rng +1198 -0
  71. data/reference-docs/schemas/TBX-Linguist_dialect/DCT/Example_Astronomy_DCT_VALID.tbx +4019 -0
  72. data/reference-docs/schemas/TBX-Linguist_dialect/DCT/TBX-Linguist.nvdl +41 -0
  73. data/reference-docs/schemas/TBX-Linguist_dialect/DCT/TBX-Linguist_DCT.sch +48 -0
  74. data/reference-docs/schemas/TBX-Linguist_dialect/TBX-Linguist Definition.pdf +0 -0
  75. data/reference-docs/schemas/TBX-Min_dialect/DCA/TBX-Min_DCA.sch +82 -0
  76. data/reference-docs/schemas/TBX-Min_dialect/DCT/TBX-Min.nvdl +25 -0
  77. data/reference-docs/schemas/TBX-Min_dialect/DCT/TBX-Min_DCT.sch +48 -0
  78. data/reference-docs/schemas/TBX-Min_dialect/TBX-Min Definition.pdf +0 -0
  79. data/reference-docs/schemas/TBX_linguist_module/Linguist Module Definition.pdf +0 -0
  80. data/reference-docs/schemas/TBX_linguist_module/Linguist.rng +93 -0
  81. data/reference-docs/schemas/TBX_linguist_module/Linguist.sch +33 -0
  82. data/reference-docs/schemas/TBX_linguist_module/Linguist.tbxmd +47 -0
  83. data/reference-docs/schemas/TBX_module_description_xml/TBX Module Description.pdf +0 -0
  84. data/reference-docs/schemas/TBX_module_description_xml/tbxmd.rng +192 -0
  85. data/reference-docs/schemas/TBX_termComp_module/TermComp-namespace.rng +156 -0
  86. metadata +36 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6cd7e3da852ba1088c29f3c06a56d8d0240fd8632ac7c6169b945f72dd766827
4
- data.tar.gz: 82bf5dda948c2a43cf44d2486bb7df0e9dec692ac5ff8c447376123a52421faa
3
+ metadata.gz: 29c3d165460b14222b4af24f6c56d95f78dd8703f1bf00c78fab244586434be2
4
+ data.tar.gz: 64b7c19adc52c2e1d56d76369123601ff7d34ffc498e77ffe2465a7d1a2a546d
5
5
  SHA512:
6
- metadata.gz: 59d1714c344246929539249855a85656997cb94f685dfd050940ba4edc6c62e09fee8068962ad98fbc97c26221f4ec8fd5be6004fcad396ab0b83bdf18cff1aa
7
- data.tar.gz: 6c391a5e86fa7f6721b766535a9ab51060b760e88113e6a4fb6072fe58240add5138bdaef5d3e97656a6e6d5321d20b532cc66c4039049d4bf896dfb89730dd4
6
+ metadata.gz: 0b281377ea442217305e63c273d12def6a674b9c5b168a2f3556eb3d60b3f728fee78e81eed78784ed1592b32f1f62332f2bf748e866d45e85cf3f04ed76c175
7
+ data.tar.gz: fc068eaeab6a216594c07e630ae9d902bb35e75ab579f2469643d84506afcc59117d83cee7105756f051e12f7a9dece4e57fee48fcecf8e65680a7520255f2d1
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2026-05-05 13:10:07 UTC using RuboCop version 1.86.1.
3
+ # on 2026-05-05 23:57:36 UTC using RuboCop version 1.86.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
data/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ### Added
4
+
5
+ - `Tbx::DataElement` shared concern — DRY module injecting common data-category
6
+ attributes (id, lang, target, datatype, type, content) via `included` hook
7
+ - `Tbx::DataElement::InlineContent` sub-concern for elements with `entity.noteText`
8
+ content model (hi, ec, foreign, ph, sc inline children)
9
+ - `Tbx::Modules::Min` — Min module TYPES/VALUES constants (Min.tbxmd)
10
+ - `Tbx::Modules::Basic` — Basic module TYPES/VALUES constants (Basic.tbxmd)
11
+ - `Tbx::Modules::Linguist` — Linguist module TYPES/VALUES constants (Linguist.tbxmd)
12
+ - `Tbx::Modules::CoreTypes` — Core RNG hi type constants
13
+ - TYPES constants on all data-category elements (Admin, AdminNote, Descrip,
14
+ TermNote, Ref, Xref, Transac, TransacNote, Hi), composed from module hashes
15
+ - VALUES constants on TermNote (picklist enums) and Transac (transaction types)
16
+ - `Tbx::TermComp` — term component element `<termComp>` (TermComp module)
17
+ - `Tbx::TermCompGrp` — term component group `<termCompGrp>` (TermComp module)
18
+ - `Tbx::TermCompSec` — term component section `<termCompSec>` (TermComp module)
19
+ with TYPES for 5 decomposition methods
20
+ - Comprehensive YARD RubyDoc on all element classes tracing schema/module sources
21
+ - 119 new specs (165 total) covering TYPES/VALUES, DataElement concern, and
22
+ XML round-trips for all data-category elements and TermComp elements
23
+
24
+ ### Changed
25
+
26
+ - Data-category elements (Admin, Descrip, TermNote, AdminNote, DescripNote,
27
+ TransacNote, Transac, Ref) now use `include Tbx::DataElement` instead of
28
+ explicit attribute declarations
29
+ - `Tbx::TermNote::TYPES` now composes from Min + Basic + Linguist (9 types)
30
+ - `Tbx::Sc` aligned with core RNG: removed type, subtype, target attributes
31
+ (only id and isolated per RNG)
32
+ - Reference documentation downloaded from 12 LTAC-Global repositories into
33
+ `reference-docs/schemas/` with acknowledgements
34
+
3
35
  ## [0.1.1] - 2026-05-05
4
36
 
5
37
  - Simplify `Tbx::Namespaces::TbxNamespace` to `Tbx::Namespace`
data/CLAUDE.md CHANGED
@@ -45,6 +45,9 @@ Tbx
45
45
  ├── LangSec # <langSec>
46
46
  ├── TermSec # <termSec>
47
47
  ├── Term # <term>
48
+ ├── TermComp # <termComp> (TermComp module)
49
+ ├── TermCompGrp # <termCompGrp> (TermComp module)
50
+ ├── TermCompSec # <termCompSec> (TermComp module)
48
51
  ├── TermNote # <termNote>
49
52
  ├── TermNoteGrp # <termNoteGrp>
50
53
  ├── Descrip # <descrip>
@@ -72,7 +75,13 @@ Tbx
72
75
  ├── Sc # <sc>
73
76
  ├── Ph # <ph>
74
77
  ├── Title # <title>
75
- └── Namespace # XML namespace definition (urn:iso:std:iso:30042:ed-2)
78
+ ├── DataElement # Shared concern for data-category elements
79
+ ├── Namespace # XML namespace (urn:iso:std:iso:30042:ed-2)
80
+ └── Modules
81
+ ├── Min # Min module TYPES/VALUES
82
+ ├── Basic # Basic module TYPES/VALUES
83
+ ├── Linguist # Linguist module TYPES/VALUES
84
+ └── CoreTypes # Core RNG hi types
76
85
  ```
77
86
 
78
87
  ### Key Implementation Patterns
@@ -105,6 +114,17 @@ end
105
114
 
106
115
  **Autoload Pattern**: Elements are autoloaded via `lib/tbx.rb`. When adding new elements, add autoloads in alphabetical order.
107
116
 
117
+ **DataElement Concern** (`lib/tbx/data_element.rb`):
118
+ - `Tbx::DataElement` — injects shared attributes (id, lang, target, datatype, type, content) via `self.included(base)` hook
119
+ - `Tbx::DataElement::InlineContent` — adds inline child attributes (hi, ec, foreign, ph, sc) for elements with `entity.noteText` content
120
+ - XML mappings remain explicit per class (lutaml-model's `xml do` uses `instance_eval` on a separate context)
121
+ - Included by: Admin, Descrip, TermNote (with InlineContent); AdminNote, DescripNote, TransacNote, Transac, Ref (without)
122
+
123
+ **Module TYPES/VALUES** (`lib/tbx/modules/`):
124
+ - Each module defines `*_TYPES` and `*_VALUES` hashes keyed by Ruby symbol, valued by TBX string
125
+ - Element classes compose TYPES via `merge` from all applicable modules (e.g., `TermNote::TYPES` merges Min + Basic + Linguist)
126
+ - Source: Min.tbxmd, Basic.tbxmd, Linguist.tbxmd, TBXcoreStructV03.rng
127
+
108
128
  ### XML Namespace
109
129
 
110
130
  The TBX namespace is `urn:iso:std:iso:30042:ed-2` defined in `Tbx::Namespace`.
data/README.adoc CHANGED
@@ -89,44 +89,386 @@ tbx.to_xml
89
89
  tbx.to_xml(pretty: true, declaration: true, encoding: "utf-8")
90
90
  ----
91
91
 
92
- === Supported TBX elements
92
+ === Using TYPES and VALUES constants
93
93
 
94
- ==== Root and structure
94
+ Each data-category element class exposes `TYPES` (permitted `@type` values)
95
+ and `VALUES` (permitted picklist values) constants composed from the
96
+ TBX module definitions:
95
97
 
96
- `Document` (`<tbx>`), `TbxHeader`, `TextElement`, `Body`, `Back`
98
+ [source,ruby]
99
+ ----
100
+ # Permitted termNote types across all modules
101
+ Tbx::TermNote::TYPES
102
+ # => { administrative_status: "administrativeStatus", part_of_speech: "partOfSpeech",
103
+ # geographical_usage: "geographicalUsage", grammatical_gender: "grammaticalGender",
104
+ # term_location: "termLocation", term_type: "termType",
105
+ # grammatical_number: "grammaticalNumber", register: "register",
106
+ # transfer_comment: "transferComment" }
107
+
108
+ # Picklist values for a specific type
109
+ Tbx::TermNote::VALUES[:grammatical_gender]
110
+ # => { masculine: "masculine", feminine: "feminine", neuter: "neuter", other: "other" }
111
+
112
+ # Admin types from all modules
113
+ Tbx::Admin::TYPES
114
+ # => { customer_subset: "customerSubset", project_subset: "projectSubset",
115
+ # source: "source", reading: "reading" }
116
+
117
+ # Descrip types
118
+ Tbx::Descrip::TYPES
119
+ # => { subject_field: "subjectField", context: "context", definition: "definition" }
120
+
121
+ # Hi types from core RNG
122
+ Tbx::Hi::TYPES
123
+ # => { entailed_term: "entailedTerm", hotkey: "hotkey", italics: "italics",
124
+ # bold: "bold", superscript: "superscript", subscript: "subscript", math: "math" }
125
+
126
+ # Create validated elements using constants
127
+ note = Tbx::TermNote.new(
128
+ type: Tbx::TermNote::TYPES[:part_of_speech],
129
+ content: [Tbx::TermNote::VALUES[:part_of_speech][:noun]],
130
+ )
131
+ ----
132
+
133
+ == Supported TBX elements
134
+
135
+ === Structural elements (TBXcoreStructV03.rng)
136
+
137
+ [cols="2,3,3",options="header"]
138
+ |===
139
+ | Ruby class | TBX element | Schema source
140
+
141
+ | `Tbx::Document` | `<tbx>` | Core RNG `<define name="tbx">`
142
+ | `Tbx::TbxHeader` | `<tbxHeader>` | Core RNG `<define name="tbxHeader">`
143
+ | `Tbx::TextElement` | `<text>` | Core RNG `<define name="text">`
144
+ | `Tbx::Body` | `<body>` | Core RNG `<define name="body">`
145
+ | `Tbx::Back` | `<back>` | Core RNG `<define name="back">`
146
+ | `Tbx::ConceptEntry` | `<conceptEntry>` | Core RNG `<define name="conceptEntry">`
147
+ | `Tbx::LangSec` | `<langSec>` | Core RNG `<define name="langSec">`
148
+ | `Tbx::TermSec` | `<termSec>` | Core RNG `<define name="termSec">`
149
+ | `Tbx::Term` | `<term>` | Core RNG `<define name="term">`
150
+ |===
151
+
152
+ === Header elements (TBXcoreStructV03.rng)
153
+
154
+ [cols="2,3,3",options="header"]
155
+ |===
156
+ | Ruby class | TBX element | Schema source
157
+
158
+ | `Tbx::FileDesc` | `<fileDesc>` | Core RNG `<define name="fileDesc">`
159
+ | `Tbx::PublicationStmt` | `<publicationStmt>` | Core RNG `<define name="publicationStmt">`
160
+ | `Tbx::TitleStmt` | `<titleStmt>` | Core RNG `<define name="titleStmt">`
161
+ | `Tbx::SourceDesc` | `<sourceDesc>` | Core RNG `<define name="sourceDesc">`
162
+ | `Tbx::EncodingDesc` | `<encodingDesc>` | Core RNG `<define name="encodingDesc">`
163
+ | `Tbx::RevisionDesc` | `<revisionDesc>` | Core RNG `<define name="revisionDesc">`
164
+ | `Tbx::Change` | `<change>` | Core RNG `<define name="change">`
165
+ | `Tbx::Title` | `<title>` | Core RNG `<define name="title">`
166
+ |===
167
+
168
+ === Data category elements with TYPES constants
169
+
170
+ These elements carry a `type` attribute whose permitted values are defined
171
+ by the active TBX module composition. The `TYPES` constant on each class
172
+ contains the union of all applicable module types.
173
+
174
+ ==== Admin element
175
+
176
+ [cols="1,2,2,3",options="header"]
177
+ |===
178
+ | Module | Type value | Content | Source
179
+
180
+ | Min | `customerSubset` | string | Min.tbxmd (DC-165)
181
+ | Basic | `projectSubset` | string | Basic.tbxmd (DC-406)
182
+ | Basic | `source` | string | Basic.tbxmd (DC-471)
183
+ | Linguist | `reading` | string | Linguist.tbxmd
184
+ |===
185
+
186
+ ==== AdminNote element
187
+
188
+ [cols="1,2,2,3",options="header"]
189
+ |===
190
+ | Module | Type value | Content | Source
191
+
192
+ | Linguist | `readingNote` | noteText | Linguist.tbxmd
193
+ |===
194
+
195
+ ==== Descrip element
196
+
197
+ [cols="1,2,2,3",options="header"]
198
+ |===
199
+ | Module | Type value | Content | Source
200
+
201
+ | Min | `subjectField` | string | Min.tbxmd (DC-489)
202
+ | Basic | `context` | noteText | Basic.tbxmd (DC-149)
203
+ | Basic | `definition` | noteText | Basic.tbxmd (DC-168)
204
+ |===
205
+
206
+ ==== TermNote element
207
+
208
+ [cols="1,2,2,3",options="header"]
209
+ |===
210
+ | Module | Type value | Content | Source
211
+
212
+ | Min | `administrativeStatus` | picklist footnote:[admittedTerm-admn-sts, deprecatedTerm-admn-sts, supersededTerm-admn-sts, preferredTerm-admn-sts] | Min.tbxmd (DC-168)
213
+ | Min | `partOfSpeech` | picklist footnote:[adjective, noun, other, verb, adverb] | Min.tbxmd (DC-396)
214
+ | Basic | `geographicalUsage` | string | Basic.tbxmd (DC-243)
215
+ | Basic | `grammaticalGender` | picklist footnote:[masculine, feminine, neuter, other] | Basic.tbxmd (DC-245)
216
+ | Basic | `termLocation` | picklist footnote:[18 UI element types: checkBox, comboBox, comboBoxElement, dialogBox, groupBox, informativeMessage, interactiveMessage, menuItem, progressBar, pushButton, radioButton, slider, spinBox, tab, tableText, textBox, toolTip, user-definedType] | Basic.tbxmd (DC-1823)
217
+ | Basic | `termType` | picklist footnote:[fullForm, acronym, abbreviation, shortForm, variant, phrase] | Basic.tbxmd (DC-2677)
218
+ | Linguist | `grammaticalNumber` | picklist footnote:[singular, plural, dual, mass, otherNumber] | Linguist.tbxmd (DC-251)
219
+ | Linguist | `register` | picklist footnote:[colloquialRegister, neutralRegister, technicalRegister, in-houseRegister, bench-levelRegister, slangRegister, vulgarRegister] | Linguist.tbxmd (DC-423)
220
+ | Linguist | `transferComment` | string | Linguist.tbxmd (DC-520)
221
+ |===
97
222
 
98
- ==== Terminological entries
223
+ ==== Transac element
99
224
 
100
- `ConceptEntry`, `LangSec`, `TermSec`, `Term`
225
+ [cols="1,2,2,3",options="header"]
226
+ |===
227
+ | Module | Type value | Values | Source
101
228
 
102
- ==== Data categories
229
+ | Basic | `transactionType` | picklist footnote:[origination, modification] | Basic.tbxmd (DC-1689)
230
+ |===
231
+
232
+ ==== TransacNote element
233
+
234
+ [cols="1,2,2,3",options="header"]
235
+ |===
236
+ | Module | Type value | Content | Source
237
+
238
+ | Basic | `responsibility` | string | Basic.tbxmd (DC-451)
239
+ |===
103
240
 
104
- `Admin`, `AdminGrp`, `AdminNote`, `Descrip`, `DescripGrp`, `DescripNote`,
105
- `TermNote`, `TermNoteGrp`, `Ref`, `Xref`
241
+ ==== Ref element
242
+
243
+ [cols="1,2,2,3",options="header"]
244
+ |===
245
+ | Module | Type value | Content | Source
106
246
 
107
- ==== Transactions
247
+ | Basic | `crossReference` | string | Basic.tbxmd (DC-164)
248
+ |===
108
249
 
109
- `Transac`, `TransacGrp`, `TransacNote`, `DateElement`
250
+ ==== Xref element
110
251
 
111
- ==== Header
252
+ [cols="1,2,2,3",options="header"]
253
+ |===
254
+ | Module | Type value | Content | Source
112
255
 
113
- `FileDesc`, `PublicationStmt`, `TitleStmt`, `SourceDesc`, `EncodingDesc`,
114
- `RevisionDesc`, `Change`
256
+ | Min | `externalCrossReference` | string | TBX-Min DCA Schematron
257
+ | Basic | `externalCrossReference` | string | Basic.tbxmd (DC-226)
258
+ | Basic | `xGraphic` | string | Basic.tbxmd (DC-2920)
259
+ |===
115
260
 
116
- ==== Reference objects
261
+ ==== Hi element (core RNG, not module-specific)
117
262
 
118
- `RefObjectSec`, `RefObject`, `ItemSet`, `ItemGrp`, `Item`
263
+ [cols="2,3",options="header"]
264
+ |===
265
+ | Type value | Description
119
266
 
120
- ==== Inline
267
+ | `entailedTerm` | Cross-reference to another concept within term text
268
+ | `hotkey` | Keyboard shortcut designation
269
+ | `italics` | Italic text emphasis
270
+ | `bold` | Bold text emphasis
271
+ | `superscript` | Superscript text
272
+ | `subscript` | Subscript text
273
+ | `math` | Mathematical notation
274
+ |===
121
275
 
122
- `Hi`, `Foreign`, `Ec`, `Sc`, `Ph`, `Note`, `P`, `Title`
276
+ === Grouping elements (TBXcoreStructV03.rng)
277
+
278
+ [cols="2,3,3",options="header"]
279
+ |===
280
+ | Ruby class | TBX element | Schema source
281
+
282
+ | `Tbx::AdminGrp` | `<adminGrp>` | Core RNG `<define name="adminGrp">`
283
+ | `Tbx::DescripGrp` | `<descripGrp>` | Core RNG `<define name="descripGrp">`
284
+ | `Tbx::DescripNote` | `<descripNote>` | Core RNG `<define name="descripNote">`
285
+ | `Tbx::TermNoteGrp` | `<termNoteGrp>` | Core RNG `<define name="termNoteGrp">`
286
+ | `Tbx::TransacGrp` | `<transacGrp>` | Core RNG `<define name="transacGrp">`
287
+ | `Tbx::TransacNote` | `<transacNote>` | Core RNG `<define name="transacNote">`
288
+ | `Tbx::DateElement` | `<date>` | Core RNG `<define name="date">`
289
+ |===
290
+
291
+ === TermComp elements (TermComp-namespace.rng)
292
+
293
+ [cols="2,3,3",options="header"]
294
+ |===
295
+ | Ruby class | TBX element | Schema source
296
+
297
+ | `Tbx::TermCompSec` | `<termCompSec>` | TermComp-namespace.rng `<define name="termCompSec">`
298
+ | `Tbx::TermCompGrp` | `<termCompGrp>` | TermComp-namespace.rng `<define name="termCompGrp">`
299
+ | `Tbx::TermComp` | `<termComp>` | TermComp-namespace.rng `<define name="termComp">`
300
+ |===
301
+
302
+ `Tbx::TermCompSec::TYPES` defines 5 decomposition types:
303
+ `hyphenation`, `lemma`, `morphologicalElement`, `syllabification`, `termElement`.
304
+
305
+ === Reference object elements (TBXcoreStructV03.rng)
306
+
307
+ [cols="2,3,3",options="header"]
308
+ |===
309
+ | Ruby class | TBX element | Schema source
310
+
311
+ | `Tbx::RefObjectSec` | `<refObjectSec>` | Core RNG `<define name="refObjectSec">`
312
+ | `Tbx::RefObject` | `<refObject>` | Core RNG `<define name="refObject">`
313
+ | `Tbx::ItemSet` | `<itemSet>` | Core RNG `<define name="itemSet">`
314
+ | `Tbx::ItemGrp` | `<itemGrp>` | Core RNG `<define name="itemGrp">`
315
+ | `Tbx::Item` | `<item>` | Core RNG `<define name="item">`
316
+ |===
317
+
318
+ === Inline and text elements (TBXcoreStructV03.rng)
319
+
320
+ [cols="2,3,3",options="header"]
321
+ |===
322
+ | Ruby class | TBX element | Schema source
323
+
324
+ | `Tbx::Hi` | `<hi>` | Core RNG `<define name="hi">`
325
+ | `Tbx::Foreign` | `<foreign>` | Core RNG `<define name="foreign">`
326
+ | `Tbx::Ec` | `<ec>` | Core RNG `<define name="ec">`
327
+ | `Tbx::Sc` | `<sc>` | Core RNG `<define name="sc">`
328
+ | `Tbx::Ph` | `<ph>` | Core RNG `<define name="ph">`
329
+ | `Tbx::Note` | `<note>` | Core RNG `<define name="note">`
330
+ | `Tbx::P` | `<p>` | Core RNG `<define name="p">`
331
+ |===
332
+
333
+ == Module architecture
334
+
335
+ TBX modules define sets of data categories. Dialects compose modules to
336
+ determine which `@type` values are permitted on each element.
337
+
338
+ === Modules and dialects
339
+
340
+ [cols="1,4,3",options="header"]
341
+ |===
342
+ | Module | Dialects that include it | Source files
343
+
344
+ | Min | TBX-Min, TBX-Basic, TBX-Core, TBX-Linguist | `Min.tbxmd`, `Min.rng`, `Min.sch`
345
+ | Basic | TBX-Basic, TBX-Linguist | `Basic.tbxmd`, `Basic.rng`, `Basic.sch`
346
+ | Linguist | TBX-Linguist | `Linguist.tbxmd`, `Linguist.rng`, `Linguist.sch`
347
+ | TermComp | (add-on for any dialect) | `TermComp-namespace.rng`
348
+ | Core | TBX-Core | `TBXcoreStructV03.rng`
349
+ |===
350
+
351
+ === Ruby module constants
352
+
353
+ [cols="2,3,5",options="header"]
354
+ |===
355
+ | Ruby module | Constants | Source schema
356
+
357
+ | `Tbx::Modules::Min` | `ADMIN_TYPES`, `DESCRIP_TYPES`, `TERM_NOTE_TYPES`, `TERM_NOTE_VALUES`, `XREF_TYPES` | Min.tbxmd
358
+ | `Tbx::Modules::Basic` | `ADMIN_TYPES`, `DESCRIP_TYPES`, `TERM_NOTE_TYPES`, `TERM_NOTE_VALUES`, `REF_TYPES`, `XREF_TYPES`, `TRANSAC_TYPES`, `TRANSAC_VALUES`, `TRANSAC_NOTE_TYPES` | Basic.tbxmd
359
+ | `Tbx::Modules::Linguist` | `ADMIN_TYPES`, `ADMIN_NOTE_TYPES`, `TERM_NOTE_TYPES`, `TERM_NOTE_VALUES` | Linguist.tbxmd
360
+ | `Tbx::Modules::CoreTypes` | `HI_TYPES` | TBXcoreStructV03.rng
361
+ |===
362
+
363
+ Element classes compose these via `merge`:
364
+
365
+ [cols="2,3",options="header"]
366
+ |===
367
+ | Element class | TYPES composition
368
+
369
+ | `Tbx::Admin` | Min::ADMIN_TYPES + Basic::ADMIN_TYPES + Linguist::ADMIN_TYPES
370
+ | `Tbx::AdminNote` | Linguist::ADMIN_NOTE_TYPES
371
+ | `Tbx::Descrip` | Min::DESCRIP_TYPES + Basic::DESCRIP_TYPES
372
+ | `Tbx::TermNote` | Min::TERM_NOTE_TYPES + Basic::TERM_NOTE_TYPES + Linguist::TERM_NOTE_TYPES
373
+ | `Tbx::Ref` | Basic::REF_TYPES
374
+ | `Tbx::Xref` | Min::XREF_TYPES + Basic::XREF_TYPES
375
+ | `Tbx::Transac` | Basic::TRANSAC_TYPES
376
+ | `Tbx::TransacNote` | Basic::TRANSAC_NOTE_TYPES
377
+ | `Tbx::Hi` | CoreTypes::HI_TYPES
378
+ | `Tbx::TermCompSec` | (self-contained: hyphenation, lemma, morphologicalElement, syllabification, termElement)
379
+ |===
380
+
381
+ === Shared concern
382
+
383
+ `Tbx::DataElement` is a module that injects common attributes (id, lang,
384
+ target, datatype, type, content) via `self.included(base)`.
385
+ `Tbx::DataElement::InlineContent` adds inline child attributes (hi, ec,
386
+ foreign, ph, sc) for elements with `entity.noteText` content.
387
+
388
+ [cols="2,2",options="header"]
389
+ |===
390
+ | Element classes | Includes InlineContent?
391
+ | `Admin`, `Descrip`, `TermNote` | Yes (entity.noteText content)
392
+ | `AdminNote`, `DescripNote`, `TransacNote`, `Transac`, `Ref` | No (plain text only per RNG)
393
+ |===
394
+
395
+ == Schema source audit
396
+
397
+ Every element class in `lib/tbx/` has YARD documentation tracing it to its
398
+ schema source. The authoritative sources are:
399
+
400
+ [cols="2,5",options="header"]
401
+ |===
402
+ | Source file | Defines
403
+
404
+ | `TBXcoreStructV03.rng` | All structural elements, attributes, content models, and `hi` type values
405
+ | `Min.tbxmd` | Min module data categories: customerSubset, subjectField, administrativeStatus, partOfSpeech, externalCrossReference
406
+ | `Basic.tbxmd` | Basic module data categories: projectSubset, source, context, definition, geographicalUsage, grammaticalGender, termLocation, termType, crossReference, externalCrossReference, xGraphic, transactionType, responsibility
407
+ | `Linguist.tbxmd` | Linguist module data categories: reading, readingNote, grammaticalNumber, register, transferComment
408
+ | `TermComp-namespace.rng` | TermComp elements (termComp, termCompGrp, termCompSec) and type values
409
+ | `TBX-Basic_DCA.sch` | TBX-Basic DCA Schematron: permitted `@type` values, picklist value constraints, level constraints
410
+ | `TBX-Min_DCA.sch` | TBX-Min DCA Schematron
411
+ | `TBX-Linguist_DCA.sch` | TBX-Linguist DCA Schematron
412
+ | `TBX-Core.sch` | TBX-Core Schematron
413
+ | `Basic.rng` / `Min.rng` / `Linguist.rng` | Module-level structural extensions
414
+ | `Basic.sch` / `Min.sch` / `Linguist.sch` | Module-level Schematron rules
415
+ |===
416
+
417
+ == Reference documentation
418
+
419
+ The `reference-docs/` directory contains official TBX schema, dialect, and
420
+ module files from https://ltac-global.org[LTAC Global]. See
421
+ link:reference-docs/README.adoc[reference-docs/README.adoc] for a complete
422
+ inventory with source repository links.
423
+
424
+ === Official LTAC-Global repositories
425
+
426
+ |===
427
+ | Repository | Description
428
+
429
+ | https://github.com/LTAC-Global/TBX_core_module[TBX_core_module]
430
+ | Core structural schema (`TBXcoreStructV03.rng`)
431
+
432
+ | https://github.com/LTAC-Global/TBX_min_module[TBX_min_module]
433
+ | Min module data categories (RNG, Schematron, `.tbxmd`)
434
+
435
+ | https://github.com/LTAC-Global/TBX_basic_module[TBX_basic_module]
436
+ | Basic module data categories (RNG, Schematron, `.tbxmd`)
437
+
438
+ | https://github.com/LTAC-Global/TBX_linguist_module[TBX_linguist_module]
439
+ | Linguist module data categories (RNG, Schematron, `.tbxmd`)
440
+
441
+ | https://github.com/LTAC-Global/TBX_termComp_module[TBX_termComp_module]
442
+ | Term composition module (namespace RNG)
443
+
444
+ | https://github.com/LTAC-Global/TBX_module_description_xml[TBX_module_description_xml]
445
+ | `.tbxmd` format schema (`tbxmd.rng`)
446
+
447
+ | https://github.com/LTAC-Global/TBX-Min_dialect[TBX-Min_dialect]
448
+ | TBX-Min dialect (DCA + DCT Schematron, NVDL)
449
+
450
+ | https://github.com/LTAC-Global/TBX-Basic_dialect[TBX-Basic_dialect]
451
+ | TBX-Basic dialect (DCA + DCT Schematron, bundled modules)
452
+
453
+ | https://github.com/LTAC-Global/TBX-Core_dialect[TBX-Core_dialect]
454
+ | TBX-Core dialect (integrated RNG, Schematron)
455
+
456
+ | https://github.com/LTAC-Global/TBX-Linguist_dialect[TBX-Linguist_dialect]
457
+ | TBX-Linguist dialect (DCA + DCT Schematron, integrated RNG)
458
+
459
+ | https://github.com/LTAC-Global/TBX-Basic_ImplementationGuide[TBX-Basic_ImplementationGuide]
460
+ | TBX-Basic implementation guide
461
+
462
+ | https://github.com/LTAC-Global/TBX_test_files[TBX_test_files]
463
+ | Official TBX test fixture files
464
+ |===
123
465
 
124
466
  == Test data
125
467
 
126
468
  Test fixtures are sourced from the
127
469
  https://github.com/LTAC-Global/TBX_test_files[TBX_test_files] repository
128
- maintained by https://ltac-global.org[LTAC Global], and from the TBX-Basic
129
- dialect schemas included in `reference-docs/`.
470
+ maintained by https://ltac-global.org[LTAC Global], and from the dialect
471
+ schemas and example files in `reference-docs/`.
130
472
 
131
473
  == Development
132
474
 
@@ -150,6 +492,10 @@ bundle exec rake
150
492
  This gem is developed, maintained and funded by
151
493
  https://www.ribose.com[Ribose Inc.]
152
494
 
495
+ TBX schema, dialect, and module reference files are maintained by
496
+ https://ltac-global.org[LTAC Global] and sourced from the
497
+ https://github.com/LTAC-Global[LTAC-Global GitHub organization].
498
+
153
499
  == License
154
500
 
155
501
  The gem is available as open source under the terms of the
data/lib/tbx/admin.rb CHANGED
@@ -1,18 +1,31 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Administrative data category element `<admin>`.
5
+ #
6
+ # Carries administrative metadata about a terminological entry, such as
7
+ # customer subset classification, project association, source attribution,
8
+ # and pronunciation readings.
9
+ #
10
+ # Permitted `type` values (composed from all modules):
11
+ #
12
+ # * Min module: `customerSubset` — entry subset (DC-165)
13
+ # * Basic module: `projectSubset` — project-specific entry subset (DC-406),
14
+ # `source` — origin of information (DC-471)
15
+ # * Linguist module: `reading` — pronunciation or reading of a term
16
+ #
17
+ # Content model: `entity.noteText` (mixed text + inline elements hi, ec,
18
+ # foreign, ph, sc).
19
+ #
20
+ # Schema source: TBXcoreStructV03.rng `<define name="admin">`;
21
+ # data categories: Min.tbxmd, Basic.tbxmd, Linguist.tbxmd.
4
22
  class Admin < Lutaml::Model::Serializable
5
- attribute :id, :string
6
- attribute :lang, Lutaml::Xml::W3c::XmlLangType
7
- attribute :target, :string
8
- attribute :datatype, :string
9
- attribute :type, :string
10
- attribute :content, :string, collection: true
11
- attribute :hi, ::Tbx::Hi, collection: true
12
- attribute :ec, ::Tbx::Ec, collection: true
13
- attribute :foreign, ::Tbx::Foreign, collection: true
14
- attribute :ph, ::Tbx::Ph, collection: true
15
- attribute :sc, ::Tbx::Sc, collection: true
23
+ include Tbx::DataElement
24
+ include Tbx::DataElement::InlineContent
25
+
26
+ TYPES = Modules::Min::ADMIN_TYPES
27
+ .merge(Modules::Basic::ADMIN_TYPES)
28
+ .merge(Modules::Linguist::ADMIN_TYPES).freeze
16
29
 
17
30
  xml do
18
31
  root "admin"
data/lib/tbx/admin_grp.rb CHANGED
@@ -1,6 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Groups an `<admin>` element with its associated notes and references.
5
+ #
6
+ # Children: `admin` (required), then adminNote, note, ref, xref.
7
+ #
8
+ # Schema source: TBXcoreStructV03.rng `<define name="adminGrp">`
4
9
  class AdminGrp < Lutaml::Model::Serializable
5
10
  attribute :id, :string
6
11
  attribute :admin, ::Tbx::Admin
@@ -1,13 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Administrative note element `<adminNote>`.
5
+ #
6
+ # Provides notes about administrative data. Content is plain text only
7
+ # (no inline elements per the core RNG).
8
+ #
9
+ # Permitted `type` values:
10
+ #
11
+ # * Linguist module: `readingNote` — note about a term's reading/pronunciation
12
+ #
13
+ # Schema source: TBXcoreStructV03.rng `<define name="adminNote">`;
14
+ # data category: Linguist.tbxmd.
4
15
  class AdminNote < Lutaml::Model::Serializable
5
- attribute :id, :string
6
- attribute :lang, Lutaml::Xml::W3c::XmlLangType
7
- attribute :target, :string
8
- attribute :datatype, :string
9
- attribute :type, :string
10
- attribute :content, :string, collection: true
16
+ include Tbx::DataElement
17
+
18
+ TYPES = Modules::Linguist::ADMIN_NOTE_TYPES.freeze
11
19
 
12
20
  xml do
13
21
  root "adminNote"
data/lib/tbx/back.rb CHANGED
@@ -1,6 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Back matter `<back>` containing reference object sections.
5
+ #
6
+ # Used for managing picklists and external references.
7
+ #
8
+ # Schema source: TBXcoreStructV03.rng `<define name="back">`
4
9
  class Back < Lutaml::Model::Serializable
5
10
  attribute :id, :string
6
11
  attribute :ref_object_sec, ::Tbx::RefObjectSec, collection: true
data/lib/tbx/body.rb CHANGED
@@ -1,6 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Body element `<body>` containing all concept entries.
5
+ #
6
+ # Schema source: TBXcoreStructV03.rng `<define name="body">`
4
7
  class Body < Lutaml::Model::Serializable
5
8
  attribute :id, :string
6
9
  attribute :concept_entry, ::Tbx::ConceptEntry, collection: true
data/lib/tbx/change.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # A single change record in the revision history `<change>`.
5
+ #
6
+ # Each change record contains one or more paragraph elements describing
7
+ # what changed and when.
8
+ #
9
+ # Schema source: TBXcoreStructV03.rng `<define name="change">`
4
10
  class Change < Lutaml::Model::Serializable
5
11
  attribute :id, :string
6
12
  attribute :lang, Lutaml::Xml::W3c::XmlLangType
@@ -1,6 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # A single concept entry `<conceptEntry>`.
5
+ #
6
+ # Represents a concept in the terminology collection. The `id` attribute
7
+ # is required and must be unique within the document.
8
+ #
9
+ # Permitted children are defined by the `entity.auxInfo` pattern:
10
+ # admin, adminGrp, descrip, descripGrp, note, ref, transacGrp, xref,
11
+ # followed by one or more langSec elements.
12
+ #
13
+ # Schema source: TBXcoreStructV03.rng `<define name="conceptEntry">`
4
14
  class ConceptEntry < Lutaml::Model::Serializable
5
15
  attribute :id, :string
6
16
  attribute :admin, ::Tbx::Admin, collection: true