tbx 0.1.1 → 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 (86) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +1 -1
  3. data/CHANGELOG.md +32 -0
  4. data/CLAUDE.md +21 -1
  5. data/README.adoc +365 -19
  6. data/lib/tbx/admin.rb +24 -11
  7. data/lib/tbx/admin_grp.rb +5 -0
  8. data/lib/tbx/admin_note.rb +14 -6
  9. data/lib/tbx/back.rb +5 -0
  10. data/lib/tbx/body.rb +3 -0
  11. data/lib/tbx/change.rb +6 -0
  12. data/lib/tbx/concept_entry.rb +10 -0
  13. data/lib/tbx/data_element.rb +50 -0
  14. data/lib/tbx/date.rb +6 -0
  15. data/lib/tbx/descrip.rb +23 -11
  16. data/lib/tbx/descrip_grp.rb +7 -0
  17. data/lib/tbx/descrip_note.rb +6 -6
  18. data/lib/tbx/document.rb +12 -0
  19. data/lib/tbx/ec.rb +16 -0
  20. data/lib/tbx/encoding_desc.rb +3 -0
  21. data/lib/tbx/file_desc.rb +6 -0
  22. data/lib/tbx/foreign.rb +6 -0
  23. data/lib/tbx/hi.rb +18 -0
  24. data/lib/tbx/item.rb +6 -0
  25. data/lib/tbx/item_grp.rb +6 -0
  26. data/lib/tbx/item_set.rb +6 -0
  27. data/lib/tbx/lang_sec.rb +6 -0
  28. data/lib/tbx/modules/basic.rb +92 -0
  29. data/lib/tbx/modules/core_types.rb +23 -0
  30. data/lib/tbx/modules/linguist.rb +46 -0
  31. data/lib/tbx/modules/min.rb +46 -0
  32. data/lib/tbx/namespace.rb +5 -0
  33. data/lib/tbx/note.rb +9 -0
  34. data/lib/tbx/p.rb +9 -0
  35. data/lib/tbx/ph.rb +6 -0
  36. data/lib/tbx/publication_stmt.rb +3 -0
  37. data/lib/tbx/ref.rb +17 -6
  38. data/lib/tbx/ref_object.rb +6 -0
  39. data/lib/tbx/ref_object_sec.rb +6 -0
  40. data/lib/tbx/revision_desc.rb +3 -0
  41. data/lib/tbx/sc.rb +9 -6
  42. data/lib/tbx/source_desc.rb +3 -0
  43. data/lib/tbx/tbx_header.rb +7 -0
  44. data/lib/tbx/term.rb +6 -0
  45. data/lib/tbx/term_comp.rb +26 -0
  46. data/lib/tbx/term_comp_grp.rb +24 -0
  47. data/lib/tbx/term_comp_sec.rb +45 -0
  48. data/lib/tbx/term_note.rb +44 -11
  49. data/lib/tbx/term_note_grp.rb +7 -0
  50. data/lib/tbx/term_sec.rb +8 -0
  51. data/lib/tbx/text_element.rb +5 -0
  52. data/lib/tbx/title.rb +6 -0
  53. data/lib/tbx/title_stmt.rb +3 -0
  54. data/lib/tbx/transac.rb +17 -6
  55. data/lib/tbx/transac_grp.rb +6 -0
  56. data/lib/tbx/transac_note.rb +17 -6
  57. data/lib/tbx/version.rb +1 -1
  58. data/lib/tbx/xref.rb +16 -0
  59. data/lib/tbx.rb +13 -0
  60. data/reference-docs/README.adoc +109 -0
  61. data/reference-docs/schemas/Basic_Module_Definition.pdf +0 -0
  62. data/reference-docs/schemas/Min_Module_Definition.pdf +0 -0
  63. data/reference-docs/schemas/TBX-Basic_ImplementationGuide/TBX-Basic_ImplementationGuide.pdf +0 -0
  64. data/reference-docs/schemas/TBX-Core_dialect/Schemas/Example_Astronomy_DCA_VALID.tbx +710 -0
  65. data/reference-docs/schemas/TBX-Core_dialect/Schemas/TBX-Core.sch +47 -0
  66. data/reference-docs/schemas/TBX-Core_dialect/Schemas/TBXcoreStructV03_TBX-Core_integrated.rng +1171 -0
  67. data/reference-docs/schemas/TBX-Core_dialect/TBX-Core Definition.pdf +0 -0
  68. data/reference-docs/schemas/TBX-Linguist_dialect/DCA/Example_Astronomy_DCA_VALID.tbx +4028 -0
  69. data/reference-docs/schemas/TBX-Linguist_dialect/DCA/TBX-Linguist_DCA.sch +146 -0
  70. data/reference-docs/schemas/TBX-Linguist_dialect/DCA/TBXcoreStructV03_TBX-Linguist_integrated.rng +1198 -0
  71. data/reference-docs/schemas/TBX-Linguist_dialect/DCT/Example_Astronomy_DCT_VALID.tbx +4019 -0
  72. data/reference-docs/schemas/TBX-Linguist_dialect/DCT/TBX-Linguist.nvdl +41 -0
  73. data/reference-docs/schemas/TBX-Linguist_dialect/DCT/TBX-Linguist_DCT.sch +48 -0
  74. data/reference-docs/schemas/TBX-Linguist_dialect/TBX-Linguist Definition.pdf +0 -0
  75. data/reference-docs/schemas/TBX-Min_dialect/DCA/TBX-Min_DCA.sch +82 -0
  76. data/reference-docs/schemas/TBX-Min_dialect/DCT/TBX-Min.nvdl +25 -0
  77. data/reference-docs/schemas/TBX-Min_dialect/DCT/TBX-Min_DCT.sch +48 -0
  78. data/reference-docs/schemas/TBX-Min_dialect/TBX-Min Definition.pdf +0 -0
  79. data/reference-docs/schemas/TBX_linguist_module/Linguist Module Definition.pdf +0 -0
  80. data/reference-docs/schemas/TBX_linguist_module/Linguist.rng +93 -0
  81. data/reference-docs/schemas/TBX_linguist_module/Linguist.sch +33 -0
  82. data/reference-docs/schemas/TBX_linguist_module/Linguist.tbxmd +47 -0
  83. data/reference-docs/schemas/TBX_module_description_xml/TBX Module Description.pdf +0 -0
  84. data/reference-docs/schemas/TBX_module_description_xml/tbxmd.rng +192 -0
  85. data/reference-docs/schemas/TBX_termComp_module/TermComp-namespace.rng +156 -0
  86. metadata +36 -2
@@ -0,0 +1,41 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"
3
+ xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" startMode="core">
4
+ <mode name="core">
5
+ <namespace ns="urn:iso:std:iso:30042:ed-2">
6
+ <validate schema="https://raw.githubusercontent.com/LTAC-Global/TBX_Core_RNG/master/TBXcoreStructV03.rng" useMode="RNG"/>
7
+ <validate schema="https://raw.githubusercontent.com/LTAC-Global/TBX-Linguist_dialect/master/DCT/TBX-Linguist_DCT.sch" useMode="SCH"/>
8
+ <validate schema="https://raw.githubusercontent.com/LTAC-Global/TBX_linguist_module/master/Linguist.sch" useMode="SCH"/>
9
+ <validate schema="https://raw.githubusercontent.com/LTAC-Global/TBX_basic_module/master/Basic.sch" useMode="SCH"/>
10
+ <validate schema="https://raw.githubusercontent.com/LTAC-Global/TBX_min_module/master/Min.sch" useMode="SCH"/>
11
+ </namespace>
12
+ <anyNamespace>
13
+ <reject/>
14
+ </anyNamespace>
15
+ </mode>
16
+ <mode name="RNG">
17
+ <namespace ns="http://www.tbxinfo.net/ns/min">
18
+ <validate schema="https://raw.githubusercontent.com/LTAC-Global/TBX_min_module/master/Min.rng"/>
19
+ <attach/>
20
+ </namespace>
21
+ <namespace ns="http://www.tbxinfo.net/ns/basic">
22
+ <validate schema="https://raw.githubusercontent.com/LTAC-Global/TBX_basic_module/master/Basic.rng"/>
23
+ <attach/>
24
+ </namespace>
25
+ <namespace ns="http://www.tbxinfo.net/ns/linguist">
26
+ <validate schema="https://raw.githubusercontent.com/LTAC-Global/TBX_linguist_module/master/Linguist.rng"/>
27
+ <attach/>
28
+ </namespace>
29
+ </mode>
30
+ <mode name="SCH">
31
+ <namespace ns="http://www.tbxinfo.net/ns/min">
32
+ <attach/>
33
+ </namespace>
34
+ <namespace ns="http://www.tbxinfo.net/ns/basic">
35
+ <attach/>
36
+ </namespace>
37
+ <namespace ns="http://www.tbxinfo.net/ns/linguist">
38
+ <attach/>
39
+ </namespace>
40
+ </mode>
41
+ </rules>
@@ -0,0 +1,48 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2"
3
+ xmlns:sqf="http://www.schematron-quickfix.com/validator/process">
4
+ <ns uri="urn:iso:std:iso:30042:ed-2" prefix="tbx" />
5
+
6
+ <pattern id="coreEnforecement">
7
+ <rule context="tbx:termNote">
8
+ <assert test="parent::tbx:termSec or parent::tbx:termNoteGrp/parent::tbx:termSec">Any termNote is only allowed at the termSec level.</assert>
9
+ </rule>
10
+ <rule context="tbx:*[@metatype='termNote']">
11
+ <assert test="parent::tbx:termSec or parent::tbx:termNoteGrp/parent::tbx:termSec">Any termNote is only allowed at the termSec level.</assert>
12
+ </rule>
13
+ <rule context="*[@target]">
14
+ <assert test="matches(@target,'https?://.+') or @target = //*/@id">ID must be IDREF for internal references or URI following HTTP protocol for external references.</assert>
15
+ </rule>
16
+ </pattern>
17
+
18
+ <pattern id="XLIFF.inlineConstraints">
19
+ <rule context="tbx:sc[following-sibling::tbx:ec]">
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
+ </rule>
22
+ <rule context="tbx:ec[preceding-sibling::tbx:sc]">
23
+ <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>
24
+ <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>
25
+ <!--<assert test="not(@dir)">@dir only permitted when @isolated is 'yes'.</assert>--><!--@dir IS NOT CURRENTLY USED IN TBX-->
26
+ </rule>
27
+ <rule context="tbx:sc[not(following-sibling::tbx:ec)]">
28
+ <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>
29
+ </rule>
30
+ <rule context="tbx:ec[not(preceding-sibling::tbx:sc)]">
31
+ <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>
32
+ <assert test="@id">@id is REQUIRED when @isolated is or should be 'yes'.</assert>
33
+ </rule>
34
+ <rule context="tbx:ec[@isolated='yes']">
35
+ <assert test="@id != ''">ID is required if @isolated is 'yes'.</assert>
36
+ </rule>
37
+ </pattern>
38
+
39
+ <pattern id="dialectEnforcement">
40
+ <rule context="tbx:tbx">
41
+ <assert test="attribute::type='TBX-Linguist'">The name of this dialect should be TBX-Linguist</assert>
42
+ <assert test="attribute::style='dct'">The style of this dialect should be declared as 'dct'</assert>
43
+ </rule>
44
+ <rule context="tbx:*[@type]">
45
+ <assert test="not(matches(.,'|.')) or .. is root() or ancestor::tbx:back or ancestor::tbx:tbxHeader">DCA style elements are not permitted in DCT style TBX.</assert>
46
+ </rule>
47
+ </pattern>
48
+ </schema>
@@ -0,0 +1,82 @@
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-Min'">The name of this dialect should be TBX-Min.</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'">Permitted type value(s): customerSubset</assert>
47
+ </rule>
48
+ <rule context="tbx:descrip/@type">
49
+ <assert test=".='subjectField'">Permitted type value(s): subjectField</assert>
50
+ </rule>
51
+ <rule context="tbx:termNote/@type">
52
+ <assert test=".='administrativeStatus' or .='partOfSpeech'">Permitted type value(s): administrativeStatus, partOfSpeech</assert>
53
+ </rule>
54
+ <rule context="tbx:xref/@type">
55
+ <assert test=".='externalCrossReference'">Permitted type value(s): externalCrossReference</assert>
56
+ </rule>
57
+ </pattern>
58
+ <!-- min module rules -->
59
+ <pattern id="module.min.admin">
60
+ <rule context="tbx:admin[@type='customerSubset']">
61
+ <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>
62
+ </rule>
63
+ </pattern>
64
+ <pattern id="module.min.descrip">
65
+ <rule context="tbx:descrip[@type='subjectField']">
66
+ <assert test="parent::tbx:conceptEntry or parent::tbx:descripGrp/parent::tbx:conceptEntry">/subjectField/ may only appear at level(s): conceptEntry</assert>
67
+ </rule>
68
+ </pattern>
69
+ <pattern id="module.min.termNote">
70
+ <rule context="tbx:termNote[@type='administrativeStatus']">
71
+ <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>
72
+ </rule>
73
+ <rule context="tbx:termNote[@type='partOfSpeech']">
74
+ <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>
75
+ </rule>
76
+ </pattern>
77
+ <pattern id="module.min.xref">
78
+ <rule context="tbx:xref[@type='externalCrossReference']">
79
+ <assert test="parent::tbx:conceptEntry or parent::tbx:langSec or parent::tbx:termSec">/externalCrossReference/ may only appear at level(s): conceptEntry, langSec, termSec</assert>
80
+ </rule>
81
+ </pattern>
82
+ </schema>
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"
3
+ xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" startMode="core">
4
+ <mode name="core">
5
+ <namespace ns="urn:iso:std:iso:30042:ed-2">
6
+ <validate schema="https://raw.githubusercontent.com/LTAC-Global/TBX_Core_RNG/master/TBXcoreStructV03.rng" useMode="RNG"/>
7
+ <validate schema="https://raw.githubusercontent.com/LTAC-Global/TBX-Min_dialect/master/DCT/TBX-Min_DCT.sch" useMode="SCH"/>
8
+ <validate schema="https://raw.githubusercontent.com/LTAC-Global/TBX_min_module/master/Min.sch" useMode="SCH"/>
9
+ </namespace>
10
+ <anyNamespace>
11
+ <reject/>
12
+ </anyNamespace>
13
+ </mode>
14
+ <mode name="RNG">
15
+ <namespace ns="http://www.tbxinfo.net/ns/min">
16
+ <validate schema="https://raw.githubusercontent.com/LTAC-Global/TBX_min_module/master/Min.rng"/>
17
+ <attach/>
18
+ </namespace>
19
+ </mode>
20
+ <mode name="SCH">
21
+ <namespace ns="http://www.tbxinfo.net/ns/min">
22
+ <attach/>
23
+ </namespace>
24
+ </mode>
25
+ </rules>
@@ -0,0 +1,48 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2"
3
+ xmlns:sqf="http://www.schematron-quickfix.com/validator/process">
4
+ <ns uri="urn:iso:std:iso:30042:ed-2" prefix="tbx" />
5
+
6
+ <pattern id="coreEnforecement">
7
+ <rule context="tbx:termNote">
8
+ <assert test="parent::tbx:termSec or parent::tbx:termNoteGrp/parent::tbx:termSec">Any termNote is only allowed at the termSec level.</assert>
9
+ </rule>
10
+ <rule context="tbx:*[@metatype='termNote']">
11
+ <assert test="parent::tbx:termSec or parent::tbx:termNoteGrp/parent::tbx:termSec">Any termNote is only allowed at the termSec level.</assert>
12
+ </rule>
13
+ <rule context="*[@target]">
14
+ <assert test="matches(@target,'https?://.+') or @target = //*/@id">ID must be IDREF for internal references or URI following HTTP protocol for external references.</assert>
15
+ </rule>
16
+ </pattern>
17
+
18
+ <pattern id="XLIFF.inlineConstraints">
19
+ <rule context="tbx:sc[following-sibling::tbx:ec]">
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
+ </rule>
22
+ <rule context="tbx:ec[preceding-sibling::tbx:sc]">
23
+ <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>
24
+ <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>
25
+ <!--<assert test="not(@dir)">@dir only permitted when @isolated is 'yes'.</assert>--><!--@dir IS NOT CURRENTLY USED IN TBX-->
26
+ </rule>
27
+ <rule context="tbx:sc[not(following-sibling::tbx:ec)]">
28
+ <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>
29
+ </rule>
30
+ <rule context="tbx:ec[not(preceding-sibling::tbx:sc)]">
31
+ <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>
32
+ <assert test="@id">@id is REQUIRED when @isolated is or should be 'yes'.</assert>
33
+ </rule>
34
+ <rule context="tbx:ec[@isolated='yes']">
35
+ <assert test="@id != ''">ID is required if @isolated is 'yes'.</assert>
36
+ </rule>
37
+ </pattern>
38
+
39
+ <pattern id="dialectEnforcement">
40
+ <rule context="tbx:tbx">
41
+ <assert test="attribute::type='TBX-Min'">The name of this dialect should be TBX-Min</assert>
42
+ <assert test="attribute::style='dct'">The style of this dialect should be declared as 'dct'</assert>
43
+ </rule>
44
+ <rule context="tbx:*[@type]">
45
+ <assert test="not(matches(.,'|.')) or .. is root() or ancestor::tbx:back or ancestor::tbx:tbxHeader">DCA style elements are not permitted in DCT style TBX.</assert>
46
+ </rule>
47
+ </pattern>
48
+ </schema>
@@ -0,0 +1,93 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:xlink="http://www.w3.org/1999/xlink"
3
+ xmlns:teix="http://www.tei-c.org/ns/Examples"
4
+ datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
5
+ ns="http://www.tbxinfo.net/ns/linguist">
6
+
7
+ <!-- optional metaType attribute -->
8
+ <define name="metaType">
9
+ <optional>
10
+ <attribute name="metaType">
11
+ <choice>
12
+ <value>admin</value>
13
+ <value>adminNote</value>
14
+ <value>descrip</value>
15
+ <value>descripNote</value>
16
+ <value>ref</value>
17
+ <value>termNote</value>
18
+ <value>transac</value>
19
+ <value>transacNote</value>
20
+ <value>xref</value>
21
+ </choice>
22
+ </attribute>
23
+ </optional>
24
+ </define>
25
+
26
+ <!-- shared attributes -->
27
+ <define name="attribute.target.internal">
28
+ <attribute name="target">
29
+ <data type="IDREF"/>
30
+ </attribute>
31
+ </define>
32
+ <define name="attribute.target.external">
33
+ <attribute name="target">
34
+ <data type="anyURI">
35
+ <param name="pattern">https?://.+</param>
36
+ </data>
37
+ </attribute>
38
+ </define>
39
+
40
+
41
+ <define name="module.admin">
42
+ <choice>
43
+ <element name="reading">
44
+ <text/>
45
+ </element>
46
+ </choice>
47
+ </define>
48
+
49
+ <define name="module.adminNote">
50
+ <choice>
51
+ <element name="readingNote">
52
+ <text/>
53
+ </element>
54
+ </choice>
55
+ </define>
56
+
57
+ <!-- termNote classified elements -->
58
+ <define name="module.termNote">
59
+ <choice>
60
+ <element name="grammaticalNumber">
61
+ <choice>
62
+ <value>singular</value>
63
+ <value>plural</value>
64
+ <value>dual</value>
65
+ <value>mass</value>
66
+ <value>otherNumber</value>
67
+ </choice>
68
+ </element>
69
+ <element name="register">
70
+ <choice>
71
+ <value>colloquialRegister</value>
72
+ <value>neutralRegister</value>
73
+ <value>technicalRegister</value>
74
+ <value>in-houseRegister</value>
75
+ <value>bench-levelRegister</value>
76
+ <value>slangRegister</value>
77
+ <value>vulgarRegister</value>
78
+ </choice>
79
+ </element>
80
+ <element name="transferComment">
81
+ <text/>
82
+ </element>
83
+ </choice>
84
+ </define>
85
+
86
+ <start>
87
+ <choice>
88
+ <ref name="module.admin"/>
89
+ <ref name="module.adminNote"/>
90
+ <ref name="module.termNote"/>
91
+ </choice>
92
+ </start>
93
+ </grammar>
@@ -0,0 +1,33 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2"
3
+ xmlns:sqf="http://www.schematron-quickfix.com/validator/process">
4
+ <ns uri="urn:iso:std:iso:30042:ed-2" prefix="tbx" />
5
+ <ns uri="http://www.tbxinfo.net/ns/linguist" prefix="ling" />
6
+ <ns uri="http://www.w3.org/2001/XMLSchema" prefix="xs" />
7
+
8
+ <!-- Linguist Module Rules -->
9
+ <pattern id="module.linguist.admin">
10
+ <rule context="ling:reading">
11
+ <assert test="parent::tbx:termSec or parent::tbx:adminGrp/parent::tbx:termSec">Reading must be at the term level.</assert>
12
+ </rule>
13
+ </pattern>
14
+
15
+ <pattern id="module.linguist.adminNote">
16
+ <rule context="ling:readingNote">
17
+ <assert test="parent::tbx:adminGrp/parent::tbx:termSec">readingNote may only be found at the termSec level inside an adminGrp.</assert>
18
+ </rule>
19
+ </pattern>
20
+
21
+ <pattern id="module.linguist.termNote">
22
+ <rule context="ling:grammaticalNumber">
23
+ <assert test="parent::tbx:termSec or parent::tbx:termNoteGrp/parent::tbx:termSec">termNote elements must not occur outside the termSec level.</assert>
24
+ </rule>
25
+ <rule context="ling:register"> <!-- note: this is also known as /usageRegister/ and should be converted to /register/ here -->
26
+ <assert test="parent::tbx:termSec or parent::tbx:termNoteGrp/parent::tbx:termSec">termNote elements must not occur outside the termSec level.</assert>
27
+ </rule>
28
+ <rule context="ling:transferComment">
29
+ <assert test="parent::tbx:termSec or parent::tbx:termNoteGrp/parent::tbx:termSec">termNote elements must not occur outside the termSec level.</assert>
30
+ </rule>
31
+ </pattern>
32
+
33
+ </schema>
@@ -0,0 +1,47 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <?xml-model href="https://raw.githubusercontent.com/LTAC-Global/TBX_module_description_xml/master/tbxmd.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
3
+ <tbxmd module="linguist" ns="http://www.tbxinfo.net/ns/linguist"><!-- ns is only applicable to DCT style TBX -->
4
+ <header>
5
+ <title>Description of the Linguist data category module for TBX</title>
6
+ <description>The Linguist module is a simple data category module created for moderate need terminology data models.</description>
7
+ </header>
8
+ <datCatSet>
9
+ <!--Data-category constraint specifications are arranged in alphabetial order by the
10
+ value of the name attribute. -->
11
+ <termNoteSpec name="grammaticalNumber" datcatId="http://www.datcatinfo.net/datcat/DC-251">
12
+ <contents datatype="picklist">
13
+ <value>singular</value>
14
+ <value>plural</value>
15
+ <value>dual</value>
16
+ <value>mass</value>
17
+ <value>otherNumber</value>
18
+ </contents>
19
+ </termNoteSpec>
20
+ <adminSpec name="reading" datcatId="UNKNOWN">
21
+ <levels>
22
+ <level>termSec</level>
23
+ </levels>
24
+ <contents datatype="string"/>
25
+ </adminSpec>
26
+ <adminNoteSpec name="readingNote" datcatId="UNKNOWN">
27
+ <levels>
28
+ <level>termSec</level>
29
+ </levels>
30
+ <contents datatype="noteText"/>
31
+ </adminNoteSpec>
32
+ <termNoteSpec name="register" datcatId="http://www.datcatinfo.net/datcat/DC-423">
33
+ <contents datatype='picklist'>
34
+ <value>colloquialRegister</value>
35
+ <value>neutralRegister</value>
36
+ <value>technicalRegister</value>
37
+ <value>in-houseRegister</value>
38
+ <value>bench-levelRegister</value>
39
+ <value>slangRegister</value>
40
+ <value>vulgarRegister</value>
41
+ </contents>
42
+ </termNoteSpec>
43
+ <termNoteSpec name="transferComment" datcatId="http://www.datcatinfo.net/datcat/DC-520">
44
+ <contents datatype="string"/>
45
+ </termNoteSpec>
46
+ </datCatSet>
47
+ </tbxmd>
@@ -0,0 +1,192 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0"
3
+ xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
4
+ datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
5
+
6
+ <define name="contents">
7
+ <element name="contents">
8
+ <a:documentation>If the permitted contents of a data category are picklist values, they
9
+ will be placed here in &lt;value&gt; tags. Any other data category must select from
10
+ one of the 4 permitted text datatypes as described in Section 9.5 of ISO
11
+ 30042.</a:documentation>
12
+ <choice>
13
+ <group>
14
+ <ref name="datatype.general"/>
15
+ <optional>
16
+ <ref name="targetType"/>
17
+ </optional>
18
+ <empty/>
19
+ </group>
20
+ <group>
21
+ <ref name="datatype.picklist"/>
22
+ <oneOrMore>
23
+ <ref name="value"/>
24
+ </oneOrMore>
25
+ </group>
26
+ </choice>
27
+ </element>
28
+ </define>
29
+ <define name="datatype.general">
30
+ <attribute name="datatype">
31
+ <a:documentation>The values permitted here are found in ISO 30042.</a:documentation>
32
+ <choice>
33
+ <value>string</value>
34
+ <value>basicText</value>
35
+ <value>noteText</value>
36
+ </choice>
37
+ </attribute>
38
+ </define>
39
+ <define name="datatype.picklist">
40
+ <attribute name="datatype">
41
+ <value>picklist</value>
42
+ </attribute>
43
+ </define>
44
+ <define name="datCatSet">
45
+ <element name="datCatSet">
46
+ <a:documentation>: This element contains the collection of permitted data categories in
47
+ the module.</a:documentation>
48
+ <oneOrMore>
49
+ <ref name="datCatSpec"/>
50
+ </oneOrMore>
51
+ </element>
52
+ </define>
53
+ <define name="datCatSpec">
54
+ <choice>
55
+ <element name="adminSpec">
56
+ <ref name="datCatSpec.content"/>
57
+ </element>
58
+ <element name="adminNoteSpec">
59
+ <ref name="datCatSpec.content"/>
60
+ </element>
61
+ <element name="descripSpec">
62
+ <ref name="datCatSpec.content"/>
63
+ </element>
64
+ <element name="descripNoteSpec">
65
+ <ref name="datCatSpec.content"/>
66
+ </element>
67
+ <element name="refSpec">
68
+ <ref name="datCatSpec.content"/>
69
+ </element>
70
+ <element name="termNoteSpec">
71
+ <ref name="termNoteSpec.content"/>
72
+ </element>
73
+ <element name="transacSpec">
74
+ <ref name="datCatSpec.content"/>
75
+ </element>
76
+ <element name="transacNoteSpec">
77
+ <ref name="datCatSpec.content"/>
78
+ </element>
79
+ <element name="xrefSpec">
80
+ <ref name="datCatSpec.content"/>
81
+ </element>
82
+ </choice>
83
+ </define>
84
+ <define name="datCatSpec.content">
85
+ <a:documentation>This element is used to provide all necessary information to describe a
86
+ single data category.</a:documentation>
87
+ <ref name="datCatSpec.attributes"/>
88
+ <ref name="levels"/>
89
+ <ref name="contents"/>
90
+ </define>
91
+ <define name="datCatSpec.attributes">
92
+ <attribute name="name">
93
+ <a:documentation>This is the name of the data category</a:documentation>
94
+ <text/>
95
+ </attribute>
96
+ <attribute name="datcatId">
97
+ <a:documentation>This is the URI pointing to the source of the data category. For
98
+ standard data categories found on www.datcatinfo.net, this is the
99
+ PID.</a:documentation>
100
+ <data type="anyURI"/>
101
+ </attribute>
102
+ </define>
103
+ <define name="description">
104
+ <element name="description">
105
+ <a:documentation>A description of the module being described</a:documentation>
106
+ <text/>
107
+ </element>
108
+ </define>
109
+
110
+ <define name="header">
111
+ <element name="header">
112
+ <a:documentation>Container for header information.</a:documentation>
113
+ <ref name="title"/>
114
+ <optional>
115
+ <ref name="description"/>
116
+ </optional>
117
+ </element>
118
+ </define>
119
+ <define name="level">
120
+ <element name="level">
121
+ <choice>
122
+ <value>conceptEntry</value>
123
+ <value>langSec</value>
124
+ <value>termSec</value>
125
+ </choice>
126
+ </element>
127
+ </define>
128
+ <define name="levels">
129
+ <element name="levels">
130
+ <a:documentation>The levels in which the data category may occur.</a:documentation>
131
+ <oneOrMore>
132
+ <ref name="level"/>
133
+ </oneOrMore>
134
+ </element>
135
+ </define>
136
+ <define name="tbxmd">
137
+ <element name="tbxmd">
138
+ <a:documentation>The root element of an MDF file.</a:documentation>
139
+ <attribute name="module">
140
+ <a:documentation>This is the name of the module</a:documentation>
141
+ <text/>
142
+ </attribute>
143
+ <attribute name="ns">
144
+ <a:documentation>This is the namespace of the module (for use in DCT style TBX
145
+ files)</a:documentation>
146
+ <data datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" type="anyURI"/>
147
+ </attribute>
148
+ <ref name="header"/>
149
+ <ref name="datCatSet"/>
150
+ </element>
151
+ </define>
152
+ <define name="targetType">
153
+ <attribute name="targetType">
154
+ <choice>
155
+ <value>bibl</value>
156
+ <value>binaryData</value>
157
+ <value>conceptSysDescrip</value>
158
+ <value>element</value>
159
+ <value>entry</value>
160
+ <value>external</value>
161
+ <value>respPerson</value>
162
+ <value>term</value>
163
+ <value>thesaurusDescrip</value>
164
+ </choice>
165
+ </attribute>
166
+ </define>
167
+ <define name="termNoteSpec.content">
168
+ <ref name="datCatSpec.attributes"/>
169
+ <ref name="contents"/>
170
+ </define>
171
+ <define name="title">
172
+ <element name="title">
173
+ <a:documentation>This element is used to provide a more descriptive name for a module,
174
+ in contrast to the simple name given in the @module attribute of
175
+ &lt;mdf&gt;></a:documentation>
176
+ <text/>
177
+ </element>
178
+ </define>
179
+ <define name="value">
180
+ <element name="value">
181
+ <a:documentation>A &lt;value&gt; element contains a specific allowed instance of text
182
+ for a given data category. For example, if the data category is /partOfSpeech/, one
183
+ of the &lt;value&gt; elements in the &lt;contents&gt; section would be:
184
+ &lt;value&gt;noun&lt;/value&gt;</a:documentation>
185
+ <text/>
186
+ </element>
187
+ </define>
188
+
189
+ <start>
190
+ <ref name="tbxmd"/>
191
+ </start>
192
+ </grammar>