tbx 0.1.0 → 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 (90) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +1 -1
  3. data/.github/workflows/release.yml +2 -2
  4. data/.rubocop_todo.yml +1 -1
  5. data/CHANGELOG.md +38 -0
  6. data/CLAUDE.md +23 -4
  7. data/Gemfile +1 -1
  8. data/README.adoc +365 -19
  9. data/lib/tbx/admin.rb +25 -12
  10. data/lib/tbx/admin_grp.rb +6 -1
  11. data/lib/tbx/admin_note.rb +15 -7
  12. data/lib/tbx/back.rb +6 -1
  13. data/lib/tbx/body.rb +4 -1
  14. data/lib/tbx/change.rb +7 -1
  15. data/lib/tbx/concept_entry.rb +11 -1
  16. data/lib/tbx/data_element.rb +50 -0
  17. data/lib/tbx/date.rb +7 -1
  18. data/lib/tbx/descrip.rb +24 -12
  19. data/lib/tbx/descrip_grp.rb +8 -1
  20. data/lib/tbx/descrip_note.rb +7 -7
  21. data/lib/tbx/document.rb +13 -1
  22. data/lib/tbx/ec.rb +17 -1
  23. data/lib/tbx/encoding_desc.rb +4 -1
  24. data/lib/tbx/file_desc.rb +7 -1
  25. data/lib/tbx/foreign.rb +7 -1
  26. data/lib/tbx/hi.rb +19 -1
  27. data/lib/tbx/item.rb +7 -1
  28. data/lib/tbx/item_grp.rb +7 -1
  29. data/lib/tbx/item_set.rb +7 -1
  30. data/lib/tbx/lang_sec.rb +7 -1
  31. data/lib/tbx/modules/basic.rb +92 -0
  32. data/lib/tbx/modules/core_types.rb +23 -0
  33. data/lib/tbx/modules/linguist.rb +46 -0
  34. data/lib/tbx/modules/min.rb +46 -0
  35. data/lib/tbx/namespace.rb +12 -0
  36. data/lib/tbx/note.rb +10 -1
  37. data/lib/tbx/p.rb +10 -1
  38. data/lib/tbx/ph.rb +7 -1
  39. data/lib/tbx/publication_stmt.rb +4 -1
  40. data/lib/tbx/ref.rb +18 -7
  41. data/lib/tbx/ref_object.rb +7 -1
  42. data/lib/tbx/ref_object_sec.rb +7 -1
  43. data/lib/tbx/revision_desc.rb +4 -1
  44. data/lib/tbx/sc.rb +10 -7
  45. data/lib/tbx/source_desc.rb +4 -1
  46. data/lib/tbx/tbx_header.rb +8 -1
  47. data/lib/tbx/term.rb +7 -1
  48. data/lib/tbx/term_comp.rb +26 -0
  49. data/lib/tbx/term_comp_grp.rb +24 -0
  50. data/lib/tbx/term_comp_sec.rb +45 -0
  51. data/lib/tbx/term_note.rb +45 -12
  52. data/lib/tbx/term_note_grp.rb +8 -1
  53. data/lib/tbx/term_sec.rb +9 -1
  54. data/lib/tbx/text_element.rb +6 -1
  55. data/lib/tbx/title.rb +7 -1
  56. data/lib/tbx/title_stmt.rb +4 -1
  57. data/lib/tbx/transac.rb +18 -7
  58. data/lib/tbx/transac_grp.rb +7 -1
  59. data/lib/tbx/transac_note.rb +18 -7
  60. data/lib/tbx/version.rb +1 -1
  61. data/lib/tbx/xref.rb +17 -1
  62. data/lib/tbx.rb +14 -1
  63. data/reference-docs/README.adoc +109 -0
  64. data/reference-docs/schemas/Basic_Module_Definition.pdf +0 -0
  65. data/reference-docs/schemas/Min_Module_Definition.pdf +0 -0
  66. data/reference-docs/schemas/TBX-Basic_ImplementationGuide/TBX-Basic_ImplementationGuide.pdf +0 -0
  67. data/reference-docs/schemas/TBX-Core_dialect/Schemas/Example_Astronomy_DCA_VALID.tbx +710 -0
  68. data/reference-docs/schemas/TBX-Core_dialect/Schemas/TBX-Core.sch +47 -0
  69. data/reference-docs/schemas/TBX-Core_dialect/Schemas/TBXcoreStructV03_TBX-Core_integrated.rng +1171 -0
  70. data/reference-docs/schemas/TBX-Core_dialect/TBX-Core Definition.pdf +0 -0
  71. data/reference-docs/schemas/TBX-Linguist_dialect/DCA/Example_Astronomy_DCA_VALID.tbx +4028 -0
  72. data/reference-docs/schemas/TBX-Linguist_dialect/DCA/TBX-Linguist_DCA.sch +146 -0
  73. data/reference-docs/schemas/TBX-Linguist_dialect/DCA/TBXcoreStructV03_TBX-Linguist_integrated.rng +1198 -0
  74. data/reference-docs/schemas/TBX-Linguist_dialect/DCT/Example_Astronomy_DCT_VALID.tbx +4019 -0
  75. data/reference-docs/schemas/TBX-Linguist_dialect/DCT/TBX-Linguist.nvdl +41 -0
  76. data/reference-docs/schemas/TBX-Linguist_dialect/DCT/TBX-Linguist_DCT.sch +48 -0
  77. data/reference-docs/schemas/TBX-Linguist_dialect/TBX-Linguist Definition.pdf +0 -0
  78. data/reference-docs/schemas/TBX-Min_dialect/DCA/TBX-Min_DCA.sch +82 -0
  79. data/reference-docs/schemas/TBX-Min_dialect/DCT/TBX-Min.nvdl +25 -0
  80. data/reference-docs/schemas/TBX-Min_dialect/DCT/TBX-Min_DCT.sch +48 -0
  81. data/reference-docs/schemas/TBX-Min_dialect/TBX-Min Definition.pdf +0 -0
  82. data/reference-docs/schemas/TBX_linguist_module/Linguist Module Definition.pdf +0 -0
  83. data/reference-docs/schemas/TBX_linguist_module/Linguist.rng +93 -0
  84. data/reference-docs/schemas/TBX_linguist_module/Linguist.sch +33 -0
  85. data/reference-docs/schemas/TBX_linguist_module/Linguist.tbxmd +47 -0
  86. data/reference-docs/schemas/TBX_module_description_xml/TBX Module Description.pdf +0 -0
  87. data/reference-docs/schemas/TBX_module_description_xml/tbxmd.rng +192 -0
  88. data/reference-docs/schemas/TBX_termComp_module/TermComp-namespace.rng +156 -0
  89. metadata +41 -4
  90. data/lib/tbx/namespaces.rb +0 -9
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tbx
4
+ module Modules
5
+ # Data category definitions for the TBX-Min module.
6
+ #
7
+ # TBX-Min provides a minimal set of data categories for simple
8
+ # terminology exchange.
9
+ #
10
+ # Source: Min.tbxmd, Min.rng, Min.sch
11
+ module Min
12
+ ADMIN_TYPES = {
13
+ customer_subset: "customerSubset",
14
+ }.freeze
15
+
16
+ DESCRIP_TYPES = {
17
+ subject_field: "subjectField",
18
+ }.freeze
19
+
20
+ TERM_NOTE_TYPES = {
21
+ administrative_status: "administrativeStatus",
22
+ part_of_speech: "partOfSpeech",
23
+ }.freeze
24
+
25
+ TERM_NOTE_VALUES = {
26
+ administrative_status: {
27
+ admitted_term: "admittedTerm-admn-sts",
28
+ deprecated_term: "deprecatedTerm-admn-sts",
29
+ superseded_term: "supersededTerm-admn-sts",
30
+ preferred_term: "preferredTerm-admn-sts",
31
+ }.freeze,
32
+ part_of_speech: {
33
+ adjective: "adjective",
34
+ noun: "noun",
35
+ other: "other",
36
+ verb: "verb",
37
+ adverb: "adverb",
38
+ }.freeze,
39
+ }.freeze
40
+
41
+ XREF_TYPES = {
42
+ external_cross_reference: "externalCrossReference",
43
+ }.freeze
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tbx
4
+ # XML namespace for TBX elements per ISO 30042:2019.
5
+ #
6
+ # URI: `urn:iso:std:iso:30042:ed-2`
7
+ #
8
+ # All TBX structural elements use this namespace.
9
+ class Namespace < Lutaml::Xml::Namespace
10
+ uri "urn:iso:std:iso:30042:ed-2"
11
+ end
12
+ end
data/lib/tbx/note.rb CHANGED
@@ -1,6 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Generic note element `<note>`.
5
+ #
6
+ # Provides supplementary information at conceptEntry, langSec, termSec,
7
+ # and various group levels.
8
+ #
9
+ # Content model: `entity.noteText` (mixed text + inline elements hi, ec,
10
+ # foreign, ph, sc).
11
+ #
12
+ # Schema source: TBXcoreStructV03.rng `<define name="note">`
4
13
  class Note < Lutaml::Model::Serializable
5
14
  attribute :id, :string
6
15
  attribute :lang, Lutaml::Xml::W3c::XmlLangType
@@ -14,7 +23,7 @@ module Tbx
14
23
  xml do
15
24
  root "note"
16
25
  mixed_content
17
- namespace ::Tbx::Namespaces::TbxNamespace
26
+ namespace ::Tbx::Namespace
18
27
 
19
28
  map_attribute "id", to: :id
20
29
  w3c_attributes :lang
data/lib/tbx/p.rb CHANGED
@@ -1,6 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Paragraph element `<p>`.
5
+ #
6
+ # Used for prose text in header contexts (publicationStmt, sourceDesc,
7
+ # encodingDesc, change).
8
+ #
9
+ # Content model: `entity.noteText` (mixed text + inline elements hi, ec,
10
+ # foreign, ph, sc).
11
+ #
12
+ # Schema source: TBXcoreStructV03.rng `<define name="p">`
4
13
  class P < Lutaml::Model::Serializable
5
14
  attribute :id, :string
6
15
  attribute :lang, Lutaml::Xml::W3c::XmlLangType
@@ -15,7 +24,7 @@ module Tbx
15
24
  xml do
16
25
  root "p"
17
26
  mixed_content
18
- namespace ::Tbx::Namespaces::TbxNamespace
27
+ namespace ::Tbx::Namespace
19
28
 
20
29
  map_attribute "id", to: :id
21
30
  w3c_attributes :lang
data/lib/tbx/ph.rb CHANGED
@@ -1,12 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # XLIFF inline placeholder `<ph>`.
5
+ #
6
+ # Represents a code that does not have a distinct start and end.
7
+ # Empty element with optional `type` attribute.
8
+ #
9
+ # Schema source: TBXcoreStructV03.rng `<define name="ph">`
4
10
  class Ph < Lutaml::Model::Serializable
5
11
  attribute :type, :string
6
12
 
7
13
  xml do
8
14
  root "ph"
9
- namespace ::Tbx::Namespaces::TbxNamespace
15
+ namespace ::Tbx::Namespace
10
16
 
11
17
  map_attribute "type", to: :type
12
18
  end
@@ -1,6 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Publication statement `<publicationStmt>`.
5
+ #
6
+ # Schema source: TBXcoreStructV03.rng `<define name="publicationStmt">`
4
7
  class PublicationStmt < Lutaml::Model::Serializable
5
8
  attribute :id, :string
6
9
  attribute :p, ::Tbx::P, collection: true
@@ -8,7 +11,7 @@ module Tbx
8
11
  xml do
9
12
  root "publicationStmt"
10
13
  mixed_content
11
- namespace ::Tbx::Namespaces::TbxNamespace
14
+ namespace ::Tbx::Namespace
12
15
 
13
16
  map_attribute "id", to: :id
14
17
  map_element "p", to: :p
data/lib/tbx/ref.rb CHANGED
@@ -1,18 +1,29 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Internal reference element `<ref>`.
5
+ #
6
+ # Used for cross-references within the same termbase. The `target`
7
+ # attribute holds an IDREF pointing to another element's `id`.
8
+ #
9
+ # Permitted `type` values:
10
+ #
11
+ # * Basic module: `crossReference` — reference to another concept entry
12
+ # in the same termbase (DC-164), level: conceptEntry/termSec
13
+ #
14
+ # Content is plain text only (no inline elements per the core RNG).
15
+ #
16
+ # Schema source: TBXcoreStructV03.rng `<define name="ref">`;
17
+ # data category: Basic.tbxmd.
4
18
  class Ref < 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
19
+ include Tbx::DataElement
20
+
21
+ TYPES = Modules::Basic::REF_TYPES.freeze
11
22
 
12
23
  xml do
13
24
  root "ref"
14
25
  mixed_content
15
- namespace ::Tbx::Namespaces::TbxNamespace
26
+ namespace ::Tbx::Namespace
16
27
 
17
28
  map_attribute "id", to: :id
18
29
  w3c_attributes :lang
@@ -1,6 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # A reference object `<refObject>` defining a picklist or value set.
5
+ #
6
+ # Contains `itemSet`, `itemGrp`, or `item` children that enumerate the
7
+ # permitted values for a data category's picklist.
8
+ #
9
+ # Schema source: TBXcoreStructV03.rng `<define name="refObject">`
4
10
  class RefObject < Lutaml::Model::Serializable
5
11
  attribute :id, :string
6
12
  attribute :item_set, ::Tbx::ItemSet, collection: true
@@ -10,7 +16,7 @@ module Tbx
10
16
  xml do
11
17
  root "refObject"
12
18
  mixed_content
13
- namespace ::Tbx::Namespaces::TbxNamespace
19
+ namespace ::Tbx::Namespace
14
20
 
15
21
  map_attribute "id", to: :id
16
22
  map_element "itemSet", to: :item_set
@@ -1,6 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Reference object section `<refObjectSec>` in back matter.
5
+ #
6
+ # Contains reference objects that define picklists and value sets used
7
+ # by data category elements throughout the termbase.
8
+ #
9
+ # Schema source: TBXcoreStructV03.rng `<define name="refObjectSec">`
4
10
  class RefObjectSec < Lutaml::Model::Serializable
5
11
  attribute :id, :string
6
12
  attribute :type, :string
@@ -9,7 +15,7 @@ module Tbx
9
15
  xml do
10
16
  root "refObjectSec"
11
17
  mixed_content
12
- namespace ::Tbx::Namespaces::TbxNamespace
18
+ namespace ::Tbx::Namespace
13
19
 
14
20
  map_attribute "id", to: :id
15
21
  map_attribute "type", to: :type
@@ -1,6 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Revision description `<revisionDesc>`.
5
+ #
6
+ # Schema source: TBXcoreStructV03.rng `<define name="revisionDesc">`
4
7
  class RevisionDesc < Lutaml::Model::Serializable
5
8
  attribute :id, :string
6
9
  attribute :lang, Lutaml::Xml::W3c::XmlLangType
@@ -9,7 +12,7 @@ module Tbx
9
12
  xml do
10
13
  root "revisionDesc"
11
14
  mixed_content
12
- namespace ::Tbx::Namespaces::TbxNamespace
15
+ namespace ::Tbx::Namespace
13
16
 
14
17
  map_attribute "id", to: :id
15
18
  w3c_attributes :lang
data/lib/tbx/sc.rb CHANGED
@@ -1,22 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # XLIFF inline start-code marker `<sc>`.
5
+ #
6
+ # Used for representing inline formatting codes from source formats.
7
+ # The `id` is required and is referenced by a corresponding `<ec>`
8
+ # element's `startRef`.
9
+ #
10
+ # Attributes per core RNG: `id` (required, type ID), `isolated` (optional,
11
+ # yes/no).
12
+ # Schema source: TBXcoreStructV03.rng `<define name="sc">`
4
13
  class Sc < Lutaml::Model::Serializable
5
14
  attribute :id, :string
6
15
  attribute :isolated, :string
7
- attribute :type, :string
8
- attribute :subtype, :string
9
- attribute :target, :string
10
16
 
11
17
  xml do
12
18
  root "sc"
13
- namespace ::Tbx::Namespaces::TbxNamespace
19
+ namespace ::Tbx::Namespace
14
20
 
15
21
  map_attribute "id", to: :id
16
22
  map_attribute "isolated", to: :isolated
17
- map_attribute "type", to: :type
18
- map_attribute "subtype", to: :subtype
19
- map_attribute "target", to: :target
20
23
  end
21
24
  end
22
25
  end
@@ -1,6 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Source description `<sourceDesc>`.
5
+ #
6
+ # Schema source: TBXcoreStructV03.rng `<define name="sourceDesc">`
4
7
  class SourceDesc < Lutaml::Model::Serializable
5
8
  attribute :id, :string
6
9
  attribute :lang, Lutaml::Xml::W3c::XmlLangType
@@ -9,7 +12,7 @@ module Tbx
9
12
  xml do
10
13
  root "sourceDesc"
11
14
  mixed_content
12
- namespace ::Tbx::Namespaces::TbxNamespace
15
+ namespace ::Tbx::Namespace
13
16
 
14
17
  map_attribute "id", to: :id
15
18
  w3c_attributes :lang
@@ -1,6 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Document header `<tbxHeader>`.
5
+ #
6
+ # Contains file description, encoding information, and revision history.
7
+ # Children: `fileDesc` (required), `encodingDesc` (optional),
8
+ # `revisionDesc` (optional).
9
+ #
10
+ # Schema source: TBXcoreStructV03.rng `<define name="tbxHeader">`
4
11
  class TbxHeader < Lutaml::Model::Serializable
5
12
  attribute :id, :string
6
13
  attribute :file_desc, ::Tbx::FileDesc
@@ -10,7 +17,7 @@ module Tbx
10
17
  xml do
11
18
  root "tbxHeader"
12
19
  mixed_content
13
- namespace ::Tbx::Namespaces::TbxNamespace
20
+ namespace ::Tbx::Namespace
14
21
 
15
22
  map_attribute "id", to: :id
16
23
  map_element "fileDesc", to: :file_desc
data/lib/tbx/term.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # The term designation element `<term>`.
5
+ #
6
+ # Contains the actual term text. Content is limited to plain text and
7
+ # `<hi>` inline highlighting elements per the `entity.basicText` pattern.
8
+ #
9
+ # Schema source: TBXcoreStructV03.rng `<define name="term">`
4
10
  class Term < Lutaml::Model::Serializable
5
11
  attribute :id, :string
6
12
  attribute :content, :string, collection: true
@@ -9,7 +15,7 @@ module Tbx
9
15
  xml do
10
16
  root "term"
11
17
  mixed_content
12
- namespace ::Tbx::Namespaces::TbxNamespace
18
+ namespace ::Tbx::Namespace
13
19
 
14
20
  map_attribute "id", to: :id
15
21
  map_content to: :content
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tbx
4
+ # A single component of a decomposed term `<termComp>`.
5
+ #
6
+ # Used for representing hyphenation, syllabification, morphological
7
+ # elements, lemmata, or other logically significant portions of a term.
8
+ # Content is plain text only.
9
+ #
10
+ # Schema source: TermComp-namespace.rng `<define name="termComp">`
11
+ class TermComp < Lutaml::Model::Serializable
12
+ attribute :id, :string
13
+ attribute :lang, Lutaml::Xml::W3c::XmlLangType
14
+ attribute :content, :string, collection: true
15
+
16
+ xml do
17
+ root "termComp"
18
+ mixed_content
19
+ namespace ::Tbx::Namespace
20
+
21
+ map_attribute "id", to: :id
22
+ w3c_attributes :lang
23
+ map_content to: :content
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tbx
4
+ # Term component group `<termCompGrp>`.
5
+ #
6
+ # Groups a `<termComp>` with associated `<note>` elements.
7
+ #
8
+ # Schema source: TermComp-namespace.rng `<define name="termCompGrp">`
9
+ class TermCompGrp < Lutaml::Model::Serializable
10
+ attribute :id, :string
11
+ attribute :term_comp, ::Tbx::TermComp
12
+ attribute :note, ::Tbx::Note, collection: true
13
+
14
+ xml do
15
+ root "termCompGrp"
16
+ mixed_content
17
+ namespace ::Tbx::Namespace
18
+
19
+ map_attribute "id", to: :id
20
+ map_element "termComp", to: :term_comp
21
+ map_element "note", to: :note
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tbx
4
+ # Term component section `<termCompSec>`.
5
+ #
6
+ # Section containing decomposed term components. The `type` attribute
7
+ # indicates the decomposition method.
8
+ #
9
+ # Permitted `type` values (from TermComp-namespace.rng):
10
+ #
11
+ # * `hyphenation` — parts of a term as it would be hyphenated
12
+ # * `lemma` — base form (dictionary entry form)
13
+ # * `morphologicalElement` — individual morphemes comprising the term
14
+ # * `syllabification` — individual syllables comprising the term
15
+ # * `termElement` — any other logically significant portion
16
+ #
17
+ # Schema source: TermComp-namespace.rng `<define name="termCompSec">`
18
+ class TermCompSec < Lutaml::Model::Serializable
19
+ TYPES = {
20
+ hyphenation: "hyphenation",
21
+ lemma: "lemma",
22
+ morphological_element: "morphologicalElement",
23
+ syllabification: "syllabification",
24
+ term_element: "termElement",
25
+ }.freeze
26
+
27
+ attribute :id, :string
28
+ attribute :type, :string
29
+ attribute :note, ::Tbx::Note, collection: true
30
+ attribute :term_comp, ::Tbx::TermComp, collection: true
31
+ attribute :term_comp_grp, ::Tbx::TermCompGrp, collection: true
32
+
33
+ xml do
34
+ root "termCompSec"
35
+ mixed_content
36
+ namespace ::Tbx::Namespace
37
+
38
+ map_attribute "id", to: :id
39
+ map_attribute "type", to: :type
40
+ map_element "note", to: :note
41
+ map_element "termComp", to: :term_comp
42
+ map_element "termCompGrp", to: :term_comp_grp
43
+ end
44
+ end
45
+ end
data/lib/tbx/term_note.rb CHANGED
@@ -1,23 +1,56 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Term-level data category element `<termNote>`.
5
+ #
6
+ # Carries grammatical, administrative, and usage information about a term.
7
+ # Only allowed as a child of `<termSec>` or `<termNoteGrp>`.
8
+ #
9
+ # Permitted `type` values (composed from all modules):
10
+ #
11
+ # * Min module: `administrativeStatus` (picklist: admittedTerm-admn-sts,
12
+ # deprecatedTerm-admn-sts, supersededTerm-admn-sts, preferredTerm-admn-sts),
13
+ # `partOfSpeech` (picklist: adjective, noun, other, verb, adverb)
14
+ # * Basic module: `geographicalUsage` (string), `grammaticalGender`
15
+ # (picklist: masculine, feminine, neuter, other), `termLocation`
16
+ # (picklist: 18 UI element types), `termType` (picklist: fullForm,
17
+ # acronym, abbreviation, shortForm, variant, phrase)
18
+ # * Linguist module: `grammaticalNumber` (picklist: singular, plural, dual,
19
+ # mass, otherNumber), `register` (picklist: colloquialRegister,
20
+ # neutralRegister, technicalRegister, in-houseRegister,
21
+ # bench-levelRegister, slangRegister, vulgarRegister),
22
+ # `transferComment` (string)
23
+ #
24
+ # Content model: `entity.noteText` (mixed text + inline elements hi, ec,
25
+ # foreign, ph, sc).
26
+ #
27
+ # @see TYPES
28
+ #
29
+ # Schema source: TBXcoreStructV03.rng `<define name="termNote">`;
30
+ # data categories: Min.tbxmd, Basic.tbxmd, Linguist.tbxmd;
31
+ # permitted types validated by DCA Schematron (e.g. TBX-Basic_DCA.sch).
4
32
  class TermNote < 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
33
+ include Tbx::DataElement
34
+ include Tbx::DataElement::InlineContent
35
+
36
+ # Permitted termNote/@type values per TBX-Basic DCA Schematron
37
+ # (ISO 30042:2019, TBX-Basic dialect, DCA style).
38
+ #
39
+ # Source: reference-docs/schemas/TBX-Basic_DCA.sch line 54-56
40
+ # "Permitted type value(s): administrativeStatus, partOfSpeech,
41
+ # geographicalUsage, grammaticalGender, termLocation, termType"
42
+ TYPES = Modules::Min::TERM_NOTE_TYPES
43
+ .merge(Modules::Basic::TERM_NOTE_TYPES)
44
+ .merge(Modules::Linguist::TERM_NOTE_TYPES).freeze
45
+
46
+ VALUES = Modules::Min::TERM_NOTE_VALUES
47
+ .merge(Modules::Basic::TERM_NOTE_VALUES)
48
+ .merge(Modules::Linguist::TERM_NOTE_VALUES).freeze
16
49
 
17
50
  xml do
18
51
  root "termNote"
19
52
  mixed_content
20
- namespace ::Tbx::Namespaces::TbxNamespace
53
+ namespace ::Tbx::Namespace
21
54
 
22
55
  map_attribute "id", to: :id
23
56
  w3c_attributes :lang
@@ -1,6 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Groups a `<termNote>` with its associated administrative data and
5
+ # references.
6
+ #
7
+ # Children: `termNote` (required), then entity.noteLinkInfo (admin,
8
+ # adminGrp, note, ref, transacGrp, xref).
9
+ #
10
+ # Schema source: TBXcoreStructV03.rng `<define name="termNoteGrp">`
4
11
  class TermNoteGrp < Lutaml::Model::Serializable
5
12
  attribute :id, :string
6
13
  attribute :term_note, ::Tbx::TermNote
@@ -14,7 +21,7 @@ module Tbx
14
21
  xml do
15
22
  root "termNoteGrp"
16
23
  mixed_content
17
- namespace ::Tbx::Namespaces::TbxNamespace
24
+ namespace ::Tbx::Namespace
18
25
 
19
26
  map_attribute "id", to: :id
20
27
  map_element "termNote", to: :term_note
data/lib/tbx/term_sec.rb CHANGED
@@ -1,6 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Term section `<termSec>`.
5
+ #
6
+ # Contains a single term designation and its associated term-level notes
7
+ # and administrative data. Children: `term` (required), then
8
+ # termNote/termNoteGrp, then auxInfo elements (admin, adminGrp, descrip,
9
+ # descripGrp, note, ref, transacGrp, xref).
10
+ #
11
+ # Schema source: TBXcoreStructV03.rng `<define name="termSec">`
4
12
  class TermSec < Lutaml::Model::Serializable
5
13
  attribute :id, :string
6
14
  attribute :term, ::Tbx::Term
@@ -18,7 +26,7 @@ module Tbx
18
26
  xml do
19
27
  root "termSec"
20
28
  mixed_content
21
- namespace ::Tbx::Namespaces::TbxNamespace
29
+ namespace ::Tbx::Namespace
22
30
 
23
31
  map_attribute "id", to: :id
24
32
  map_element "term", to: :term
@@ -1,6 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Wrapper element `<text>` for the termbase body and back matter.
5
+ #
6
+ # Children: `body` (optional), `back` (optional).
7
+ #
8
+ # Schema source: TBXcoreStructV03.rng `<define name="text">`
4
9
  class TextElement < Lutaml::Model::Serializable
5
10
  attribute :id, :string
6
11
  attribute :body, ::Tbx::Body
@@ -9,7 +14,7 @@ module Tbx
9
14
  xml do
10
15
  root "text"
11
16
  mixed_content
12
- namespace ::Tbx::Namespaces::TbxNamespace
17
+ namespace ::Tbx::Namespace
13
18
 
14
19
  map_attribute "id", to: :id
15
20
  map_element "body", to: :body
data/lib/tbx/title.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Title element `<title>`.
5
+ #
6
+ # Used within `<titleStmt>` to specify the title of the TBX file.
7
+ # Content is plain text only.
8
+ #
9
+ # Schema source: TBXcoreStructV03.rng `<define name="title">`
4
10
  class Title < Lutaml::Model::Serializable
5
11
  attribute :id, :string
6
12
  attribute :lang, Lutaml::Xml::W3c::XmlLangType
@@ -9,7 +15,7 @@ module Tbx
9
15
  xml do
10
16
  root "title"
11
17
  mixed_content
12
- namespace ::Tbx::Namespaces::TbxNamespace
18
+ namespace ::Tbx::Namespace
13
19
 
14
20
  map_attribute "id", to: :id
15
21
  w3c_attributes :lang
@@ -1,6 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Title statement `<titleStmt>`.
5
+ #
6
+ # Schema source: TBXcoreStructV03.rng `<define name="titleStmt">`
4
7
  class TitleStmt < Lutaml::Model::Serializable
5
8
  attribute :id, :string
6
9
  attribute :lang, Lutaml::Xml::W3c::XmlLangType
@@ -10,7 +13,7 @@ module Tbx
10
13
  xml do
11
14
  root "titleStmt"
12
15
  mixed_content
13
- namespace ::Tbx::Namespaces::TbxNamespace
16
+ namespace ::Tbx::Namespace
14
17
 
15
18
  map_attribute "id", to: :id
16
19
  w3c_attributes :lang
data/lib/tbx/transac.rb CHANGED
@@ -1,18 +1,29 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Transaction element `<transac>`.
5
+ #
6
+ # Records an action performed on a terminological entry. The content
7
+ # indicates the type of transaction (origination or modification).
8
+ #
9
+ # Permitted `type` values:
10
+ #
11
+ # * Basic module: `transactionType` (picklist: `origination`, `modification`)
12
+ #
13
+ # Content is plain text only (no inline elements per the core RNG).
14
+ #
15
+ # Schema source: TBXcoreStructV03.rng `<define name="transac">`;
16
+ # data category: Basic.tbxmd.
4
17
  class Transac < 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
18
+ include Tbx::DataElement
19
+
20
+ TYPES = Modules::Basic::TRANSAC_TYPES.freeze
21
+ VALUES = Modules::Basic::TRANSAC_VALUES.freeze
11
22
 
12
23
  xml do
13
24
  root "transac"
14
25
  mixed_content
15
- namespace ::Tbx::Namespaces::TbxNamespace
26
+ namespace ::Tbx::Namespace
16
27
 
17
28
  map_attribute "id", to: :id
18
29
  w3c_attributes :lang