relaton-iso 2.1.1 → 2.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.
- checksums.yaml +4 -4
- data/CLAUDE.md +5 -2
- data/README.adoc +21 -1
- data/lib/relaton/iso/bibliography.rb +11 -1
- data/lib/relaton/iso/data_fetcher.rb +220 -151
- data/lib/relaton/iso/data_parser.rb +443 -0
- data/lib/relaton/iso/model/docidentifier.rb +7 -2
- data/lib/relaton/iso/processor.rb +8 -5
- data/lib/relaton/iso/type/pubid.rb +50 -0
- data/lib/relaton/iso/version.rb +1 -1
- metadata +5 -12
- data/grammars/basicdoc.rng +0 -2140
- data/grammars/biblio-standoc.rng +0 -268
- data/grammars/biblio.rng +0 -2125
- data/grammars/relaton-iso-compile.rng +0 -11
- data/grammars/relaton-iso.rng +0 -165
- data/lib/relaton/iso/queue.rb +0 -63
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
|
|
3
|
-
<include href="basicdoc.rng"/>
|
|
4
|
-
<include href="relaton-iso.rng"/>
|
|
5
|
-
<start>
|
|
6
|
-
<choice>
|
|
7
|
-
<ref name="bibitem"/>
|
|
8
|
-
<ref name="bibdata"/>
|
|
9
|
-
</choice>
|
|
10
|
-
</start>
|
|
11
|
-
</grammar>
|
data/grammars/relaton-iso.rng
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
|
3
|
-
<include href="biblio-standoc.rng">
|
|
4
|
-
<define name="bdate">
|
|
5
|
-
<element name="date">
|
|
6
|
-
<attribute name="type">
|
|
7
|
-
<choice>
|
|
8
|
-
<ref name="BibliographicDateType"/>
|
|
9
|
-
<text/>
|
|
10
|
-
</choice>
|
|
11
|
-
</attribute>
|
|
12
|
-
<choice>
|
|
13
|
-
<group>
|
|
14
|
-
<element name="from">
|
|
15
|
-
<ref name="ISO8601Date"/>
|
|
16
|
-
</element>
|
|
17
|
-
<optional>
|
|
18
|
-
<element name="to">
|
|
19
|
-
<ref name="ISO8601Date"/>
|
|
20
|
-
</element>
|
|
21
|
-
</optional>
|
|
22
|
-
</group>
|
|
23
|
-
<element name="on">
|
|
24
|
-
<choice>
|
|
25
|
-
<ref name="ISO8601Date"/>
|
|
26
|
-
<value>--</value>
|
|
27
|
-
<value>–</value>
|
|
28
|
-
</choice>
|
|
29
|
-
</element>
|
|
30
|
-
</choice>
|
|
31
|
-
</element>
|
|
32
|
-
</define>
|
|
33
|
-
<define name="DocumentType">
|
|
34
|
-
<choice>
|
|
35
|
-
<value>international-standard</value>
|
|
36
|
-
<value>technical-specification</value>
|
|
37
|
-
<value>technical-report</value>
|
|
38
|
-
<value>publicly-available-specification</value>
|
|
39
|
-
<value>international-workshop-agreement</value>
|
|
40
|
-
<value>guide</value>
|
|
41
|
-
<value>recommendation</value>
|
|
42
|
-
<value>amendment</value>
|
|
43
|
-
<value>technical-corrigendum</value>
|
|
44
|
-
<value>directive</value>
|
|
45
|
-
<value>committee-document</value>
|
|
46
|
-
<value>addendum</value>
|
|
47
|
-
</choice>
|
|
48
|
-
</define>
|
|
49
|
-
<define name="DocumentSubtype">
|
|
50
|
-
<choice>
|
|
51
|
-
<value>specification</value>
|
|
52
|
-
<value>method-of-test</value>
|
|
53
|
-
<value>vocabulary</value>
|
|
54
|
-
<value>code-of-practice</value>
|
|
55
|
-
</choice>
|
|
56
|
-
</define>
|
|
57
|
-
<define name="structuredidentifier">
|
|
58
|
-
<element name="structuredidentifier">
|
|
59
|
-
<optional>
|
|
60
|
-
<attribute name="type"/>
|
|
61
|
-
</optional>
|
|
62
|
-
<group>
|
|
63
|
-
<ref name="documentnumber"/>
|
|
64
|
-
<optional>
|
|
65
|
-
<ref name="tc-documentnumber"/>
|
|
66
|
-
</optional>
|
|
67
|
-
</group>
|
|
68
|
-
</element>
|
|
69
|
-
</define>
|
|
70
|
-
</include>
|
|
71
|
-
<define name="BibDataExtensionType" combine="interleave">
|
|
72
|
-
<optional>
|
|
73
|
-
<ref name="horizontal">
|
|
74
|
-
<a:documentation>Whether the document is a horizontal standard</a:documentation>
|
|
75
|
-
</ref>
|
|
76
|
-
</optional>
|
|
77
|
-
<optional>
|
|
78
|
-
<ref name="stagename">
|
|
79
|
-
<a:documentation>Human-readable name of the stage of publication, corresponding to the numeric stage code given in `/bibdata/status/stage`</a:documentation>
|
|
80
|
-
</ref>
|
|
81
|
-
</optional>
|
|
82
|
-
<optional>
|
|
83
|
-
<ref name="updates_document_type">
|
|
84
|
-
<a:documentation>If this is an update to another document (e.g. an amendment), the `doctype` will not indicate what type of
|
|
85
|
-
document is being updated (e.g. that this is an amendment to a technical report, as opposed to an amendment to a technical standard).
|
|
86
|
-
The `updates-document-type` value indicates the document type of the document being updated; this may be needed for proper rendering, or
|
|
87
|
-
to formulate the document identifier properly</a:documentation>
|
|
88
|
-
</ref>
|
|
89
|
-
</optional>
|
|
90
|
-
<optional>
|
|
91
|
-
<ref name="fast_track">
|
|
92
|
-
<a:documentation>Whether this is a fast-track standard</a:documentation>
|
|
93
|
-
</ref>
|
|
94
|
-
</optional>
|
|
95
|
-
<optional>
|
|
96
|
-
<ref name="price-code">
|
|
97
|
-
<a:documentation>The price code of the standard, as documented in https://www.iec.ch/members_experts/tools/pdf/IEC_DATA_FEEDS.pdf
|
|
98
|
-
Used for legacy ISO documents</a:documentation>
|
|
99
|
-
</ref>
|
|
100
|
-
</optional>
|
|
101
|
-
</define>
|
|
102
|
-
<define name="updates_document_type">
|
|
103
|
-
<element name="updates-document-type">
|
|
104
|
-
<ref name="DocumentType"/>
|
|
105
|
-
</element>
|
|
106
|
-
</define>
|
|
107
|
-
<define name="horizontal">
|
|
108
|
-
<element name="horizontal">
|
|
109
|
-
<data type="boolean"/>
|
|
110
|
-
</element>
|
|
111
|
-
</define>
|
|
112
|
-
<define name="documentnumber">
|
|
113
|
-
<element name="project-number">
|
|
114
|
-
<optional>
|
|
115
|
-
<attribute name="part">
|
|
116
|
-
<data type="int"/>
|
|
117
|
-
</attribute>
|
|
118
|
-
</optional>
|
|
119
|
-
<optional>
|
|
120
|
-
<attribute name="subpart">
|
|
121
|
-
<data type="int"/>
|
|
122
|
-
</attribute>
|
|
123
|
-
</optional>
|
|
124
|
-
<optional>
|
|
125
|
-
<attribute name="amendment">
|
|
126
|
-
<data type="int"/>
|
|
127
|
-
</attribute>
|
|
128
|
-
</optional>
|
|
129
|
-
<optional>
|
|
130
|
-
<attribute name="corrigendum">
|
|
131
|
-
<data type="int"/>
|
|
132
|
-
</attribute>
|
|
133
|
-
</optional>
|
|
134
|
-
<optional>
|
|
135
|
-
<attribute name="origyr">
|
|
136
|
-
<ref name="ISO8601Date"/>
|
|
137
|
-
</attribute>
|
|
138
|
-
</optional>
|
|
139
|
-
<text/>
|
|
140
|
-
</element>
|
|
141
|
-
</define>
|
|
142
|
-
<define name="tc-documentnumber">
|
|
143
|
-
<element name="tc-document-number">
|
|
144
|
-
<data type="int"/>
|
|
145
|
-
</element>
|
|
146
|
-
</define>
|
|
147
|
-
<define name="stagename">
|
|
148
|
-
<element name="stagename">
|
|
149
|
-
<optional>
|
|
150
|
-
<attribute name="abbreviation"/>
|
|
151
|
-
</optional>
|
|
152
|
-
<text/>
|
|
153
|
-
</element>
|
|
154
|
-
</define>
|
|
155
|
-
<define name="fast_track">
|
|
156
|
-
<element name="fast-track">
|
|
157
|
-
<data type="boolean"/>
|
|
158
|
-
</element>
|
|
159
|
-
</define>
|
|
160
|
-
<define name="price-code">
|
|
161
|
-
<element name="price-code">
|
|
162
|
-
<text/>
|
|
163
|
-
</element>
|
|
164
|
-
</define>
|
|
165
|
-
</grammar>
|
data/lib/relaton/iso/queue.rb
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
module Relaton
|
|
2
|
-
module Iso
|
|
3
|
-
#
|
|
4
|
-
# Queue of links to fetch.
|
|
5
|
-
#
|
|
6
|
-
class Queue
|
|
7
|
-
extend Forwardable
|
|
8
|
-
def_delegator :queue, :[]
|
|
9
|
-
|
|
10
|
-
FILE = "iso-queue.txt".freeze
|
|
11
|
-
|
|
12
|
-
#
|
|
13
|
-
# Open queue file if exist. If not, create new empty queue.
|
|
14
|
-
#
|
|
15
|
-
# @return [Array<String>] queue
|
|
16
|
-
#
|
|
17
|
-
def queue
|
|
18
|
-
@queue ||= File.exist?(FILE) ? File.read(FILE).split("\n") : []
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
#
|
|
22
|
-
# Add item to queue at first position if it is not already there.
|
|
23
|
-
#
|
|
24
|
-
# @param [String] item item to add
|
|
25
|
-
#
|
|
26
|
-
# @return [void]
|
|
27
|
-
#
|
|
28
|
-
def add_first(item)
|
|
29
|
-
queue.unshift item unless queue.include? item
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
#
|
|
33
|
-
# Move or add item to the end of the queue.
|
|
34
|
-
#
|
|
35
|
-
# @param [String] item item to move or add
|
|
36
|
-
#
|
|
37
|
-
# @return [void]
|
|
38
|
-
#
|
|
39
|
-
def move_last(item)
|
|
40
|
-
queue.delete item
|
|
41
|
-
queue << item
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
#
|
|
45
|
-
# Take first item from the queue.
|
|
46
|
-
#
|
|
47
|
-
# @return [String] an item
|
|
48
|
-
#
|
|
49
|
-
# def take_first
|
|
50
|
-
# queue.shift
|
|
51
|
-
# end
|
|
52
|
-
|
|
53
|
-
#
|
|
54
|
-
# Save queue to file.
|
|
55
|
-
#
|
|
56
|
-
# @return [void]
|
|
57
|
-
#
|
|
58
|
-
def save
|
|
59
|
-
File.write FILE, queue.to_a.join("\n")
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
end
|