Skip to content

Commit da4d0d0

Browse files
committed
Add module TYPES/VALUES, DataElement concern, TermComp elements, RubyDoc, and comprehensive specs
- Add Tbx::DataElement shared concern (DRY) for data-category attributes with InlineContent sub-concern for entity.noteText elements - Add Tbx::Modules::{Min,Basic,Linguist,CoreTypes} with TYPES/VALUES constants sourced from .tbxmd files - Add TYPES constants on Admin, AdminNote, Descrip, TermNote, Ref, Xref, Transac, TransacNote, Hi composed from module definitions - Add VALUES constants on TermNote (picklist enums) and Transac - Add Tbx::TermComp, TermCompGrp, TermCompSec from TermComp module - Fix Sc model to match core RNG (remove type, subtype, target attrs) - Add comprehensive YARD RubyDoc on all element classes tracing schema/module sources - Add reference schema files from 12 LTAC-Global repositories - Add 119 new specs (165 total) covering TYPES/VALUES, DataElement, TermComp, and XML round-trips - Update README with schema/module/element coverage tables - Update CLAUDE.md with DataElement and Modules patterns
1 parent 4dc8cf4 commit da4d0d0

98 files changed

Lines changed: 14113 additions & 167 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.rubocop_todo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `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.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
## [Unreleased]
22

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+
335
## [0.1.1] - 2026-05-05
436

537
- Simplify `Tbx::Namespaces::TbxNamespace` to `Tbx::Namespace`

CLAUDE.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ Tbx
4545
├── LangSec # <langSec>
4646
├── TermSec # <termSec>
4747
├── Term # <term>
48+
├── TermComp # <termComp> (TermComp module)
49+
├── TermCompGrp # <termCompGrp> (TermComp module)
50+
├── TermCompSec # <termCompSec> (TermComp module)
4851
├── TermNote # <termNote>
4952
├── TermNoteGrp # <termNoteGrp>
5053
├── Descrip # <descrip>
@@ -72,7 +75,13 @@ Tbx
7275
├── Sc # <sc>
7376
├── Ph # <ph>
7477
├── 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
7685
```
7786

7887
### Key Implementation Patterns
@@ -105,6 +114,17 @@ end
105114

106115
**Autoload Pattern**: Elements are autoloaded via `lib/tbx.rb`. When adding new elements, add autoloads in alphabetical order.
107116

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+
108128
### XML Namespace
109129

110130
The TBX namespace is `urn:iso:std:iso:30042:ed-2` defined in `Tbx::Namespace`.

0 commit comments

Comments
 (0)