Skip to content

Add TYPES constant and .entailed_term factory to TermNote#2

Merged
ronaldtse merged 2 commits into
mainfrom
feat/entailed-term-and-constants
May 6, 2026
Merged

Add TYPES constant and .entailed_term factory to TermNote#2
ronaldtse merged 2 commits into
mainfrom
feat/entailed-term-and-constants

Conversation

@ronaldtse
Copy link
Copy Markdown
Member

Summary

Adds standard DCA termNote type constants and a convenience factory method for creating entailedTerm cross-references.

Changes

  • TYPES constant hash on Tbx::TermNote with standard ISO 30042:2019 DCA type values:

    • usageStatus, termType, grammaticalGender, grammaticalNumber, partOfSpeech, entailedTerm
  • .entailed_term(target:, content: nil) factory method — creates a TermNote with type: "entailedTerm" and the given target (and optional content).

  • 14 specs covering type constants, entailed_term creation, XML serialization, and round-trip.

Usage

# Create an entailedTerm cross-reference
note = Tbx::TermNote.entailed_term(target: "concept_3.1.1.4")
# => #<Tbx::TermNote type="entailedTerm" target="concept_3.1.1.4">

note.to_xml
# => <tbx:termNote type="entailedTerm" target="concept_3.1.1.4"/>

# With content
note = Tbx::TermNote.entailed_term(target: "c1", content: "related term")
note.to_xml
# => <tbx:termNote type="entailedTerm" target="c1">related term</tbx:termNote>

# Type constants
Tbx::TermNote::TYPES[:usage_status]  # => "usageStatus"
Tbx::TermNote::TYPES[:entailed_term] # => "entailedTerm"

Context

This unblocks glossarist-ruby TODO 04 (TBX cross-references via entailedTerm), enabling ConceptToTbxTransform to map related_concepts to <termNote type="entailedTerm" target="..."> elements.

ronaldtse added 2 commits May 5, 2026 22:04
- Add TYPES hash with standard DCA termNote type values (usageStatus,
  termType, grammaticalGender, grammaticalNumber, partOfSpeech,
  entailedTerm) per ISO 30042:2019
- Add .entailed_term class method for creating cross-reference termNotes
  with type and target attributes
- Add comprehensive spec with 14 tests covering types, serialization,
  and round-trip
…Doc, 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
@ronaldtse ronaldtse merged commit da4d0d0 into main May 6, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant