tbx 0.1.0

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 (81) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/rake.yml +15 -0
  3. data/.github/workflows/release.yml +29 -0
  4. data/.gitignore +16 -0
  5. data/.rspec +3 -0
  6. data/.rubocop.yml +17 -0
  7. data/.rubocop_todo.yml +16 -0
  8. data/CHANGELOG.md +5 -0
  9. data/CLAUDE.md +124 -0
  10. data/CODE_OF_CONDUCT.md +10 -0
  11. data/Gemfile +15 -0
  12. data/README.adoc +156 -0
  13. data/Rakefile +12 -0
  14. data/lib/tbx/admin.rb +35 -0
  15. data/lib/tbx/admin_grp.rb +25 -0
  16. data/lib/tbx/admin_note.rb +25 -0
  17. data/lib/tbx/back.rb +17 -0
  18. data/lib/tbx/body.rb +17 -0
  19. data/lib/tbx/change.rb +19 -0
  20. data/lib/tbx/concept_entry.rb +33 -0
  21. data/lib/tbx/date.rb +16 -0
  22. data/lib/tbx/descrip.rb +35 -0
  23. data/lib/tbx/descrip_grp.rb +31 -0
  24. data/lib/tbx/descrip_note.rb +25 -0
  25. data/lib/tbx/document.rb +23 -0
  26. data/lib/tbx/ec.rb +28 -0
  27. data/lib/tbx/encoding_desc.rb +17 -0
  28. data/lib/tbx/file_desc.rb +21 -0
  29. data/lib/tbx/foreign.rb +29 -0
  30. data/lib/tbx/hi.rb +19 -0
  31. data/lib/tbx/item.rb +29 -0
  32. data/lib/tbx/item_grp.rb +29 -0
  33. data/lib/tbx/item_set.rb +21 -0
  34. data/lib/tbx/lang_sec.rb +33 -0
  35. data/lib/tbx/namespaces.rb +9 -0
  36. data/lib/tbx/note.rb +29 -0
  37. data/lib/tbx/p.rb +31 -0
  38. data/lib/tbx/ph.rb +14 -0
  39. data/lib/tbx/publication_stmt.rb +17 -0
  40. data/lib/tbx/ref.rb +25 -0
  41. data/lib/tbx/ref_object.rb +21 -0
  42. data/lib/tbx/ref_object_sec.rb +19 -0
  43. data/lib/tbx/revision_desc.rb +19 -0
  44. data/lib/tbx/sc.rb +22 -0
  45. data/lib/tbx/source_desc.rb +19 -0
  46. data/lib/tbx/tbx_header.rb +21 -0
  47. data/lib/tbx/term.rb +19 -0
  48. data/lib/tbx/term_note.rb +35 -0
  49. data/lib/tbx/term_note_grp.rb +29 -0
  50. data/lib/tbx/term_sec.rb +37 -0
  51. data/lib/tbx/text_element.rb +19 -0
  52. data/lib/tbx/title.rb +19 -0
  53. data/lib/tbx/title_stmt.rb +21 -0
  54. data/lib/tbx/transac.rb +25 -0
  55. data/lib/tbx/transac_grp.rb +27 -0
  56. data/lib/tbx/transac_note.rb +25 -0
  57. data/lib/tbx/version.rb +5 -0
  58. data/lib/tbx/xref.rb +21 -0
  59. data/lib/tbx.rb +67 -0
  60. data/reference-docs/schemas/TBX-Basic_DCA.sch +142 -0
  61. data/reference-docs/schemas/TBX-Basic_dialect_v1/DCA/Example_Astronomy_DCA_VALID.tbx +4032 -0
  62. data/reference-docs/schemas/TBX-Basic_dialect_v1/DCA/TBX-Basic_DCA.sch +142 -0
  63. data/reference-docs/schemas/TBX-Basic_dialect_v1/DCT/Example_Astronomy_DCT_VALID.tbx +4021 -0
  64. data/reference-docs/schemas/TBX-Basic_dialect_v1/DCT/TBX-Basic.nvdl +33 -0
  65. data/reference-docs/schemas/TBX-Basic_dialect_v1/DCT/TBX-Basic_DCT.sch +48 -0
  66. data/reference-docs/schemas/TBX-Basic_dialect_v1/Modules/TBX_basic_module/Basic Module Definition.docx +0 -0
  67. data/reference-docs/schemas/TBX-Basic_dialect_v1/Modules/TBX_basic_module/Basic Module Definition.pdf +0 -0
  68. data/reference-docs/schemas/TBX-Basic_dialect_v1/Modules/TBX_basic_module/Basic.rng +164 -0
  69. data/reference-docs/schemas/TBX-Basic_dialect_v1/Modules/TBX_basic_module/Basic.sch +60 -0
  70. data/reference-docs/schemas/TBX-Basic_dialect_v1/Modules/TBX_basic_module/Basic.tbxmd +125 -0
  71. data/reference-docs/schemas/TBX-Basic_dialect_v1/Modules/TBX_min_module/Min Module Definition.docx +0 -0
  72. data/reference-docs/schemas/TBX-Basic_dialect_v1/Modules/TBX_min_module/Min Module Definition.pdf +0 -0
  73. data/reference-docs/schemas/TBX-Basic_dialect_v1/Modules/TBX_min_module/Min.rng +77 -0
  74. data/reference-docs/schemas/TBX-Basic_dialect_v1/Modules/TBX_min_module/Min.sch +24 -0
  75. data/reference-docs/schemas/TBX-Basic_dialect_v1/Modules/TBX_min_module/Min.tbxmd +42 -0
  76. data/reference-docs/schemas/TBX-Basic_dialect_v1/TBX-Basic Definition.docx +0 -0
  77. data/reference-docs/schemas/TBX-Basic_dialect_v1/TBX-Basic Definition.pdf +0 -0
  78. data/reference-docs/schemas/TBX_core.xsd +534 -0
  79. data/reference-docs/schemas/TBXcoreStructV03.rng +713 -0
  80. data/tbx.gemspec +35 -0
  81. metadata +140 -0
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tbx
4
+ class TermSec < Lutaml::Model::Serializable
5
+ attribute :id, :string
6
+ attribute :term, ::Tbx::Term
7
+ attribute :term_note, ::Tbx::TermNote, collection: true
8
+ attribute :term_note_grp, ::Tbx::TermNoteGrp, collection: true
9
+ attribute :admin, ::Tbx::Admin, collection: true
10
+ attribute :admin_grp, ::Tbx::AdminGrp, collection: true
11
+ attribute :descrip, ::Tbx::Descrip, collection: true
12
+ attribute :descrip_grp, ::Tbx::DescripGrp, collection: true
13
+ attribute :note, ::Tbx::Note, collection: true
14
+ attribute :ref, ::Tbx::Ref, collection: true
15
+ attribute :transac_grp, ::Tbx::TransacGrp, collection: true
16
+ attribute :xref, ::Tbx::Xref, collection: true
17
+
18
+ xml do
19
+ root "termSec"
20
+ mixed_content
21
+ namespace ::Tbx::Namespaces::TbxNamespace
22
+
23
+ map_attribute "id", to: :id
24
+ map_element "term", to: :term
25
+ map_element "termNote", to: :term_note
26
+ map_element "termNoteGrp", to: :term_note_grp
27
+ map_element "admin", to: :admin
28
+ map_element "adminGrp", to: :admin_grp
29
+ map_element "descrip", to: :descrip
30
+ map_element "descripGrp", to: :descrip_grp
31
+ map_element "note", to: :note
32
+ map_element "ref", to: :ref
33
+ map_element "transacGrp", to: :transac_grp
34
+ map_element "xref", to: :xref
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tbx
4
+ class TextElement < Lutaml::Model::Serializable
5
+ attribute :id, :string
6
+ attribute :body, ::Tbx::Body
7
+ attribute :back, ::Tbx::Back
8
+
9
+ xml do
10
+ root "text"
11
+ mixed_content
12
+ namespace ::Tbx::Namespaces::TbxNamespace
13
+
14
+ map_attribute "id", to: :id
15
+ map_element "body", to: :body
16
+ map_element "back", to: :back
17
+ end
18
+ end
19
+ end
data/lib/tbx/title.rb ADDED
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tbx
4
+ class Title < Lutaml::Model::Serializable
5
+ attribute :id, :string
6
+ attribute :lang, Lutaml::Xml::W3c::XmlLangType
7
+ attribute :content, :string, collection: true
8
+
9
+ xml do
10
+ root "title"
11
+ mixed_content
12
+ namespace ::Tbx::Namespaces::TbxNamespace
13
+
14
+ map_attribute "id", to: :id
15
+ w3c_attributes :lang
16
+ map_content to: :content
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tbx
4
+ class TitleStmt < Lutaml::Model::Serializable
5
+ attribute :id, :string
6
+ attribute :lang, Lutaml::Xml::W3c::XmlLangType
7
+ attribute :title, ::Tbx::Title
8
+ attribute :note, ::Tbx::Note, collection: true
9
+
10
+ xml do
11
+ root "titleStmt"
12
+ mixed_content
13
+ namespace ::Tbx::Namespaces::TbxNamespace
14
+
15
+ map_attribute "id", to: :id
16
+ w3c_attributes :lang
17
+ map_element "title", to: :title
18
+ map_element "note", to: :note
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tbx
4
+ 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
11
+
12
+ xml do
13
+ root "transac"
14
+ mixed_content
15
+ namespace ::Tbx::Namespaces::TbxNamespace
16
+
17
+ map_attribute "id", to: :id
18
+ w3c_attributes :lang
19
+ map_attribute "target", to: :target
20
+ map_attribute "datatype", to: :datatype
21
+ map_attribute "type", to: :type
22
+ map_content to: :content
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tbx
4
+ class TransacGrp < Lutaml::Model::Serializable
5
+ attribute :id, :string
6
+ attribute :transac, ::Tbx::Transac
7
+ attribute :date, ::Tbx::DateElement, collection: true
8
+ attribute :note, ::Tbx::Note, collection: true
9
+ attribute :ref, ::Tbx::Ref, collection: true
10
+ attribute :transac_note, ::Tbx::TransacNote, collection: true
11
+ attribute :xref, ::Tbx::Xref, collection: true
12
+
13
+ xml do
14
+ root "transacGrp"
15
+ mixed_content
16
+ namespace ::Tbx::Namespaces::TbxNamespace
17
+
18
+ map_attribute "id", to: :id
19
+ map_element "transac", to: :transac
20
+ map_element "date", to: :date
21
+ map_element "note", to: :note
22
+ map_element "ref", to: :ref
23
+ map_element "transacNote", to: :transac_note
24
+ map_element "xref", to: :xref
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tbx
4
+ class TransacNote < 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
+
12
+ xml do
13
+ root "transacNote"
14
+ mixed_content
15
+ namespace ::Tbx::Namespaces::TbxNamespace
16
+
17
+ map_attribute "id", to: :id
18
+ w3c_attributes :lang
19
+ map_attribute "target", to: :target
20
+ map_attribute "datatype", to: :datatype
21
+ map_attribute "type", to: :type
22
+ map_content to: :content
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tbx
4
+ VERSION = "0.1.0"
5
+ end
data/lib/tbx/xref.rb ADDED
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tbx
4
+ class Xref < Lutaml::Model::Serializable
5
+ attribute :id, :string
6
+ attribute :target, :string
7
+ attribute :type, :string
8
+ attribute :content, :string, collection: true
9
+
10
+ xml do
11
+ root "xref"
12
+ mixed_content
13
+ namespace ::Tbx::Namespaces::TbxNamespace
14
+
15
+ map_attribute "id", to: :id
16
+ map_attribute "target", to: :target
17
+ map_attribute "type", to: :type
18
+ map_content to: :content
19
+ end
20
+ end
21
+ end
data/lib/tbx.rb ADDED
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/model"
4
+ require_relative "tbx/version"
5
+
6
+ module Tbx
7
+ autoload :Namespaces, "#{__dir__}/tbx/namespaces"
8
+
9
+ # Inline elements
10
+ autoload :Ec, "#{__dir__}/tbx/ec"
11
+ autoload :Foreign, "#{__dir__}/tbx/foreign"
12
+ autoload :Hi, "#{__dir__}/tbx/hi"
13
+ autoload :Ph, "#{__dir__}/tbx/ph"
14
+ autoload :Sc, "#{__dir__}/tbx/sc"
15
+
16
+ # Text elements
17
+ autoload :Note, "#{__dir__}/tbx/note"
18
+ autoload :P, "#{__dir__}/tbx/p"
19
+ autoload :Title, "#{__dir__}/tbx/title"
20
+
21
+ # Data elements
22
+ autoload :Admin, "#{__dir__}/tbx/admin"
23
+ autoload :AdminGrp, "#{__dir__}/tbx/admin_grp"
24
+ autoload :AdminNote, "#{__dir__}/tbx/admin_note"
25
+ autoload :Descrip, "#{__dir__}/tbx/descrip"
26
+ autoload :DescripGrp, "#{__dir__}/tbx/descrip_grp"
27
+ autoload :DescripNote, "#{__dir__}/tbx/descrip_note"
28
+ autoload :Ref, "#{__dir__}/tbx/ref"
29
+ autoload :TermNote, "#{__dir__}/tbx/term_note"
30
+ autoload :TermNoteGrp, "#{__dir__}/tbx/term_note_grp"
31
+ autoload :Transac, "#{__dir__}/tbx/transac"
32
+ autoload :TransacGrp, "#{__dir__}/tbx/transac_grp"
33
+ autoload :TransacNote, "#{__dir__}/tbx/transac_note"
34
+ autoload :Xref, "#{__dir__}/tbx/xref"
35
+
36
+ # Date
37
+ autoload :DateElement, "#{__dir__}/tbx/date"
38
+
39
+ # Reference elements
40
+ autoload :Item, "#{__dir__}/tbx/item"
41
+ autoload :ItemGrp, "#{__dir__}/tbx/item_grp"
42
+ autoload :ItemSet, "#{__dir__}/tbx/item_set"
43
+ autoload :RefObject, "#{__dir__}/tbx/ref_object"
44
+ autoload :RefObjectSec, "#{__dir__}/tbx/ref_object_sec"
45
+
46
+ # Structural elements
47
+ autoload :Term, "#{__dir__}/tbx/term"
48
+ autoload :TermSec, "#{__dir__}/tbx/term_sec"
49
+ autoload :LangSec, "#{__dir__}/tbx/lang_sec"
50
+ autoload :ConceptEntry, "#{__dir__}/tbx/concept_entry"
51
+ autoload :Body, "#{__dir__}/tbx/body"
52
+ autoload :TextElement, "#{__dir__}/tbx/text_element"
53
+ autoload :Back, "#{__dir__}/tbx/back"
54
+
55
+ # Header elements
56
+ autoload :Change, "#{__dir__}/tbx/change"
57
+ autoload :EncodingDesc, "#{__dir__}/tbx/encoding_desc"
58
+ autoload :FileDesc, "#{__dir__}/tbx/file_desc"
59
+ autoload :PublicationStmt, "#{__dir__}/tbx/publication_stmt"
60
+ autoload :RevisionDesc, "#{__dir__}/tbx/revision_desc"
61
+ autoload :SourceDesc, "#{__dir__}/tbx/source_desc"
62
+ autoload :TitleStmt, "#{__dir__}/tbx/title_stmt"
63
+ autoload :TbxHeader, "#{__dir__}/tbx/tbx_header"
64
+
65
+ # Root
66
+ autoload :Document, "#{__dir__}/tbx/document"
67
+ end
@@ -0,0 +1,142 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <schema queryBinding="xslt2" xmlns:sqf="http://www.schematron-quickfix.com/validator/process" xmlns="http://purl.oclc.org/dsdl/schematron">
3
+ <ns uri="urn:iso:std:iso:30042:ed-2" prefix="tbx" />
4
+ <pattern id="coreEnforcement">
5
+ <rule context="tbx:termNote">
6
+ <assert test="parent::tbx:termSec or parent::tbx:termNoteGrp/parent::tbx:termSec">Any termNote is only allowed at the termSec level.</assert>
7
+ </rule>
8
+ <rule context="tbx:*[@type]">
9
+ <assert test="@type != ''">Data category must be declared. If no permitted data categories are listed in the grammar schema, blank values are also not allowed.</assert>
10
+ </rule>
11
+ <rule context="*[@target]">
12
+ <assert test="matches(@target,'https?://.+') or @target = //*/@id">ID must be IDREF for internal references or URI following HTTP protocol for external references.</assert>
13
+ </rule>
14
+ </pattern>
15
+ <pattern id="XLIFF.inlineConstraints">
16
+ <rule context="tbx:sc[following-sibling::tbx:ec]">
17
+ <assert test="@isolated='no' or not(@isolated)">@isolated must be 'no' if &lt;sc/&gt; or &lt;ec/&gt; has its corresponding &lt;sc/&gt;/&lt;ec/&gt; in the same note text and @startRef must be used for &lt;ec&gt;</assert>
18
+ </rule>
19
+ <rule context="tbx:ec[preceding-sibling::tbx:sc]">
20
+ <assert test="@isolated='no' or not(@isolated)">@isolated must be 'no' if &lt;sc/&gt; or &lt;ec/&gt; has its corresponding &lt;sc/&gt;/&lt;ec/&gt; in the same note text and @startRef must be used for &lt;ec&gt;</assert>
21
+ <assert test="@startRef">@starRef is required for &lt;ec&gt; if it is in the same note text as its corresponding &lt;sc&gt;</assert>
22
+ <!--<assert test="not(@dir)">@dir only permitted when @isolated is 'yes'.</assert>-->
23
+ <!--@dir IS NOT CURRENTLY USED IN TBX-->
24
+ </rule>
25
+ <rule context="tbx:sc[not(following-sibling::tbx:ec)]">
26
+ <assert test="@isolated='yes' or not(@isolated)">@isolated must be 'yes' if &lt;sc/&gt; or &lt;ec/&gt; does not have its corresponding &lt;sc/&gt;/&lt;sc/&gt; in the same note text.</assert>
27
+ </rule>
28
+ <rule context="tbx:ec[not(preceding-sibling::tbx:sc)]">
29
+ <assert test="@isolated='yes' or not(@isolated)">@isolated must be 'yes' if &lt;sc/&gt; or &lt;ec/&gt; does not have its corresponding &lt;sc/&gt;/&lt;sc/&gt; in the same note text.</assert>
30
+ <assert test="@id">@id is REQUIRED when @isolated is or should be 'yes'.</assert>
31
+ </rule>
32
+ <rule context="tbx:ec[@isolated='yes']">
33
+ <assert test="@id != ''">ID is required if @isolated is 'yes'.</assert>
34
+ </rule>
35
+ </pattern>
36
+ <pattern id="dialectEnforcement">
37
+ <rule context="tbx:tbx">
38
+ <assert test="attribute::type='TBX-Basic'">The name of this dialect should be TBX-Basic.</assert>
39
+ <assert test="attribute::style='dca'">The style of this dialect should be declared as 'dca'.</assert>
40
+ </rule>
41
+ <rule context="*[not(namespace-uri() = 'urn:iso:std:iso:30042:ed-2')]">
42
+ <assert test="false()">DCT style elements are not permitted in DCA style TBX.</assert>
43
+ </rule>
44
+ <!-- Data Category Types -->
45
+ <rule context="tbx:admin/@type">
46
+ <assert test=".='customerSubset' or .='projectSubset' or .='source'">Permitted type value(s): customerSubset, projectSubset, source</assert>
47
+ </rule>
48
+ <rule context="tbx:descrip/@type">
49
+ <assert test=".='subjectField' or .='context' or .='definition'">Permitted type value(s): subjectField, context, definition</assert>
50
+ </rule>
51
+ <rule context="tbx:ref/@type">
52
+ <assert test=".='crossReference'">Permitted type value(s): crossReference</assert>
53
+ </rule>
54
+ <rule context="tbx:termNote/@type">
55
+ <assert test=".='administrativeStatus' or .='partOfSpeech' or .='geographicalUsage' or .='grammaticalGender' or .='termLocation' or .='termType'">Permitted type value(s): administrativeStatus, partOfSpeech, geographicalUsage, grammaticalGender, termLocation, termType</assert>
56
+ </rule>
57
+ <rule context="tbx:transac/@type">
58
+ <assert test=".='transactionType'">Permitted type value(s): transactionType</assert>
59
+ </rule>
60
+ <rule context="tbx:transacNote/@type">
61
+ <assert test=".='responsibility'">Permitted type value(s): responsibility</assert>
62
+ </rule>
63
+ <rule context="tbx:xref/@type">
64
+ <assert test=".='externalCrossReference' or .='xGraphic'">Permitted type value(s): externalCrossReference, xGraphic</assert>
65
+ </rule>
66
+ </pattern>
67
+ <!-- min module rules -->
68
+ <pattern id="module.min.admin">
69
+ <rule context="tbx:admin[@type='customerSubset']">
70
+ <assert test="parent::tbx:conceptEntry or parent::tbx:*[contains(./local-name(),'Grp')][not(./local-name() = 'transacGrp')]/parent::tbx:conceptEntry or parent::tbx:termSec or parent::tbx:*[contains(./local-name(),'Grp')][not(./local-name() = 'transacGrp')]/parent::tbx:termSec">/customerSubset/ may only appear at level(s): conceptEntry, termSec</assert>
71
+ </rule>
72
+ </pattern>
73
+ <pattern id="module.min.descrip">
74
+ <rule context="tbx:descrip[@type='subjectField']">
75
+ <assert test="parent::tbx:conceptEntry or parent::tbx:descripGrp/parent::tbx:conceptEntry">/subjectField/ may only appear at level(s): conceptEntry</assert>
76
+ </rule>
77
+ </pattern>
78
+ <pattern id="module.min.termNote">
79
+ <rule context="tbx:termNote[@type='administrativeStatus']">
80
+ <assert test=".='admittedTerm-admn-sts' or .='deprecatedTerm-admn-sts' or .='supersededTerm-admn-sts' or .='preferredTerm-admn-sts'">/administrativeStatus/ type may be: 'admittedTerm-admn-sts' or 'deprecatedTerm-admn-sts' or 'supersededTerm-admn-sts' or 'preferredTerm-admn-sts'</assert>
81
+ </rule>
82
+ <rule context="tbx:termNote[@type='partOfSpeech']">
83
+ <assert test=".='adjective' or .='noun' or .='other' or .='verb' or .='adverb'">/partOfSpeech/ type may be: 'adjective' or 'noun' or 'other' or 'verb' or 'adverb'</assert>
84
+ </rule>
85
+ </pattern>
86
+ <pattern id="module.min.xref">
87
+ <rule context="tbx:xref[@type='externalCrossReference']">
88
+ <assert test="parent::tbx:conceptEntry or parent::tbx:langSec or parent::tbx:termSec">/externalCrossReference/ may only appear at level(s): conceptEntry, langSec, termSec</assert>
89
+ </rule>
90
+ </pattern>
91
+ <!-- basic module rules -->
92
+ <pattern id="module.basic.admin">
93
+ <rule context="tbx:admin[@type='projectSubset']">
94
+ <assert test="parent::tbx:conceptEntry or parent::tbx:*[contains(./local-name(),'Grp')][not(./local-name() = 'transacGrp')]/parent::tbx:conceptEntry or parent::tbx:termSec or parent::tbx:*[contains(./local-name(),'Grp')][not(./local-name() = 'transacGrp')]/parent::tbx:termSec">/projectSubset/ may only appear at level(s): conceptEntry, termSec</assert>
95
+ </rule>
96
+ <rule context="tbx:admin[@type='source']">
97
+ <assert test="parent::tbx:conceptEntry or parent::tbx:*[contains(./local-name(),'Grp')][not(./local-name() = 'transacGrp')]/parent::tbx:conceptEntry or parent::tbx:langSec or parent::tbx:*[contains(./local-name(),'Grp')][not(./local-name() = 'transacGrp')]/parent::tbx:langSec or parent::tbx:termSec or parent::tbx:*[contains(./local-name(),'Grp')][not(./local-name() = 'transacGrp')]/parent::tbx:termSec">/source/ may only appear at level(s): conceptEntry, langSec, termSec</assert>
98
+ </rule>
99
+ </pattern>
100
+ <pattern id="module.basic.descrip">
101
+ <rule context="tbx:descrip[@type='context']">
102
+ <assert test="parent::tbx:termSec or parent::tbx:descripGrp/parent::tbx:termSec">/context/ may only appear at level(s): termSec</assert>
103
+ </rule>
104
+ <rule context="tbx:descrip[@type='definition']">
105
+ <assert test="parent::tbx:conceptEntry or parent::tbx:descripGrp/parent::tbx:conceptEntry or parent::tbx:langSec or parent::tbx:descripGrp/parent::tbx:langSec">/definition/ may only appear at level(s): conceptEntry, langSec</assert>
106
+ </rule>
107
+ </pattern>
108
+ <pattern id="module.basic.ref">
109
+ <rule context="tbx:ref[@type='crossReference']">
110
+ <assert test="parent::tbx:conceptEntry or parent::tbx:*[contains(./local-name(),'Grp')]/parent::tbx:conceptEntry or parent::tbx:termSec or parent::tbx:*[contains(./local-name(),'Grp')]/parent::tbx:termSec">/crossReference/ may only appear at level(s): conceptEntry, termSec</assert>
111
+ </rule>
112
+ </pattern>
113
+ <pattern id="module.basic.termNote">
114
+ <rule context="tbx:termNote[@type='grammaticalGender']">
115
+ <assert test=".='masculine' or .='feminine' or .='neuter' or .='other'">/grammaticalGender/ type may be: 'masculine' or 'feminine' or 'neuter' or 'other'</assert>
116
+ </rule>
117
+ <rule context="tbx:termNote[@type='termLocation']">
118
+ <assert test=".='checkBox' or .='comboBox' or .='comboBoxElement' or .='dialogBox' or .='groupBox' or .='informativeMessage' or .='interactiveMessage' or .='menuItem' or .='progressBar' or .='pushButton' or .='radioButton' or .='slider' or .='spinBox' or .='tab' or .='tableText' or .='textBox' or .='toolTip' or .='user-definedType'">/termLocation/ type may be: 'checkBox' or 'comboBox' or 'comboBoxElement' or 'dialogBox' or 'groupBox' or 'informativeMessage' or 'interactiveMessage' or 'menuItem' or 'progressBar' or 'pushButton' or 'radioButton' or 'slider' or 'spinBox' or 'tab' or 'tableText' or 'textBox' or 'toolTip' or 'user-definedType'</assert>
119
+ </rule>
120
+ <rule context="tbx:termNote[@type='termType']">
121
+ <assert test=".='fullForm' or .='acronym' or .='abbreviation' or .='shortForm' or .='variant' or .='phrase'">/termType/ type may be: 'fullForm' or 'acronym' or 'abbreviation' or 'shortForm' or 'variant' or 'phrase'</assert>
122
+ </rule>
123
+ </pattern>
124
+ <pattern id="module.basic.transac">
125
+ <rule context="tbx:transac[@type='transactionType']">
126
+ <assert test="parent::tbx:conceptEntry or parent::tbx:transacGrp/parent::tbx:conceptEntry or parent::tbx:langSec or parent::tbx:transacGrp/parent::tbx:langSec or parent::tbx:termSec or parent::tbx:transacGrp/parent::tbx:termSec">/transactionType/ may only appear at level(s): conceptEntry, langSec, termSec</assert>
127
+ </rule>
128
+ <rule context="tbx:transac[@type='transactionType']">
129
+ <assert test=".='origination' or .='modification'">/transactionType/ type may be: 'origination' or 'modification'</assert>
130
+ </rule>
131
+ </pattern>
132
+ <pattern id="module.basic.transacNote">
133
+ <rule context="tbx:transacNote[@type='responsibility']">
134
+ <assert test="parent::tbx:conceptEntry or parent::tbx:transacGrp/parent::tbx:conceptEntry or parent::tbx:langSec or parent::tbx:transacGrp/parent::tbx:langSec or parent::tbx:termSec or parent::tbx:transacGrp/parent::tbx:termSec">/responsibility/ may only appear at level(s): conceptEntry, langSec, termSec</assert>
135
+ </rule>
136
+ </pattern>
137
+ <pattern id="module.basic.xref">
138
+ <rule context="tbx:xref[@type='xGraphic']">
139
+ <assert test="parent::tbx:conceptEntry or parent::tbx:langSec">/xGraphic/ may only appear at level(s): conceptEntry, langSec</assert>
140
+ </rule>
141
+ </pattern>
142
+ </schema>