Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2026-05-05 13:10:07 UTC using RuboCop version 1.86.1.
# on 2026-05-05 23:57:36 UTC using RuboCop version 1.86.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
## [Unreleased]

### Added

- `Tbx::DataElement` shared concern — DRY module injecting common data-category
attributes (id, lang, target, datatype, type, content) via `included` hook
- `Tbx::DataElement::InlineContent` sub-concern for elements with `entity.noteText`
content model (hi, ec, foreign, ph, sc inline children)
- `Tbx::Modules::Min` — Min module TYPES/VALUES constants (Min.tbxmd)
- `Tbx::Modules::Basic` — Basic module TYPES/VALUES constants (Basic.tbxmd)
- `Tbx::Modules::Linguist` — Linguist module TYPES/VALUES constants (Linguist.tbxmd)
- `Tbx::Modules::CoreTypes` — Core RNG hi type constants
- TYPES constants on all data-category elements (Admin, AdminNote, Descrip,
TermNote, Ref, Xref, Transac, TransacNote, Hi), composed from module hashes
- VALUES constants on TermNote (picklist enums) and Transac (transaction types)
- `Tbx::TermComp` — term component element `<termComp>` (TermComp module)
- `Tbx::TermCompGrp` — term component group `<termCompGrp>` (TermComp module)
- `Tbx::TermCompSec` — term component section `<termCompSec>` (TermComp module)
with TYPES for 5 decomposition methods
- Comprehensive YARD RubyDoc on all element classes tracing schema/module sources
- 119 new specs (165 total) covering TYPES/VALUES, DataElement concern, and
XML round-trips for all data-category elements and TermComp elements

### Changed

- Data-category elements (Admin, Descrip, TermNote, AdminNote, DescripNote,
TransacNote, Transac, Ref) now use `include Tbx::DataElement` instead of
explicit attribute declarations
- `Tbx::TermNote::TYPES` now composes from Min + Basic + Linguist (9 types)
- `Tbx::Sc` aligned with core RNG: removed type, subtype, target attributes
(only id and isolated per RNG)
- Reference documentation downloaded from 12 LTAC-Global repositories into
`reference-docs/schemas/` with acknowledgements

## [0.1.1] - 2026-05-05

- Simplify `Tbx::Namespaces::TbxNamespace` to `Tbx::Namespace`
Expand Down
22 changes: 21 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ Tbx
├── LangSec # <langSec>
├── TermSec # <termSec>
├── Term # <term>
├── TermComp # <termComp> (TermComp module)
├── TermCompGrp # <termCompGrp> (TermComp module)
├── TermCompSec # <termCompSec> (TermComp module)
├── TermNote # <termNote>
├── TermNoteGrp # <termNoteGrp>
├── Descrip # <descrip>
Expand Down Expand Up @@ -72,7 +75,13 @@ Tbx
├── Sc # <sc>
├── Ph # <ph>
├── Title # <title>
└── Namespace # XML namespace definition (urn:iso:std:iso:30042:ed-2)
├── DataElement # Shared concern for data-category elements
├── Namespace # XML namespace (urn:iso:std:iso:30042:ed-2)
└── Modules
├── Min # Min module TYPES/VALUES
├── Basic # Basic module TYPES/VALUES
├── Linguist # Linguist module TYPES/VALUES
└── CoreTypes # Core RNG hi types
```

### Key Implementation Patterns
Expand Down Expand Up @@ -105,6 +114,17 @@ end

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

**DataElement Concern** (`lib/tbx/data_element.rb`):
- `Tbx::DataElement` — injects shared attributes (id, lang, target, datatype, type, content) via `self.included(base)` hook
- `Tbx::DataElement::InlineContent` — adds inline child attributes (hi, ec, foreign, ph, sc) for elements with `entity.noteText` content
- XML mappings remain explicit per class (lutaml-model's `xml do` uses `instance_eval` on a separate context)
- Included by: Admin, Descrip, TermNote (with InlineContent); AdminNote, DescripNote, TransacNote, Transac, Ref (without)

**Module TYPES/VALUES** (`lib/tbx/modules/`):
- Each module defines `*_TYPES` and `*_VALUES` hashes keyed by Ruby symbol, valued by TBX string
- Element classes compose TYPES via `merge` from all applicable modules (e.g., `TermNote::TYPES` merges Min + Basic + Linguist)
- Source: Min.tbxmd, Basic.tbxmd, Linguist.tbxmd, TBXcoreStructV03.rng

### XML Namespace

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